Mercurial > illumos > onarm
annotate usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_mip.h @ 4:1a15d5aaf794
synchronized with onnv_86 (6202) in onnv-gate
author | Koji Uno <koji.uno@sun.com> |
---|---|
date | Mon, 31 Aug 2009 14:38:03 +0900 |
parents | c9caec207d52 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 * CDDL HEADER START | |
3 * | |
4 * The contents of this file are subject to the terms of the | |
5 * Common Development and Distribution License, Version 1.0 only | |
6 * (the "License"). You may not use this file except in compliance | |
7 * with the License. | |
8 * | |
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
10 * or http://www.opensolaris.org/os/licensing. | |
11 * See the License for the specific language governing permissions | |
12 * and limitations under the License. | |
13 * | |
14 * When distributing Covered Code, include this CDDL HEADER in each | |
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
16 * If applicable, add the following below this CDDL HEADER, with the | |
17 * fields enclosed by brackets "[]" replaced with your own identifying | |
18 * information: Portions Copyright [yyyy] [name of copyright owner] | |
19 * | |
20 * CDDL HEADER END | |
21 */ | |
22 /* | |
23 * Copyright (c) 1999 by Sun Microsystems, Inc. | |
24 * All rights reserved. | |
25 */ | |
26 | |
27 /* | |
28 * Copyright (c) 2007 NEC Corporation | |
29 */ | |
30 | |
31 #ifndef _SNOOP_MIP_H | |
32 #define _SNOOP_MIP_H | |
33 | |
4
1a15d5aaf794
synchronized with onnv_86 (6202) in onnv-gate
Koji Uno <koji.uno@sun.com>
parents:
0
diff
changeset
|
34 #pragma ident "%Z%%M% %I% %E% SMI" |
0 | 35 |
36 #ifdef __cplusplus | |
37 extern "C" { | |
38 #endif | |
39 | |
40 #define ALIGN(ptr) (ptr) | |
41 | |
42 /* | |
43 * E X T E N S I O N S | |
44 */ | |
45 | |
46 typedef struct { | |
47 uchar_t type; | |
48 uchar_t length; | |
49 } exthdr_t; | |
50 | |
51 /* This header is used for Generalized MIP Authentication Extensions */ | |
52 typedef struct { | |
53 uint8_t type; | |
54 uint8_t subtype; | |
55 uint16_t length; | |
56 } gen_exthdr_t; | |
57 | |
58 #define MN_HA_AUTH 32 | |
59 #define MN_FA_AUTH 33 | |
60 #define FA_HA_AUTH 34 | |
61 #define GEN_AUTH 36 | |
62 #define MN_HA_KEY 126 | |
63 #define MN_HA_TRAVERSE 129 | |
64 #define ENCAP_DELIV 130 | |
65 #define MN_NAI 131 | |
66 #define FA_CHALLENGE 132 | |
67 #define MN_FA_KEY 133 | |
68 | |
69 /* Subtypes for Generalized MIP Authentication Extension (GEN_AUTH) */ | |
70 #define GEN_AUTH_MN_AAA 1 | |
71 | |
72 #define KEY_ALG_NONE 0 | |
73 #define SA_MD5_MODE_PREF_SUF 2 /* ...in prefix+suffix */ | |
74 #define SA_HMAC_MD5 3 | |
75 | |
76 /* | |
77 * R E G I S T R A T I O N P R O T O C O L | |
78 */ | |
79 | |
80 #define REG_TYPE_REQ 1 | |
81 #define REG_TYPE_REP 3 | |
82 | |
83 typedef struct ident_str { | |
84 uint32_t high_bits; /* generated by the HA */ | |
85 uint32_t low_bits; /* generated by the MN */ | |
86 } ident_t; | |
87 | |
88 #ifdef __sparc | |
89 #ifdef _BIT_FIELDS_HTOL | |
90 typedef struct registration_request_str { | |
91 uchar_t type; /* must be REG_TYPE_REQ */ | |
92 uchar_t | |
93 Simultaneous_registration : 1, | |
94 Broadcasts_desired : 1, | |
95 Decapsulation_done_locally : 1, /* ...by the popup MN */ | |
96 Minimal_encap_desired : 1, | |
97 GRE_encap_desired : 1, | |
98 VJ_compression_desired : 1, | |
99 BiDirectional_Tunnel_desired : 1, | |
100 reserved : 1; | |
101 ushort_t lifetime; /* 0 = dereg; 0xffff = infinity */ | |
102 in_addr_t home_addr; /* address of the MN */ | |
103 in_addr_t home_agent_addr; /* address of a HA */ | |
104 in_addr_t care_of_addr; /* address of decap endpoint */ | |
105 ident_t identification; /* for replay protection */ | |
106 } regreq_t; | |
107 #endif /* _BIT_FIELDS_HTOL */ | |
108 #endif /* __sparc */ | |
109 | |
110 #if defined(__i386) || defined(__arm) | |
111 #ifdef _BIT_FIELDS_LTOH | |
112 typedef struct registration_request_str { | |
113 uchar_t type; /* must be REG_TYPE_REQ */ | |
114 uchar_t | |
115 reserved : 1, | |
116 BiDirectional_Tunnel_desired : 1, | |
117 VJ_compression_desired : 1, | |
118 GRE_encap_desired : 1, | |
119 Minimal_encap_desired : 1, | |
120 Decapsulation_done_locally : 1, /* ...by the popup MN */ | |
121 Broadcasts_desired : 1, | |
122 Simultaneous_registration : 1; | |
123 ushort_t lifetime; /* 0 = dereg; 0xffff = infinity */ | |
124 in_addr_t home_addr; /* address of the MN */ | |
125 in_addr_t home_agent_addr; /* address of a HA */ | |
126 in_addr_t care_of_addr; /* address of decap endpoint */ | |
127 ident_t identification; /* for replay protection */ | |
128 } regreq_t; | |
129 #endif /* _BIT_FIELDS_LTOH */ | |
130 #endif /* defined(__i386) || defined(__arm) */ | |
131 | |
132 /* | |
133 * Registration Reply sent by a home agent to a mobile node in | |
134 * response to a registration request. | |
135 */ | |
136 typedef struct registration_reply_str { | |
137 uchar_t type; /* must be REG_TYPE_REP */ | |
138 uchar_t code; /* refer to draft document */ | |
139 ushort_t lifetime; /* 0 = dereg; 0xffff = infinity */ | |
140 in_addr_t home_addr; /* address of the mobile node */ | |
141 in_addr_t home_agent_addr; /* address of the home agent */ | |
142 ident_t identification; /* derived from request's field */ | |
143 } regrep_t; | |
144 | |
145 /* service ok */ | |
146 #define REPLY_CODE_ACK 0 | |
147 #define REPLY_CODE_ACK_NO_SIMULTANEOUS 1 | |
148 | |
149 /* denied by FA */ | |
150 #define REPLY_CODE_FA_NACK_UNSPECIFIED 64 | |
151 #define REPLY_CODE_FA_NACK_PROHIBITED 65 | |
152 #define REPLY_CODE_FA_NACK_RESOURCES 66 | |
153 #define REPLY_CODE_FA_NACK_MN_AUTH 67 | |
154 #define REPLY_CODE_FA_NACK_HA_AUTH 68 | |
155 #define REPLY_CODE_FA_NACK_LIFETIME 69 | |
156 #define REPLY_CODE_FA_NACK_BAD_REQUEST 70 | |
157 #define REPLY_CODE_FA_NACK_BAD_REPLY 71 | |
158 #define REPLY_CODE_FA_NACK_ENCAP_UNAVAILABLE 72 | |
159 #define REPLY_CODE_FA_NACK_VJ_UNAVAILABLE 73 | |
160 #define REPLY_CODE_FA_NACK_BIDIR_TUNNEL_UNAVAILABLE 74 | |
161 #define REPLY_CODE_FA_NACK_BIDIR_TUNNEL_NO_TBIT 75 | |
162 #define REPLY_CODE_FA_NACK_BIDIR_TUNNEL_TOO_DISTANT 76 | |
163 #define REPLY_CODE_FA_NACK_ICMP_HA_NET_UNREACHABLE 80 | |
164 #define REPLY_CODE_FA_NACK_ICMP_HA_HOST_UNREACHABLE 81 | |
165 #define REPLY_CODE_FA_NACK_ICMP_HA_PORT_UNREACHABLE 82 | |
166 #define REPLY_CODE_FA_NACK_ICMP_HA_UNREACHABLE 88 | |
167 #define REPLY_CODE_FA_NACK_UNIQUE_HOMEADDR_REQD 96 | |
168 #define REPLY_CODE_FA_NACK_MISSING_NAI 97 | |
169 #define REPLY_CODE_FA_NACK_MISSING_HOME_AGENT 98 | |
170 #define REPLY_CODE_FA_NACK_MISSING_HOMEADDR 99 | |
171 #define REPLY_CODE_FA_NACK_UNKNOWN_CHALLENGE 104 | |
172 #define REPLY_CODE_FA_NACK_MISSING_CHALLENGE 105 | |
173 #define REPLY_CODE_FA_NACK_MISSING_MN_FA 106 | |
174 | |
175 /* denied by HA */ | |
176 #define REPLY_CODE_HA_NACK_UNSPECIFIED 128 | |
177 #define REPLY_CODE_HA_NACK_PROHIBITED 129 | |
178 #define REPLY_CODE_HA_NACK_RESOURCES 130 | |
179 #define REPLY_CODE_HA_NACK_MN_AUTH 131 | |
180 #define REPLY_CODE_HA_NACK_FA_AUTH 132 | |
181 #define REPLY_CODE_HA_NACK_ID_MISMATCH 133 | |
182 #define REPLY_CODE_HA_NACK_BAD_REQUEST 134 | |
183 #define REPLY_CODE_HA_NACK_TOO_MANY_BINDINGS 135 | |
184 #define REPLY_CODE_HA_NACK_BAD_HA_ADDRESS 136 | |
185 #define REPLY_CODE_HA_NACK_BIDIR_TUNNEL_UNAVAILABLE 137 | |
186 #define REPLY_CODE_HA_NACK_BIDIR_TUNNEL_NO_TBIT 138 | |
187 #define REPLY_CODE_HA_NACK_BIDIR_ENCAP_UNAVAILABLE 139 | |
188 | |
189 /* | |
190 * OTHER EXTENSIONS | |
191 */ | |
192 | |
193 /* | |
194 * The second set consists of those extensions which may appear only | |
195 * in ICMP Router Discovery messages [4]. Currently, Mobile IP | |
196 * defines the following Types for Extensions appearing in ICMP | |
197 * Router Discovery messages: | |
198 * | |
199 * 0 One-byte PaddingOne-byte Padding (encoded with no Length nor | |
200 * Data field) | |
201 * 16 Mobility Agent Advertisement | |
202 * 19 Prefix-Lengths | |
203 */ | |
204 #define ICMP_ADV_MSG_PADDING_EXT 0 | |
205 #define ICMP_ADV_MSG_MOBILITY_AGT_EXT 16 | |
206 #define ICMP_ADV_MSG_PREFIX_LENGTH_EXT 19 | |
207 #define ICMP_ADV_MSG_FA_CHALLENGE 24 | |
208 #define ICMP_ADV_MSG_FA_NAI 25 | |
209 | |
210 | |
211 /* | |
212 * Mobility Agent Advertisement Extension | |
213 * The Mobility Agent Adv Extension follows the ICMP Router | |
214 * Advertisement fields.It is used to indicate that an ICMP Router | |
215 * Advertisement message is also an Agent Advertisement being sent | |
216 * by a mobility agent. | |
217 * | |
218 * Type 16 | |
219 * Length (6 + 4*N), where N is the number of care-of addresses | |
220 * advertised. | |
221 * | |
222 * Sequence Number | |
223 * The count of Agent Advertisement messages sent since the | |
224 * agent was initialized (Section 2.3.2). | |
225 * | |
226 * Registration Lifetime | |
227 * The longest lifetime (measured in seconds) that this | |
228 * agent is willing to accept in any Registration Request. | |
229 * A value of 0xffff indicates infinity. This field has no | |
230 * relation to the "Lifetime" field within the ICMP Router | |
231 * Advertisement portion of the Agent Advertisement. | |
232 * | |
233 * R Registration required. Registration with this foreign | |
234 * agent (or another foreign agent on this link) is required | |
235 * rather than using a co-located care-of address. | |
236 * | |
237 * B Busy. The foreign agent will not accept registrations | |
238 * from additional mobile nodes. | |
239 * | |
240 * H Home agent. This agent offers service as a home agent | |
241 * on the link on which this Agent Advertisement message is | |
242 * sent. | |
243 * | |
244 * F Foreign agent. This agent offers service as a foreign | |
245 * agent on the link on which this Agent Advertisement | |
246 * message is sent. | |
247 * | |
248 * M Minimal encapsulation. This agent implements receiving | |
249 * tunneled datagrams that use minimal encapsulation [15]. | |
250 * | |
251 * G GRE encapsulation. This agent implements receiving | |
252 * tunneled datagrams that use GRE encapsulation [8]. | |
253 * | |
254 * V Van Jacobson header compression. This agent supports use | |
255 * of Van Jacobson header compression [10] over the link | |
256 * with any registered mobile node. | |
257 * | |
258 * reserved sent as zero; ignored on reception. | |
259 * | |
260 * Care-of Address(es) | |
261 * The advertised foreign agent care-of address(es) provided | |
262 * by this foreign agent. An Agent Advertisement MUST | |
263 * include at least one care-of address if the 'F' bit | |
264 * is set. The number of care-of addresses present is | |
265 * determined by the Length field in the Extension. | |
266 * | |
267 * A HA must always be prepared to serve the mobile nodes for | |
268 * which it is the home agent. A FA may at times be too busy | |
269 * to serve additional MNs; even so, it must continue to send | |
270 * Agent Advertisements, so that any mobile nodes already registered | |
271 * with it will know that they have not moved out of range of the | |
272 * foreign agent and that the has not failed. A foreign | |
273 * agent may indicate that it is "too busy" to allow new MNs to | |
274 * register with it, by setting the 'B' bit in its Agent Adv. | |
275 * An Agent Adv message MUST NOT have the 'B' bit set if the | |
276 * 'F' bit is not also set, and at least one of the 'F' bit and the | |
277 * 'H' bit MUST be set in any Agent Advertisement message sent. | |
278 * | |
279 * When a FA wishes to require registration even from those | |
280 * mobile nodes which have acquired a co-located care-of address, it | |
281 * sets the 'R' bit to one. Because this bit applies only to foreign | |
282 * agents, an agent MUST NOT set the 'R' bit to one unless the 'F' | |
283 * bit is also set to one. | |
284 */ | |
285 #ifdef __sparc | |
286 #ifdef _BIT_FIELDS_HTOL | |
287 typedef struct mobility_agt_adv_extension { | |
288 uchar_t type; | |
289 uchar_t length; | |
290 ushort_t sequence_num; | |
291 ushort_t reg_lifetime; | |
292 ushort_t reg_bit:1, | |
293 busy_bit:1, | |
294 ha_bit:1, | |
295 fa_bit:1, | |
296 minencap_bit:1, | |
297 greencap_bit:1, | |
298 vanjacob_hdr_comp_bit:1, | |
299 reverse_tunnel_bit:1, | |
300 reserved:8; | |
301 } mobagtadvext_t; | |
302 | |
303 #endif /* _BIT_FIELDS_HTOL */ | |
304 #endif /* __sparc */ | |
305 | |
306 #if defined(__i386) || defined(__arm) | |
307 #ifdef _BIT_FIELDS_LTOH | |
308 typedef struct mobility_agt_adv_extension { | |
309 uchar_t type; | |
310 uchar_t length; | |
311 ushort_t sequence_num; | |
312 ushort_t reg_lifetime; | |
313 uchar_t | |
314 reverse_tunnel_bit:1, | |
315 vanjacob_hdr_comp_bit:1, | |
316 greencap_bit:1, | |
317 minencap_bit:1, | |
318 fa_bit:1, | |
319 ha_bit:1, | |
320 busy_bit:1, | |
321 reg_bit:1; | |
322 uchar_t reserved; | |
323 } mobagtadvext_t; | |
324 #endif /* _BIT_FIELDS_LTOH */ | |
325 #endif /* defined(__i386) || defined(__arm) */ | |
326 | |
327 #ifdef __cplusplus | |
328 } | |
329 #endif | |
330 | |
331 #endif /* _SNOOP_MIP_H */ |