This commit is contained in:
Baptiste Wicht 2016-09-17 20:38:18 +02:00
parent ddb4486afc
commit 395fc33a9a

View File

@ -43,6 +43,19 @@ inline address make_address(uint8_t a, uint8_t b, uint8_t c, uint8_t d){
return addr;
}
struct header {
uint8_t version_ihl;
uint8_t dscp_ecn;
uint16_t total_len;
uint16_t identification;
uint16_t flags_offset;
uint8_t ttl;
uint8_t protocol;
uint16_t header_checksum;
uint32_t source_ip;
uint32_t target_ip;
} __attribute__((packed));
} // end of namespace ip
namespace ethernet {
@ -101,23 +114,6 @@ struct packet_descriptor {
} // end of namespace icmp
namespace ip {
struct header {
uint8_t version_ihl;
uint8_t dscp_ecn;
uint16_t total_len;
uint16_t identification;
uint16_t flags_offset;
uint8_t ttl;
uint8_t protocol;
uint16_t header_checksum;
uint32_t source_ip;
uint32_t target_ip;
} __attribute__((packed));
} // end of namespace ip
namespace dns {
struct header {