typedef struct { uint8_t ihl: 4; uint8_t v: 4; uint8_t tos; uint16_t total_len; uint16_t id; uint16_t off; uint8_t ttl; uint8_t protocol; uint16_t chksum; uint32_t srcip; uint32_t dstip; } __attribute__ ((packed)) IPHeader; typedef struct { uint16_t srcport; uint16_t dstport; uint16_t len; uint16_t chksum; } __attribute__ ((packed)) UDPHeader; typedef struct { uint32_t srcip; uint32_t dstip; uint8_t zero; uint8_t protocol; uint16_t len; } __attribute__ ((packed)) PseudoUDPHeader;