trafgen: add standard include for cpp
[netsniff-ng.git] / ipv4.h
blob7e69cd10ac44cc84a791d862275b089bdec3d0b9
1 /*
2 * netsniff-ng - the packet sniffing beast
3 * By Daniel Borkmann <daniel@netsniff-ng.org>.
4 * Copyright (C) 2009, 2010 Daniel Borkmann
5 * Copyright (C) 2012 Christoph Jaeger <christoph@netsniff-ng.org>
6 * Subject to the GPL, version 2.
7 */
9 #ifndef IPV4_H
10 #define IPV4_H
12 #include <asm/byteorder.h>
14 #include "built_in.h"
16 struct ipv4hdr {
17 #if defined(__LITTLE_ENDIAN_BITFIELD)
18 __extension__ uint8_t h_ihl:4,
19 h_version:4;
20 #elif defined (__BIG_ENDIAN_BITFIELD)
21 __extension__ uint8_t h_version:4,
22 h_ihl:4;
23 #else
24 # error "Please fix <asm/byteorder.h>"
25 #endif
26 uint8_t h_tos;
27 uint16_t h_tot_len;
28 uint16_t h_id;
29 uint16_t h_frag_off;
30 uint8_t h_ttl;
31 uint8_t h_protocol;
32 uint16_t h_check;
33 uint32_t h_saddr;
34 uint32_t h_daddr;
35 } __packed;
37 #endif /* IPV4_H */