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
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.
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]
23 * Copyright (c) 1999 by Sun Microsystems, Inc.
24 * All rights reserved.
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #define ALIGN(ptr) (ptr)
47 /* This header is used for Generalized MIP Authentication Extensions */
59 #define MN_HA_TRAVERSE 129
60 #define ENCAP_DELIV 130
62 #define FA_CHALLENGE 132
65 /* Subtypes for Generalized MIP Authentication Extension (GEN_AUTH) */
66 #define GEN_AUTH_MN_AAA 1
68 #define KEY_ALG_NONE 0
69 #define SA_MD5_MODE_PREF_SUF 2 /* ...in prefix+suffix */
73 * R E G I S T R A T I O N P R O T O C O L
76 #define REG_TYPE_REQ 1
77 #define REG_TYPE_REP 3
79 typedef struct ident_str
{
80 uint32_t high_bits
; /* generated by the HA */
81 uint32_t low_bits
; /* generated by the MN */
85 #ifdef _BIT_FIELDS_HTOL
86 typedef struct registration_request_str
{
87 uchar_t type
; /* must be REG_TYPE_REQ */
89 Simultaneous_registration
: 1,
90 Broadcasts_desired
: 1,
91 Decapsulation_done_locally
: 1, /* ...by the popup MN */
92 Minimal_encap_desired
: 1,
93 GRE_encap_desired
: 1,
94 VJ_compression_desired
: 1,
95 BiDirectional_Tunnel_desired
: 1,
97 ushort_t lifetime
; /* 0 = dereg; 0xffff = infinity */
98 in_addr_t home_addr
; /* address of the MN */
99 in_addr_t home_agent_addr
; /* address of a HA */
100 in_addr_t care_of_addr
; /* address of decap endpoint */
101 ident_t identification
; /* for replay protection */
103 #endif /* _BIT_FIELDS_HTOL */
107 #ifdef _BIT_FIELDS_LTOH
108 typedef struct registration_request_str
{
109 uchar_t type
; /* must be REG_TYPE_REQ */
112 BiDirectional_Tunnel_desired
: 1,
113 VJ_compression_desired
: 1,
114 GRE_encap_desired
: 1,
115 Minimal_encap_desired
: 1,
116 Decapsulation_done_locally
: 1, /* ...by the popup MN */
117 Broadcasts_desired
: 1,
118 Simultaneous_registration
: 1;
119 ushort_t lifetime
; /* 0 = dereg; 0xffff = infinity */
120 in_addr_t home_addr
; /* address of the MN */
121 in_addr_t home_agent_addr
; /* address of a HA */
122 in_addr_t care_of_addr
; /* address of decap endpoint */
123 ident_t identification
; /* for replay protection */
125 #endif /* _BIT_FIELDS_LTOH */
129 * Registration Reply sent by a home agent to a mobile node in
130 * response to a registration request.
132 typedef struct registration_reply_str
{
133 uchar_t type
; /* must be REG_TYPE_REP */
134 uchar_t code
; /* refer to draft document */
135 ushort_t lifetime
; /* 0 = dereg; 0xffff = infinity */
136 in_addr_t home_addr
; /* address of the mobile node */
137 in_addr_t home_agent_addr
; /* address of the home agent */
138 ident_t identification
; /* derived from request's field */
142 #define REPLY_CODE_ACK 0
143 #define REPLY_CODE_ACK_NO_SIMULTANEOUS 1
146 #define REPLY_CODE_FA_NACK_UNSPECIFIED 64
147 #define REPLY_CODE_FA_NACK_PROHIBITED 65
148 #define REPLY_CODE_FA_NACK_RESOURCES 66
149 #define REPLY_CODE_FA_NACK_MN_AUTH 67
150 #define REPLY_CODE_FA_NACK_HA_AUTH 68
151 #define REPLY_CODE_FA_NACK_LIFETIME 69
152 #define REPLY_CODE_FA_NACK_BAD_REQUEST 70
153 #define REPLY_CODE_FA_NACK_BAD_REPLY 71
154 #define REPLY_CODE_FA_NACK_ENCAP_UNAVAILABLE 72
155 #define REPLY_CODE_FA_NACK_VJ_UNAVAILABLE 73
156 #define REPLY_CODE_FA_NACK_BIDIR_TUNNEL_UNAVAILABLE 74
157 #define REPLY_CODE_FA_NACK_BIDIR_TUNNEL_NO_TBIT 75
158 #define REPLY_CODE_FA_NACK_BIDIR_TUNNEL_TOO_DISTANT 76
159 #define REPLY_CODE_FA_NACK_ICMP_HA_NET_UNREACHABLE 80
160 #define REPLY_CODE_FA_NACK_ICMP_HA_HOST_UNREACHABLE 81
161 #define REPLY_CODE_FA_NACK_ICMP_HA_PORT_UNREACHABLE 82
162 #define REPLY_CODE_FA_NACK_ICMP_HA_UNREACHABLE 88
163 #define REPLY_CODE_FA_NACK_UNIQUE_HOMEADDR_REQD 96
164 #define REPLY_CODE_FA_NACK_MISSING_NAI 97
165 #define REPLY_CODE_FA_NACK_MISSING_HOME_AGENT 98
166 #define REPLY_CODE_FA_NACK_MISSING_HOMEADDR 99
167 #define REPLY_CODE_FA_NACK_UNKNOWN_CHALLENGE 104
168 #define REPLY_CODE_FA_NACK_MISSING_CHALLENGE 105
169 #define REPLY_CODE_FA_NACK_MISSING_MN_FA 106
172 #define REPLY_CODE_HA_NACK_UNSPECIFIED 128
173 #define REPLY_CODE_HA_NACK_PROHIBITED 129
174 #define REPLY_CODE_HA_NACK_RESOURCES 130
175 #define REPLY_CODE_HA_NACK_MN_AUTH 131
176 #define REPLY_CODE_HA_NACK_FA_AUTH 132
177 #define REPLY_CODE_HA_NACK_ID_MISMATCH 133
178 #define REPLY_CODE_HA_NACK_BAD_REQUEST 134
179 #define REPLY_CODE_HA_NACK_TOO_MANY_BINDINGS 135
180 #define REPLY_CODE_HA_NACK_BAD_HA_ADDRESS 136
181 #define REPLY_CODE_HA_NACK_BIDIR_TUNNEL_UNAVAILABLE 137
182 #define REPLY_CODE_HA_NACK_BIDIR_TUNNEL_NO_TBIT 138
183 #define REPLY_CODE_HA_NACK_BIDIR_ENCAP_UNAVAILABLE 139
190 * The second set consists of those extensions which may appear only
191 * in ICMP Router Discovery messages [4]. Currently, Mobile IP
192 * defines the following Types for Extensions appearing in ICMP
193 * Router Discovery messages:
195 * 0 One-byte PaddingOne-byte Padding (encoded with no Length nor
197 * 16 Mobility Agent Advertisement
200 #define ICMP_ADV_MSG_PADDING_EXT 0
201 #define ICMP_ADV_MSG_MOBILITY_AGT_EXT 16
202 #define ICMP_ADV_MSG_PREFIX_LENGTH_EXT 19
203 #define ICMP_ADV_MSG_FA_CHALLENGE 24
204 #define ICMP_ADV_MSG_FA_NAI 25
208 * Mobility Agent Advertisement Extension
209 * The Mobility Agent Adv Extension follows the ICMP Router
210 * Advertisement fields.It is used to indicate that an ICMP Router
211 * Advertisement message is also an Agent Advertisement being sent
212 * by a mobility agent.
215 * Length (6 + 4*N), where N is the number of care-of addresses
219 * The count of Agent Advertisement messages sent since the
220 * agent was initialized (Section 2.3.2).
222 * Registration Lifetime
223 * The longest lifetime (measured in seconds) that this
224 * agent is willing to accept in any Registration Request.
225 * A value of 0xffff indicates infinity. This field has no
226 * relation to the "Lifetime" field within the ICMP Router
227 * Advertisement portion of the Agent Advertisement.
229 * R Registration required. Registration with this foreign
230 * agent (or another foreign agent on this link) is required
231 * rather than using a co-located care-of address.
233 * B Busy. The foreign agent will not accept registrations
234 * from additional mobile nodes.
236 * H Home agent. This agent offers service as a home agent
237 * on the link on which this Agent Advertisement message is
240 * F Foreign agent. This agent offers service as a foreign
241 * agent on the link on which this Agent Advertisement
244 * M Minimal encapsulation. This agent implements receiving
245 * tunneled datagrams that use minimal encapsulation [15].
247 * G GRE encapsulation. This agent implements receiving
248 * tunneled datagrams that use GRE encapsulation [8].
250 * V Van Jacobson header compression. This agent supports use
251 * of Van Jacobson header compression [10] over the link
252 * with any registered mobile node.
254 * reserved sent as zero; ignored on reception.
256 * Care-of Address(es)
257 * The advertised foreign agent care-of address(es) provided
258 * by this foreign agent. An Agent Advertisement MUST
259 * include at least one care-of address if the 'F' bit
260 * is set. The number of care-of addresses present is
261 * determined by the Length field in the Extension.
263 * A HA must always be prepared to serve the mobile nodes for
264 * which it is the home agent. A FA may at times be too busy
265 * to serve additional MNs; even so, it must continue to send
266 * Agent Advertisements, so that any mobile nodes already registered
267 * with it will know that they have not moved out of range of the
268 * foreign agent and that the has not failed. A foreign
269 * agent may indicate that it is "too busy" to allow new MNs to
270 * register with it, by setting the 'B' bit in its Agent Adv.
271 * An Agent Adv message MUST NOT have the 'B' bit set if the
272 * 'F' bit is not also set, and at least one of the 'F' bit and the
273 * 'H' bit MUST be set in any Agent Advertisement message sent.
275 * When a FA wishes to require registration even from those
276 * mobile nodes which have acquired a co-located care-of address, it
277 * sets the 'R' bit to one. Because this bit applies only to foreign
278 * agents, an agent MUST NOT set the 'R' bit to one unless the 'F'
279 * bit is also set to one.
282 #ifdef _BIT_FIELDS_HTOL
283 typedef struct mobility_agt_adv_extension
{
286 ushort_t sequence_num
;
287 ushort_t reg_lifetime
;
294 vanjacob_hdr_comp_bit
:1,
295 reverse_tunnel_bit
:1,
299 #endif /* _BIT_FIELDS_HTOL */
303 #ifdef _BIT_FIELDS_LTOH
304 typedef struct mobility_agt_adv_extension
{
307 ushort_t sequence_num
;
308 ushort_t reg_lifetime
;
310 reverse_tunnel_bit
:1,
311 vanjacob_hdr_comp_bit
:1,
320 #endif /* _BIT_FIELDS_LTOH */
327 #endif /* _SNOOP_MIP_H */