#include <libc/netinet/ip.h>
| struct ip |
| Public Attributes | |
|---|---|
| struct in_addr ip_src | ip_dst |
| u_char | ip_hl |
| u_short | ip_id |
| short | ip_len |
| short | ip_off |
| u_char | ip_p |
| u_short | ip_sum |
| u_char | ip_tos |
| u_char | ip_ttl |
| u_char | ip_v |
Structure of an internet header, naked of options.
We declare ip_len and ip_off to be short, rather than u_short pragmatically since otherwise unsigned comparisons can result against negative integers quite easily, and fail in subtle ways.