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