Nativelib - Fix clang compilation issues
[tpg/acess2.git] / KernelLand / Modules / IPStack / icmpv6.h
1 /*
2  * Acess2 IP Stack
3  * - By John Hodge (thePowersGang)
4  *
5  * icmpv6.c
6  * - Internet Control Message Protocol v6
7  */
8 #ifndef _ICMPV6_H_
9 #define _ICMPV6_H_
10
11 #define IPV6PROT_ICMPV6 58
12
13 typedef struct {
14         Uint8   Type;
15         Uint8   Code;
16         Uint16  Checksum;
17 } PACKED tICMPv6_Header;
18
19 typedef struct {
20         Uint32  Reserved;
21 } PACKED tICMPv6_RS;
22
23 typedef struct {
24         Uint8   CurHopLimit;
25         Uint8   Flags;  // M:O:6
26         Uint16  RouterLifetime; // Seconds, life time as a default router (wtf does that mean?)
27         Uint32  ReachableTime;
28         Uint32  RetransTimer;   // Miliseconds, time between transmissions of RAs from this router
29         Uint8   Options[0];
30 } PACKED tICMPv6_RA;
31
32 typedef struct {
33         Uint32  Reserved;
34         tIPv6   TargetAddress;
35         Uint8   Options[0];
36 } PACKED tICMPv6_NS;
37
38 typedef struct {
39         Uint32  Flags;
40         tIPv6   TargetAddress;
41         Uint8   Options[0];
42 } PACKED tICMPv6_NA;
43
44 typedef struct {
45         Uint32  Reserved;
46         tIPv6   TargetAddress;
47         tIPv6   DestinationAddress;
48         Uint8   Options[0];
49 } PACKED tICMPv6_Redirect;
50
51 typedef struct {
52         Uint8   Type;   // 1,2
53         Uint8   Length; // Length of field in units of 8 bytes (incl header), typically 1
54         Uint8   Address[0];
55 } PACKED tICMPv6_Opt_LinkAddr;
56
57 typedef struct {
58         Uint8   Type;   // 3
59         Uint8   Length; // Length of field in units of 8 bytes (incl header), typically
60         Uint8   PrefixLength;
61         Uint8   Flags;  // L:A:6 - 
62         Uint32  ValidLifetime;
63         Uint32  PreferredLifetime;
64         Uint32  _reserved2;
65         tIPv6   Prefix[0];
66 } PACKED tICMPv6_Opt_Prefix;
67
68 typedef struct {
69         Uint8   Type;   // 4
70         Uint8   Length;
71         Uint16  _rsvd1;
72         Uint32  _rsvd2;
73         Uint8   Data[0];        // All or part of the redirected message (not exceeding MTU)
74 } PACKED tICMPv6_Opt_Redirect;
75
76 typedef struct {
77         Uint8   Type;   // 4
78         Uint8   Length;
79         Uint16  _resvd1;
80         Uint32  MTU;
81 } PACKED tICMPv6_Opt_MTU;
82
83 enum {
84         ICMPV6_ERR_UNREACHABLE,
85         ICMPV6_ERR_PACKET_TOO_BIG,
86         ICMPV6_ERR_TIME_EXCEEDED,
87         ICMPV6_ERR_PARAMETER_PROBLEM,
88 };
89 enum {
90         ICMPV6_INFO_ECHO_REQUEST = 128,
91         ICMPV6_INFO_ECHO_REPLY,
92
93         ICMPV6_INFO_ROUTER_SOLICITATION = 133,
94         ICMPV6_INFO_ROUTER_ADVERTISEMENT,
95         ICMPV6_INFO_NEIGHBOUR_SOLICITATION,
96         ICMPV6_INFO_NEIGHBOUR_ADVERTISMENT,
97         ICMPV6_INFO_REDIRECT,
98 };
99
100 enum {
101         ICMPV6_OPTION_SRCLINK = 1,
102         ICMPV6_OPTION_TGTLINK,
103         ICMPV6_OPTION_PREFIX,
104         ICMPV6_OPTION_REDIRECTED_HDR,
105         ICMPV6_OPTION_MTU,
106 };
107
108 #endif
109

UCC git Repository :: git.ucc.asn.au