CCnnnCCa2CCCCCCCCa*
| C | 4-bit version, 4-bit header length |
| C | 8-bit type of service |
| n | 16-bit total length (in bytes) |
| n | 16-bit identification |
| n | 3-bit flags, 13-bit fragment offset |
| C | 8-bit time to live |
| C | 8-bit protocol |
| a2 | 16-bit header checksum |
| CCCC | 32-bit source IP address |
| CCCC | 32-bit destination IP address |
| a* | data if any (assuming no IP header options) |
Wonder why they used a2 instead of n for the checksum?
In reply to Re: Need help with (un)pack templates
by gmargo
in thread Need help with (un)pack templates
by Subop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |