Watt-32 tcp/ip  2.2 dev-rel.10
pcicmp6.h
Go to the documentation of this file.
1 
3 #ifndef _w32_PCICMP6_H
4 #define _w32_PCICMP6_H
5 
6 #include <sys/pack_on.h>
7 
10 struct ICMP6_unused {
11  BYTE type;
12  BYTE code;
13  WORD checksum;
14  DWORD unused;
15  };
16 
20  BYTE type;
21  BYTE code;
22  WORD checksum;
23  DWORD reserved;
24  };
25 
29  BYTE type;
30  BYTE code;
31  WORD checksum;
32  BYTE hop_limit;
33  BYTE reserved : 6;
34  BYTE other : 1;
35  BYTE managed : 1;
36  WORD lifetime;
37  DWORD reach_time;
38  DWORD retrans_time;
39  };
40 
43 struct ICMP6_pointer {
44  BYTE type;
45  BYTE code;
46  WORD checksum;
47  DWORD pointer;
48  };
49 
52 struct ICMP6_MTU {
53  BYTE type;
54  BYTE code;
55  WORD checksum;
56  DWORD MTU;
57  };
58 
61 struct ICMP6_echo {
62  BYTE type;
63  BYTE code;
64  WORD checksum;
65  WORD identifier;
66  WORD sequence;
67  };
68 
71 struct ICMP6_nd_adv {
72  BYTE type;
73  BYTE code;
74  WORD checksum;
75  BYTE reserved1 : 5;
76  BYTE override : 1;
77  BYTE solicited : 1;
78  BYTE router : 1;
79  BYTE reserved2;
80  WORD reserved3;
81  ip6_address target;
82  };
83 
86 struct ICMP6_nd_ra {
87  BYTE type;
88  BYTE code;
89  WORD checksum;
90  BYTE hop_limit;
91  BYTE reserved : 6;
92  BYTE other : 1;
93  BYTE managed : 1;
94  WORD lifetime;
95  };
96 
99 struct ICMP6_nd_sol {
100  BYTE type;
101  BYTE code;
102  WORD checksum;
103  DWORD reserved;
104  ip6_address target;
105  };
106 
109 typedef union ICMP6_PKT {
110  struct ICMP6_unused unused;
111  struct ICMP6_route_sol rsolic;
112  struct ICMP6_route_adv radvert;
113  struct ICMP6_pointer pointer;
114  struct ICMP6_MTU MTU;
115  struct ICMP6_echo echo;
116  struct ICMP6_nd_adv nd_adv;
117  struct ICMP6_nd_ra nd_ra;
118  struct ICMP6_nd_sol nd_solic;
119  } ICMP6_PKT;
120 
121 #include <sys/pack_off.h>
122 
123 enum ND_cacheState {
124  ND_CACHE_UNUSED, /* entry not used */
125  ND_CACHE_INCOMPLETE, /* lookup incomplete */
126  ND_CACHE_REACHABLE, /* responds to ND solitations */
127  ND_CACHE_PROBE, /* ?? */
128  ND_CACHE_MAX
129  };
130 
131 struct icmp6_cache {
132  ip6_address ip;
133  eth_address eth;
134  WORD flags;
135  enum ND_cacheState state;
136  time_t expiry;
137  };
138 
139 #define ND_CACHE_SIZE 10
140 
141 extern DWORD icmp6_6to4_gateway;
142 
143 extern void icmp6_handler (const in6_Header *ip);
144 extern void icmp6_unreach (const in6_Header *ip, int code);
145 
146 extern int icmp6_neigh_solic (const void *addr, eth_address *eth);
147 extern int icmp6_neighbor_advert (const eth_address *eth);
148 extern int icmp6_router_solicitation (void);
149 extern BOOL icmp6_add_gateway4 (void);
150 
151 struct icmp6_cache *icmp6_ncache_lookup (const void *ip);
152 struct icmp6_cache *icmp6_ncache_insert (const void *ip, const void *eth);
153 struct icmp6_cache *icmp6_ncache_insert_fix (const void *ip, const void *eth);
154 
155 #endif
156 
Definition: ip.h:67
int icmp6_neigh_solic(const void *addr, eth_address *eth)
Definition: pcicmp6.c:172
Definition: zinftree.h:24