build: minor: do announcement before tagging
[netsniff-ng.git] / ipv4.h
blob98a1703915fb9d9b17f633c4abe3f5eac3b549b6
1 /*
2 * netsniff-ng - the packet sniffing beast
3 * Copyright (C) 2009, 2010 Daniel Borkmann
4 * Copyright (C) 2012 Christoph Jaeger <christoph@netsniff-ng.org>
5 * Subject to the GPL, version 2.
6 */
8 #ifndef IPV4_H
9 #define IPV4_H
11 #include <asm/byteorder.h>
13 #include "built_in.h"
15 struct ipv4hdr {
16 #if defined(__LITTLE_ENDIAN_BITFIELD)
17 __extension__ uint8_t h_ihl:4,
18 h_version:4;
19 #elif defined (__BIG_ENDIAN_BITFIELD)
20 __extension__ uint8_t h_version:4,
21 h_ihl:4;
22 #else
23 # error "Please fix <asm/byteorder.h>"
24 #endif
25 uint8_t h_tos;
26 uint16_t h_tot_len;
27 uint16_t h_id;
28 uint16_t h_frag_off;
29 uint8_t h_ttl;
30 uint8_t h_protocol;
31 uint16_t h_check;
32 uint32_t h_saddr;
33 uint32_t h_daddr;
34 } __packed;
36 #endif /* IPV4_H */