Make masking constants unsigned, to avoid a gcc3-only compiler warning.
[gpxe.git] / src / include / gpxe / ip.h
bloba6844093016c4b1063fcd9011745f27e1c644b09
1 #ifndef _GPXE_IP_H
2 #define _GPXE_IP_H
4 /** @file
6 * IP protocol
8 */
10 #include <ip.h>
11 #include <gpxe/retry.h>
13 /* IP constants */
15 #define IP_VER 0x40U
16 #define IP_MASK_VER 0xf0U
17 #define IP_MASK_HLEN 0x0fU
18 #define IP_MASK_OFFSET 0x1fffU
19 #define IP_MASK_DONOTFRAG 0x4000U
20 #define IP_MASK_MOREFRAGS 0x2000U
21 #define IP_PSHLEN 12
23 /* IP header defaults */
24 #define IP_TOS 0
25 #define IP_TTL 64
27 #define IP_FRAG_IOB_SIZE 1500
28 #define IP_FRAG_TIMEOUT 50
30 /* IP4 pseudo header */
31 struct ipv4_pseudo_header {
32 struct in_addr src;
33 struct in_addr dest;
34 uint8_t zero_padding;
35 uint8_t protocol;
36 uint16_t len;
39 /** An IPv4 address/routing table entry */
40 struct ipv4_miniroute {
41 /** List of miniroutes */
42 struct list_head list;
44 /** Network device */
45 struct net_device *netdev;
47 /** IPv4 address */
48 struct in_addr address;
49 /** Subnet mask */
50 struct in_addr netmask;
51 /** Gateway address */
52 struct in_addr gateway;
55 /* Fragment reassembly buffer */
56 struct frag_buffer {
57 /* Identification number */
58 uint16_t ident;
59 /* Source network address */
60 struct in_addr src;
61 /* Destination network address */
62 struct in_addr dest;
63 /* Reassembled I/O buffer */
64 struct io_buffer *frag_iob;
65 /* Reassembly timer */
66 struct retry_timer frag_timer;
67 /* List of fragment reassembly buffers */
68 struct list_head list;
71 struct io_buffer;
72 struct net_device;
73 struct net_protocol;
74 struct tcpip_protocol;
76 extern struct list_head ipv4_miniroutes;
78 extern struct net_protocol ipv4_protocol;
80 extern int add_ipv4_address ( struct net_device *netdev,
81 struct in_addr address, struct in_addr netmask,
82 struct in_addr gateway );
83 extern void del_ipv4_address ( struct net_device *netdev );
85 #endif /* _GPXE_IP_H */