xref: /minix3/minix/include/net/gen/ip_hdr.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /*
2*433d6423SLionel Sambuc server/ip/gen/ip_hdr.h
3*433d6423SLionel Sambuc */
4*433d6423SLionel Sambuc 
5*433d6423SLionel Sambuc #ifndef __SERVER__IP__GEN__HDR_H__
6*433d6423SLionel Sambuc #define __SERVER__IP__GEN__HDR_H__
7*433d6423SLionel Sambuc 
8*433d6423SLionel Sambuc typedef struct ip_hdr
9*433d6423SLionel Sambuc {
10*433d6423SLionel Sambuc 	u8_t ih_vers_ihl,
11*433d6423SLionel Sambuc 		ih_tos;
12*433d6423SLionel Sambuc 	u16_t ih_length,
13*433d6423SLionel Sambuc 		ih_id,
14*433d6423SLionel Sambuc 		ih_flags_fragoff;
15*433d6423SLionel Sambuc 	u8_t ih_ttl,
16*433d6423SLionel Sambuc 		ih_proto;
17*433d6423SLionel Sambuc 	u16_t ih_hdr_chk;
18*433d6423SLionel Sambuc 	ipaddr_t ih_src,
19*433d6423SLionel Sambuc 		ih_dst;
20*433d6423SLionel Sambuc } ip_hdr_t;
21*433d6423SLionel Sambuc 
22*433d6423SLionel Sambuc #define IH_IHL_MASK	0xf
23*433d6423SLionel Sambuc #define IH_VERSION_MASK	0xf
24*433d6423SLionel Sambuc #define IH_FRAGOFF_MASK	0x1fff
25*433d6423SLionel Sambuc #define IH_MORE_FRAGS	0x2000
26*433d6423SLionel Sambuc #define IH_DONT_FRAG	0x4000
27*433d6423SLionel Sambuc #define IH_FLAGS_UNUSED	0x8000
28*433d6423SLionel Sambuc 
29*433d6423SLionel Sambuc #define IP_OPT_COPIED	0x80
30*433d6423SLionel Sambuc #define IP_OPT_NUMBER	0x1f
31*433d6423SLionel Sambuc 
32*433d6423SLionel Sambuc #define IP_OPT_EOL	0x00	/* End of Options List, RFC-791 */
33*433d6423SLionel Sambuc #define IP_OPT_NOP	0x01	/* No Operation, RFC-791 */
34*433d6423SLionel Sambuc #define IP_OPT_RR	0x07	/* Record Route, RFC-791 */
35*433d6423SLionel Sambuc #define IP_OPT_TS	0x44	/* Timestamp, RFC-791 */
36*433d6423SLionel Sambuc #define IP_OPT_SEC	0x82	/* Security, RFC-1108 */
37*433d6423SLionel Sambuc #define IP_OPT_LSRR	0x83	/* Loose Source Route, RFC-791 */
38*433d6423SLionel Sambuc #define IP_OPT_SSRR	0x89	/* Strict Source Route, RFC-791 */
39*433d6423SLionel Sambuc #define IP_OPT_RTRALT	0x94	/* Router Alert, RFC-2113 */
40*433d6423SLionel Sambuc 
41*433d6423SLionel Sambuc #define IP_OPT_RR_MIN		4
42*433d6423SLionel Sambuc 
43*433d6423SLionel Sambuc #endif /* __SERVER__IP__GEN__HDR_H__ */
44*433d6423SLionel Sambuc 
45*433d6423SLionel Sambuc /*
46*433d6423SLionel Sambuc  * $PchId: ip_hdr.h,v 1.5 2002/06/10 07:11:46 philip Exp $
47*433d6423SLionel Sambuc  */
48