I have started one adventure in raw sockets and I found one ip header that I don't understand, my doubt is
- hdrlen:4
This two points four are used for what?
- attribute((packed));
What is this attribute?
struct iphdr {
uint8_t hdrlen:4;
uint8_t version:4;
uint8_t ecn:2; // Explicit Congestion Notification - RFC 3168
uint8_t dscp:6; // DiffServ Code Point
uint16_t length;
uint16_t ident;
uint16_t fragoff:13;
uint16_t flags:3;
uint8_t ttl;
uint8_t protocol;
uint16_t checksum;
uint32_t srcip;
uint32_t dstip;
uint32_t options[ ]; // Present if hdrlen > 5
} __attribute__((__packed__));