Project

General

Profile

Statistics
| Revision:

root / lab4 / .minix-src / include / net / gen / ip_hdr.h @ 13

History | View | Annotate | Download (1.06 KB)

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