1*f439973dSWarner Losh /** @file 2*f439973dSWarner Losh UEFI Dynamic Host Configuration Protocol 6 Definition, which is used to get IPv6 3*f439973dSWarner Losh addresses and other configuration parameters from DHCPv6 servers. 4*f439973dSWarner Losh 5*f439973dSWarner Losh Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR> 6*f439973dSWarner Losh SPDX-License-Identifier: BSD-2-Clause-Patent 7*f439973dSWarner Losh 8*f439973dSWarner Losh @par Revision Reference: 9*f439973dSWarner Losh This Protocol is introduced in UEFI Specification 2.2 10*f439973dSWarner Losh 11*f439973dSWarner Losh **/ 12*f439973dSWarner Losh 13*f439973dSWarner Losh #ifndef __EFI_DHCP6_PROTOCOL_H__ 14*f439973dSWarner Losh #define __EFI_DHCP6_PROTOCOL_H__ 15*f439973dSWarner Losh 16*f439973dSWarner Losh #define EFI_DHCP6_PROTOCOL_GUID \ 17*f439973dSWarner Losh { \ 18*f439973dSWarner Losh 0x87c8bad7, 0x595, 0x4053, {0x82, 0x97, 0xde, 0xde, 0x39, 0x5f, 0x5d, 0x5b } \ 19*f439973dSWarner Losh } 20*f439973dSWarner Losh 21*f439973dSWarner Losh #define EFI_DHCP6_SERVICE_BINDING_PROTOCOL_GUID \ 22*f439973dSWarner Losh { \ 23*f439973dSWarner Losh 0x9fb9a8a1, 0x2f4a, 0x43a6, {0x88, 0x9c, 0xd0, 0xf7, 0xb6, 0xc4, 0x7a, 0xd5 } \ 24*f439973dSWarner Losh } 25*f439973dSWarner Losh 26*f439973dSWarner Losh typedef struct _EFI_DHCP6_PROTOCOL EFI_DHCP6_PROTOCOL; 27*f439973dSWarner Losh 28*f439973dSWarner Losh typedef enum { 29*f439973dSWarner Losh /// 30*f439973dSWarner Losh /// The EFI DHCPv6 Protocol instance is configured, and start() needs 31*f439973dSWarner Losh /// to be called 32*f439973dSWarner Losh /// 33*f439973dSWarner Losh Dhcp6Init = 0x0, 34*f439973dSWarner Losh /// 35*f439973dSWarner Losh /// A Solicit packet is sent out to discover DHCPv6 server, and the EFI 36*f439973dSWarner Losh /// DHCPv6 Protocol instance is collecting Advertise packets. 37*f439973dSWarner Losh /// 38*f439973dSWarner Losh Dhcp6Selecting = 0x1, 39*f439973dSWarner Losh /// 40*f439973dSWarner Losh /// A Request is sent out to the DHCPv6 server, and the EFI DHCPv6 41*f439973dSWarner Losh /// Protocol instance is waiting for Reply packet. 42*f439973dSWarner Losh /// 43*f439973dSWarner Losh Dhcp6Requesting = 0x2, 44*f439973dSWarner Losh /// 45*f439973dSWarner Losh /// A Decline packet is sent out to indicate one or more addresses of the 46*f439973dSWarner Losh /// configured IA are in use by another node, and the EFI DHCPv6. 47*f439973dSWarner Losh /// Protocol instance is waiting for Reply packet. 48*f439973dSWarner Losh /// 49*f439973dSWarner Losh Dhcp6Declining = 0x3, 50*f439973dSWarner Losh /// 51*f439973dSWarner Losh /// A Confirm packet is sent out to confirm the IPv6 addresses of the 52*f439973dSWarner Losh /// configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet. 53*f439973dSWarner Losh /// 54*f439973dSWarner Losh Dhcp6Confirming = 0x4, 55*f439973dSWarner Losh /// 56*f439973dSWarner Losh /// A Release packet is sent out to release one or more IPv6 addresses of 57*f439973dSWarner Losh /// the configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet. 58*f439973dSWarner Losh /// 59*f439973dSWarner Losh Dhcp6Releasing = 0x5, 60*f439973dSWarner Losh /// 61*f439973dSWarner Losh /// The DHCPv6 S.A.R.R process is completed for the configured IA. 62*f439973dSWarner Losh /// 63*f439973dSWarner Losh Dhcp6Bound = 0x6, 64*f439973dSWarner Losh /// 65*f439973dSWarner Losh /// A Renew packet is sent out to extend lifetime for the IPv6 addresses of 66*f439973dSWarner Losh /// the configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet. 67*f439973dSWarner Losh /// 68*f439973dSWarner Losh Dhcp6Renewing = 0x7, 69*f439973dSWarner Losh /// 70*f439973dSWarner Losh /// A Rebind packet is sent out to extend lifetime for the IPv6 addresses of 71*f439973dSWarner Losh /// the configured IA, and the EFI DHCPv6 Protocol instance is waiting for Reply packet. 72*f439973dSWarner Losh /// 73*f439973dSWarner Losh Dhcp6Rebinding = 0x8 74*f439973dSWarner Losh } EFI_DHCP6_STATE; 75*f439973dSWarner Losh 76*f439973dSWarner Losh typedef enum { 77*f439973dSWarner Losh /// 78*f439973dSWarner Losh /// A Solicit packet is about to be sent. The packet is passed to Dhcp6Callback and 79*f439973dSWarner Losh /// can be modified or replaced in Dhcp6Callback. 80*f439973dSWarner Losh /// 81*f439973dSWarner Losh Dhcp6SendSolicit = 0x0, 82*f439973dSWarner Losh /// 83*f439973dSWarner Losh /// An Advertise packet is received and will be passed to Dhcp6Callback. 84*f439973dSWarner Losh /// 85*f439973dSWarner Losh Dhcp6RcvdAdvertise = 0x1, 86*f439973dSWarner Losh /// 87*f439973dSWarner Losh /// It is time for Dhcp6Callback to determine whether select the default Advertise 88*f439973dSWarner Losh /// packet by RFC 3315 policy, or overwrite it by specific user policy. 89*f439973dSWarner Losh /// 90*f439973dSWarner Losh Dhcp6SelectAdvertise = 0x2, 91*f439973dSWarner Losh /// 92*f439973dSWarner Losh /// A Request packet is about to be sent. The packet is passed to Dhcp6Callback and 93*f439973dSWarner Losh /// can be modified or replaced in Dhcp6Callback. 94*f439973dSWarner Losh /// 95*f439973dSWarner Losh Dhcp6SendRequest = 0x3, 96*f439973dSWarner Losh /// 97*f439973dSWarner Losh /// A Reply packet is received and will be passed to Dhcp6Callback. 98*f439973dSWarner Losh /// 99*f439973dSWarner Losh Dhcp6RcvdReply = 0x4, 100*f439973dSWarner Losh /// 101*f439973dSWarner Losh /// A Reconfigure packet is received and will be passed to Dhcp6Callback. 102*f439973dSWarner Losh /// 103*f439973dSWarner Losh Dhcp6RcvdReconfigure = 0x5, 104*f439973dSWarner Losh /// 105*f439973dSWarner Losh /// A Decline packet is about to be sent. The packet is passed to Dhcp6Callback and 106*f439973dSWarner Losh /// can be modified or replaced in Dhcp6Callback. 107*f439973dSWarner Losh /// 108*f439973dSWarner Losh Dhcp6SendDecline = 0x6, 109*f439973dSWarner Losh /// 110*f439973dSWarner Losh /// A Confirm packet is about to be sent. The packet is passed to Dhcp6Callback and 111*f439973dSWarner Losh /// can be modified or replaced in Dhcp6Callback. 112*f439973dSWarner Losh /// 113*f439973dSWarner Losh Dhcp6SendConfirm = 0x7, 114*f439973dSWarner Losh /// 115*f439973dSWarner Losh /// A Release packet is about to be sent. The packet is passed to Dhcp6Callback and 116*f439973dSWarner Losh /// can be modified or replaced in Dhcp6Callback. 117*f439973dSWarner Losh /// 118*f439973dSWarner Losh Dhcp6SendRelease = 0x8, 119*f439973dSWarner Losh /// 120*f439973dSWarner Losh /// A Renew packet is about to be sent. The packet is passed to Dhcp6Callback and 121*f439973dSWarner Losh /// can be modified or replaced in Dhcp6Callback. 122*f439973dSWarner Losh /// 123*f439973dSWarner Losh Dhcp6EnterRenewing = 0x9, 124*f439973dSWarner Losh /// 125*f439973dSWarner Losh /// A Rebind packet is about to be sent. The packet is passed to Dhcp6Callback and 126*f439973dSWarner Losh /// can be modified or replaced in Dhcp6Callback. 127*f439973dSWarner Losh /// 128*f439973dSWarner Losh Dhcp6EnterRebinding = 0xa 129*f439973dSWarner Losh } EFI_DHCP6_EVENT; 130*f439973dSWarner Losh 131*f439973dSWarner Losh /// 132*f439973dSWarner Losh /// An IA which carries assigned not temporary address. 133*f439973dSWarner Losh /// 134*f439973dSWarner Losh #define EFI_DHCP6_IA_TYPE_NA 3 135*f439973dSWarner Losh /// 136*f439973dSWarner Losh /// An IA which carries assigned temporary address. 137*f439973dSWarner Losh /// 138*f439973dSWarner Losh #define EFI_DHCP6_IA_TYPE_TA 4 139*f439973dSWarner Losh 140*f439973dSWarner Losh #pragma pack(1) 141*f439973dSWarner Losh /// 142*f439973dSWarner Losh /// EFI_DHCP6_PACKET_OPTION 143*f439973dSWarner Losh /// defines the format of the DHCPv6 option, See RFC 3315 for more information. 144*f439973dSWarner Losh /// This data structure is used to reference option data that is packed in the DHCPv6 packet. 145*f439973dSWarner Losh /// 146*f439973dSWarner Losh typedef struct { 147*f439973dSWarner Losh /// 148*f439973dSWarner Losh /// The DHCPv6 option code, stored in network order. 149*f439973dSWarner Losh /// 150*f439973dSWarner Losh UINT16 OpCode; 151*f439973dSWarner Losh /// 152*f439973dSWarner Losh /// Length of the DHCPv6 option data, stored in network order. 153*f439973dSWarner Losh /// From the first byte to the last byte of the Data field. 154*f439973dSWarner Losh /// 155*f439973dSWarner Losh UINT16 OpLen; 156*f439973dSWarner Losh /// 157*f439973dSWarner Losh /// The data for the DHCPv6 option, stored in network order. 158*f439973dSWarner Losh /// 159*f439973dSWarner Losh UINT8 Data[1]; 160*f439973dSWarner Losh } EFI_DHCP6_PACKET_OPTION; 161*f439973dSWarner Losh 162*f439973dSWarner Losh /// 163*f439973dSWarner Losh /// EFI_DHCP6_HEADER 164*f439973dSWarner Losh /// defines the format of the DHCPv6 header. See RFC 3315 for more information. 165*f439973dSWarner Losh /// 166*f439973dSWarner Losh typedef struct { 167*f439973dSWarner Losh /// 168*f439973dSWarner Losh /// The DHCPv6 transaction ID. 169*f439973dSWarner Losh /// 170*f439973dSWarner Losh UINT32 MessageType : 8; 171*f439973dSWarner Losh /// 172*f439973dSWarner Losh /// The DHCPv6 message type. 173*f439973dSWarner Losh /// 174*f439973dSWarner Losh UINT32 TransactionId : 24; 175*f439973dSWarner Losh } EFI_DHCP6_HEADER; 176*f439973dSWarner Losh 177*f439973dSWarner Losh /// 178*f439973dSWarner Losh /// EFI_DHCP6_PACKET 179*f439973dSWarner Losh /// defines the format of the DHCPv6 packet. See RFC 3315 for more information. 180*f439973dSWarner Losh /// 181*f439973dSWarner Losh typedef struct { 182*f439973dSWarner Losh /// 183*f439973dSWarner Losh /// Size of the EFI_DHCP6_PACKET buffer. 184*f439973dSWarner Losh /// 185*f439973dSWarner Losh UINT32 Size; 186*f439973dSWarner Losh /// 187*f439973dSWarner Losh /// Length of the EFI_DHCP6_PACKET from the first byte of the Header field to the last 188*f439973dSWarner Losh /// byte of the Option[] field. 189*f439973dSWarner Losh /// 190*f439973dSWarner Losh UINT32 Length; 191*f439973dSWarner Losh struct { 192*f439973dSWarner Losh /// 193*f439973dSWarner Losh /// The DHCPv6 packet header. 194*f439973dSWarner Losh /// 195*f439973dSWarner Losh EFI_DHCP6_HEADER Header; 196*f439973dSWarner Losh /// 197*f439973dSWarner Losh /// Start of the DHCPv6 packed option data. 198*f439973dSWarner Losh /// 199*f439973dSWarner Losh UINT8 Option[1]; 200*f439973dSWarner Losh } Dhcp6; 201*f439973dSWarner Losh } EFI_DHCP6_PACKET; 202*f439973dSWarner Losh 203*f439973dSWarner Losh #pragma pack() 204*f439973dSWarner Losh 205*f439973dSWarner Losh typedef struct { 206*f439973dSWarner Losh /// 207*f439973dSWarner Losh /// Length of DUID in octects. 208*f439973dSWarner Losh /// 209*f439973dSWarner Losh UINT16 Length; 210*f439973dSWarner Losh /// 211*f439973dSWarner Losh /// Array of DUID octects. 212*f439973dSWarner Losh /// 213*f439973dSWarner Losh UINT8 Duid[1]; 214*f439973dSWarner Losh } EFI_DHCP6_DUID; 215*f439973dSWarner Losh 216*f439973dSWarner Losh typedef struct { 217*f439973dSWarner Losh /// 218*f439973dSWarner Losh /// Initial retransmission timeout. 219*f439973dSWarner Losh /// 220*f439973dSWarner Losh UINT32 Irt; 221*f439973dSWarner Losh /// 222*f439973dSWarner Losh /// Maximum retransmission count for one packet. If Mrc is zero, there's no upper limit 223*f439973dSWarner Losh /// for retransmission count. 224*f439973dSWarner Losh /// 225*f439973dSWarner Losh UINT32 Mrc; 226*f439973dSWarner Losh /// 227*f439973dSWarner Losh /// Maximum retransmission timeout for each retry. It's the upper bound of the number of 228*f439973dSWarner Losh /// retransmission timeout. If Mrt is zero, there is no upper limit for retransmission 229*f439973dSWarner Losh /// timeout. 230*f439973dSWarner Losh /// 231*f439973dSWarner Losh UINT32 Mrt; 232*f439973dSWarner Losh /// 233*f439973dSWarner Losh /// Maximum retransmission duration for one packet. It's the upper bound of the numbers 234*f439973dSWarner Losh /// the client may retransmit a message. If Mrd is zero, there's no upper limit for 235*f439973dSWarner Losh /// retransmission duration. 236*f439973dSWarner Losh /// 237*f439973dSWarner Losh UINT32 Mrd; 238*f439973dSWarner Losh } EFI_DHCP6_RETRANSMISSION; 239*f439973dSWarner Losh 240*f439973dSWarner Losh typedef struct { 241*f439973dSWarner Losh /// 242*f439973dSWarner Losh /// The IPv6 address. 243*f439973dSWarner Losh /// 244*f439973dSWarner Losh EFI_IPv6_ADDRESS IpAddress; 245*f439973dSWarner Losh /// 246*f439973dSWarner Losh /// The preferred lifetime in unit of seconds for the IPv6 address. 247*f439973dSWarner Losh /// 248*f439973dSWarner Losh UINT32 PreferredLifetime; 249*f439973dSWarner Losh /// 250*f439973dSWarner Losh /// The valid lifetime in unit of seconds for the IPv6 address. 251*f439973dSWarner Losh /// 252*f439973dSWarner Losh UINT32 ValidLifetime; 253*f439973dSWarner Losh } EFI_DHCP6_IA_ADDRESS; 254*f439973dSWarner Losh 255*f439973dSWarner Losh typedef struct { 256*f439973dSWarner Losh UINT16 Type; ///< Type for an IA. 257*f439973dSWarner Losh UINT32 IaId; ///< The identifier for an IA. 258*f439973dSWarner Losh } EFI_DHCP6_IA_DESCRIPTOR; 259*f439973dSWarner Losh 260*f439973dSWarner Losh typedef struct { 261*f439973dSWarner Losh /// 262*f439973dSWarner Losh /// The descriptor for IA. 263*f439973dSWarner Losh /// 264*f439973dSWarner Losh EFI_DHCP6_IA_DESCRIPTOR Descriptor; 265*f439973dSWarner Losh /// 266*f439973dSWarner Losh /// The state of the configured IA. 267*f439973dSWarner Losh /// 268*f439973dSWarner Losh EFI_DHCP6_STATE State; 269*f439973dSWarner Losh /// 270*f439973dSWarner Losh /// Pointer to the cached latest Reply packet. May be NULL if no packet is cached. 271*f439973dSWarner Losh /// 272*f439973dSWarner Losh EFI_DHCP6_PACKET *ReplyPacket; 273*f439973dSWarner Losh /// 274*f439973dSWarner Losh /// Number of IPv6 addresses of the configured IA. 275*f439973dSWarner Losh /// 276*f439973dSWarner Losh UINT32 IaAddressCount; 277*f439973dSWarner Losh /// 278*f439973dSWarner Losh /// List of the IPv6 addresses of the configured IA. When the state of the configured IA is 279*f439973dSWarner Losh /// in Dhcp6Bound, Dhcp6Renewing and Dhcp6Rebinding, the IPv6 addresses are usable. 280*f439973dSWarner Losh /// 281*f439973dSWarner Losh EFI_DHCP6_IA_ADDRESS IaAddress[1]; 282*f439973dSWarner Losh } EFI_DHCP6_IA; 283*f439973dSWarner Losh 284*f439973dSWarner Losh typedef struct { 285*f439973dSWarner Losh /// 286*f439973dSWarner Losh /// Pointer to the DHCPv6 unique identifier. The caller is responsible for freeing this buffer. 287*f439973dSWarner Losh /// 288*f439973dSWarner Losh EFI_DHCP6_DUID *ClientId; 289*f439973dSWarner Losh /// 290*f439973dSWarner Losh /// Pointer to the configured IA of current instance. The caller can free this buffer after 291*f439973dSWarner Losh /// using it. 292*f439973dSWarner Losh /// 293*f439973dSWarner Losh EFI_DHCP6_IA *Ia; 294*f439973dSWarner Losh } EFI_DHCP6_MODE_DATA; 295*f439973dSWarner Losh 296*f439973dSWarner Losh /** 297*f439973dSWarner Losh EFI_DHCP6_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol instance to 298*f439973dSWarner Losh intercept events that occurs in the DHCPv6 S.A.R.R process. 299*f439973dSWarner Losh 300*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance that is used to configure this 301*f439973dSWarner Losh callback function. 302*f439973dSWarner Losh @param[in] Context Pointer to the context that is initialized by EFI_DHCP6_PROTOCOL.Configure(). 303*f439973dSWarner Losh @param[in] CurrentState The current state of the configured IA. 304*f439973dSWarner Losh @param[in] Dhcp6Event The event that occurs in the current state, which usually means a state transition. 305*f439973dSWarner Losh @param[in] Packet Pointer to the DHCPv6 packet that is about to be sent or has been received. 306*f439973dSWarner Losh The EFI DHCPv6 Protocol instance is responsible for freeing the buffer. 307*f439973dSWarner Losh @param[out] NewPacket Pointer to the new DHCPv6 packet to overwrite the Packet. NewPacket can not 308*f439973dSWarner Losh share the buffer with Packet. If *NewPacket is not NULL, the EFI DHCPv6 309*f439973dSWarner Losh Protocol instance is responsible for freeing the buffer. 310*f439973dSWarner Losh 311*f439973dSWarner Losh @retval EFI_SUCCESS Tell the EFI DHCPv6 Protocol instance to continue the DHCPv6 S.A.R.R process. 312*f439973dSWarner Losh @retval EFI_ABORTED Tell the EFI DHCPv6 Protocol instance to abort the DHCPv6 S.A.R.R process, 313*f439973dSWarner Losh and the state of the configured IA will be transferred to Dhcp6Init. 314*f439973dSWarner Losh 315*f439973dSWarner Losh **/ 316*f439973dSWarner Losh typedef 317*f439973dSWarner Losh EFI_STATUS 318*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_CALLBACK)( 319*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This, 320*f439973dSWarner Losh IN VOID *Context, 321*f439973dSWarner Losh IN EFI_DHCP6_STATE CurrentState, 322*f439973dSWarner Losh IN EFI_DHCP6_EVENT Dhcp6Event, 323*f439973dSWarner Losh IN EFI_DHCP6_PACKET *Packet, 324*f439973dSWarner Losh OUT EFI_DHCP6_PACKET **NewPacket OPTIONAL 325*f439973dSWarner Losh ); 326*f439973dSWarner Losh 327*f439973dSWarner Losh typedef struct { 328*f439973dSWarner Losh /// 329*f439973dSWarner Losh /// The callback function is to intercept various events that occur in the DHCPv6 S.A.R.R 330*f439973dSWarner Losh /// process. Set to NULL to ignore all those events. 331*f439973dSWarner Losh /// 332*f439973dSWarner Losh EFI_DHCP6_CALLBACK Dhcp6Callback; 333*f439973dSWarner Losh /// 334*f439973dSWarner Losh /// Pointer to the context that will be passed to Dhcp6Callback. 335*f439973dSWarner Losh /// 336*f439973dSWarner Losh VOID *CallbackContext; 337*f439973dSWarner Losh /// 338*f439973dSWarner Losh /// Number of the DHCPv6 options in the OptionList. 339*f439973dSWarner Losh /// 340*f439973dSWarner Losh UINT32 OptionCount; 341*f439973dSWarner Losh /// 342*f439973dSWarner Losh /// List of the DHCPv6 options to be included in Solicit and Request packet. The buffer 343*f439973dSWarner Losh /// can be freed after EFI_DHCP6_PROTOCOL.Configure() returns. Ignored if 344*f439973dSWarner Losh /// OptionCount is zero. OptionList should not contain Client Identifier option 345*f439973dSWarner Losh /// and any IA option, which will be appended by EFI DHCPv6 Protocol instance 346*f439973dSWarner Losh /// automatically. 347*f439973dSWarner Losh /// 348*f439973dSWarner Losh EFI_DHCP6_PACKET_OPTION **OptionList; 349*f439973dSWarner Losh /// 350*f439973dSWarner Losh /// The descriptor for the IA of the EFI DHCPv6 Protocol instance. 351*f439973dSWarner Losh /// 352*f439973dSWarner Losh EFI_DHCP6_IA_DESCRIPTOR IaDescriptor; 353*f439973dSWarner Losh /// 354*f439973dSWarner Losh /// If not NULL, the event will be signaled when any IPv6 address information of the 355*f439973dSWarner Losh /// configured IA is updated, including IPv6 address, preferred lifetime and valid 356*f439973dSWarner Losh /// lifetime, or the DHCPv6 S.A.R.R process fails. Otherwise, Start(), 357*f439973dSWarner Losh /// renewrebind(), decline(), release() and stop() will be blocking 358*f439973dSWarner Losh /// operations, and they will wait for the exchange process completion or failure. 359*f439973dSWarner Losh /// 360*f439973dSWarner Losh EFI_EVENT IaInfoEvent; 361*f439973dSWarner Losh /// 362*f439973dSWarner Losh /// If TRUE, the EFI DHCPv6 Protocol instance is willing to accept Reconfigure packet. 363*f439973dSWarner Losh /// Otherwise, it will ignore it. Reconfigure Accept option can not be specified through 364*f439973dSWarner Losh /// OptionList parameter. 365*f439973dSWarner Losh /// 366*f439973dSWarner Losh BOOLEAN ReconfigureAccept; 367*f439973dSWarner Losh /// 368*f439973dSWarner Losh /// If TRUE, the EFI DHCPv6 Protocol instance will send Solicit packet with Rapid 369*f439973dSWarner Losh /// Commit option. Otherwise, Rapid Commit option will not be included in Solicit 370*f439973dSWarner Losh /// packet. Rapid Commit option can not be specified through OptionList parameter. 371*f439973dSWarner Losh /// 372*f439973dSWarner Losh BOOLEAN RapidCommit; 373*f439973dSWarner Losh /// 374*f439973dSWarner Losh /// Parameter to control Solicit packet retransmission behavior. The 375*f439973dSWarner Losh /// buffer can be freed after EFI_DHCP6_PROTOCOL.Configure() returns. 376*f439973dSWarner Losh /// 377*f439973dSWarner Losh EFI_DHCP6_RETRANSMISSION *SolicitRetransmission; 378*f439973dSWarner Losh } EFI_DHCP6_CONFIG_DATA; 379*f439973dSWarner Losh 380*f439973dSWarner Losh /** 381*f439973dSWarner Losh EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol 382*f439973dSWarner Losh instance to intercept events that occurs in the DHCPv6 Information Request exchange process. 383*f439973dSWarner Losh 384*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance that is used to configure this 385*f439973dSWarner Losh callback function. 386*f439973dSWarner Losh @param[in] Context Pointer to the context that is initialized in the EFI_DHCP6_PROTOCOL.InfoRequest(). 387*f439973dSWarner Losh @param[in] Packet Pointer to Reply packet that has been received. The EFI DHCPv6 Protocol instance is 388*f439973dSWarner Losh responsible for freeing the buffer. 389*f439973dSWarner Losh 390*f439973dSWarner Losh @retval EFI_SUCCESS Tell the EFI DHCPv6 Protocol instance to finish Information Request exchange process. 391*f439973dSWarner Losh @retval EFI_NOT_READY Tell the EFI DHCPv6 Protocol instance to continue Information Request exchange process. 392*f439973dSWarner Losh @retval EFI_ABORTED Tell the EFI DHCPv6 Protocol instance to abort the Information Request exchange process. 393*f439973dSWarner Losh 394*f439973dSWarner Losh **/ 395*f439973dSWarner Losh typedef 396*f439973dSWarner Losh EFI_STATUS 397*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_INFO_CALLBACK)( 398*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This, 399*f439973dSWarner Losh IN VOID *Context, 400*f439973dSWarner Losh IN EFI_DHCP6_PACKET *Packet 401*f439973dSWarner Losh ); 402*f439973dSWarner Losh 403*f439973dSWarner Losh /** 404*f439973dSWarner Losh Retrieve the current operating mode data and configuration data for the EFI DHCPv6 Protocol instance. 405*f439973dSWarner Losh 406*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance. 407*f439973dSWarner Losh @param[out] Dhcp6ModeData Pointer to the DHCPv6 mode data structure. The caller is responsible for freeing this 408*f439973dSWarner Losh structure and each reference buffer. 409*f439973dSWarner Losh @param[out] Dhcp6ConfigData Pointer to the DHCPv6 configuration data structure. The caller is responsible for 410*f439973dSWarner Losh freeing this structure and each reference buffer. 411*f439973dSWarner Losh 412*f439973dSWarner Losh @retval EFI_SUCCESS The mode data was returned. 413*f439973dSWarner Losh @retval EFI_ACCESS_DENIED The EFI DHCPv6 Protocol instance has not been configured when Dhcp6ConfigData is not NULL. 414*f439973dSWarner Losh @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE: 415*f439973dSWarner Losh - This is NULL. 416*f439973dSWarner Losh - Both Dhcp6ConfigData and Dhcp6ModeData are NULL. 417*f439973dSWarner Losh 418*f439973dSWarner Losh **/ 419*f439973dSWarner Losh typedef 420*f439973dSWarner Losh EFI_STATUS 421*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_GET_MODE_DATA)( 422*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This, 423*f439973dSWarner Losh OUT EFI_DHCP6_MODE_DATA *Dhcp6ModeData OPTIONAL, 424*f439973dSWarner Losh OUT EFI_DHCP6_CONFIG_DATA *Dhcp6ConfigData OPTIONAL 425*f439973dSWarner Losh ); 426*f439973dSWarner Losh 427*f439973dSWarner Losh /** 428*f439973dSWarner Losh Initialize or clean up the configuration data for the EFI DHCPv6 Protocol instance. 429*f439973dSWarner Losh 430*f439973dSWarner Losh The Configure() function is used to initialize or clean up the configuration data of the EFI 431*f439973dSWarner Losh DHCPv6 Protocol instance. 432*f439973dSWarner Losh - When Dhcp6CfgData is not NULL and Configure() is called successfully, the 433*f439973dSWarner Losh configuration data will be initialized in the EFI DHCPv6 Protocol instance and the state of the 434*f439973dSWarner Losh configured IA will be transferred into Dhcp6Init. 435*f439973dSWarner Losh - When Dhcp6CfgData is NULL and Configure() is called successfully, the configuration 436*f439973dSWarner Losh data will be cleaned up and no IA will be associated with the EFI DHCPv6 Protocol instance. 437*f439973dSWarner Losh 438*f439973dSWarner Losh To update the configuration data for an EFI DCHPv6 Protocol instance, the original data must be 439*f439973dSWarner Losh cleaned up before setting the new configuration data. 440*f439973dSWarner Losh 441*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance. 442*f439973dSWarner Losh @param[in] Dhcp6CfgData Pointer to the DHCPv6 configuration data structure. 443*f439973dSWarner Losh 444*f439973dSWarner Losh @retval EFI_SUCCESS The mode data was returned. 445*f439973dSWarner Losh @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE 446*f439973dSWarner Losh - This is NULL. 447*f439973dSWarner Losh - OptionCount > 0 and OptionList is NULL. 448*f439973dSWarner Losh - OptionList is not NULL, and Client Id option, Reconfigure Accept option, 449*f439973dSWarner Losh Rapid Commit option or any IA option is specified in the OptionList. 450*f439973dSWarner Losh - IaDescriptor.Type is neither EFI_DHCP6_IA_TYPE_NA nor EFI_DHCP6_IA_TYPE_NA. 451*f439973dSWarner Losh - IaDescriptor is not unique. 452*f439973dSWarner Losh - Both IaInfoEvent and SolicitRetransimssion are NULL. 453*f439973dSWarner Losh - SolicitRetransmission is not NULL, and both SolicitRetransimssion->Mrc and 454*f439973dSWarner Losh SolicitRetransmission->Mrd are zero. 455*f439973dSWarner Losh @retval EFI_ACCESS_DENIED The EFI DHCPv6 Protocol instance has been already configured 456*f439973dSWarner Losh when Dhcp6CfgData is not NULL. 457*f439973dSWarner Losh The EFI DHCPv6 Protocol instance has already started the 458*f439973dSWarner Losh DHCPv6 S.A.R.R when Dhcp6CfgData is NULL. 459*f439973dSWarner Losh @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. 460*f439973dSWarner Losh @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. 461*f439973dSWarner Losh 462*f439973dSWarner Losh **/ 463*f439973dSWarner Losh typedef 464*f439973dSWarner Losh EFI_STATUS 465*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_CONFIGURE)( 466*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This, 467*f439973dSWarner Losh IN EFI_DHCP6_CONFIG_DATA *Dhcp6CfgData OPTIONAL 468*f439973dSWarner Losh ); 469*f439973dSWarner Losh 470*f439973dSWarner Losh /** 471*f439973dSWarner Losh Start the DHCPv6 S.A.R.R process. 472*f439973dSWarner Losh 473*f439973dSWarner Losh The Start() function starts the DHCPv6 S.A.R.R process. This function can be called only when 474*f439973dSWarner Losh the state of the configured IA is in the Dhcp6Init state. If the DHCPv6 S.A.R.R process completes 475*f439973dSWarner Losh successfully, the state of the configured IA will be transferred through Dhcp6Selecting and 476*f439973dSWarner Losh Dhcp6Requesting to Dhcp6Bound state. The update of the IPv6 addresses will be notified through 477*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent. At the time when each event occurs in this process, the 478*f439973dSWarner Losh callback function set by EFI_DHCP6_PROTOCOL.Configure() will be called and the user can take 479*f439973dSWarner Losh this opportunity to control the process. If EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, the 480*f439973dSWarner Losh Start() function call is a blocking operation. It will return after the DHCPv6 S.A.R.R process 481*f439973dSWarner Losh completes or aborted by users. If the process is aborted by system or network error, the state of 482*f439973dSWarner Losh the configured IA will be transferred to Dhcp6Init. The Start() function can be called again to 483*f439973dSWarner Losh restart the process. 484*f439973dSWarner Losh 485*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance. 486*f439973dSWarner Losh 487*f439973dSWarner Losh @retval EFI_SUCCESS The DHCPv6 S.A.R.R process is completed and at least one IPv6 488*f439973dSWarner Losh address has been bound to the configured IA when 489*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL. 490*f439973dSWarner Losh The DHCPv6 S.A.R.R process is started when 491*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL. 492*f439973dSWarner Losh @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured. 493*f439973dSWarner Losh @retval EFI_INVALID_PARAMETER This is NULL. 494*f439973dSWarner Losh @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. 495*f439973dSWarner Losh @retval EFI_ALREADY_STARTED The DHCPv6 S.A.R.R process has already started. 496*f439973dSWarner Losh @retval EFI_DEVICE_ERROR An unexpected network or system error occurred. 497*f439973dSWarner Losh @retval EFI_NO_RESPONSE The DHCPv6 S.A.R.R process failed because of no response. 498*f439973dSWarner Losh @retval EFI_NO_MAPPING No IPv6 address has been bound to the configured IA after the 499*f439973dSWarner Losh DHCPv6 S.A.R.R process. 500*f439973dSWarner Losh @retval EFI_ABORTED The DHCPv6 S.A.R.R process aborted by user. 501*f439973dSWarner Losh @retval EFI_NO_MEDIA There was a media error. 502*f439973dSWarner Losh 503*f439973dSWarner Losh **/ 504*f439973dSWarner Losh typedef 505*f439973dSWarner Losh EFI_STATUS 506*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_START)( 507*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This 508*f439973dSWarner Losh ); 509*f439973dSWarner Losh 510*f439973dSWarner Losh /** 511*f439973dSWarner Losh Request configuration information without the assignment of any IA addresses of the client. 512*f439973dSWarner Losh 513*f439973dSWarner Losh The InfoRequest() function is used to request configuration information without the assignment 514*f439973dSWarner Losh of any IPv6 address of the client. Client sends out Information Request packet to obtain 515*f439973dSWarner Losh the required configuration information, and DHCPv6 server responds with Reply packet containing 516*f439973dSWarner Losh the information for the client. The received Reply packet will be passed to the user by 517*f439973dSWarner Losh ReplyCallback function. If user returns EFI_NOT_READY from ReplyCallback, the EFI DHCPv6 518*f439973dSWarner Losh Protocol instance will continue to receive other Reply packets unless timeout according to 519*f439973dSWarner Losh the Retransmission parameter. Otherwise, the Information Request exchange process will be 520*f439973dSWarner Losh finished successfully if user returns EFI_SUCCESS from ReplyCallback. 521*f439973dSWarner Losh 522*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance. 523*f439973dSWarner Losh @param[in] SendClientId If TRUE, the EFI DHCPv6 Protocol instance will build Client 524*f439973dSWarner Losh Identifier option and include it into Information Request 525*f439973dSWarner Losh packet. If FALSE, Client Identifier option will not be included. 526*f439973dSWarner Losh Client Identifier option can not be specified through OptionList 527*f439973dSWarner Losh parameter. 528*f439973dSWarner Losh @param[in] OptionRequest Pointer to the Option Request option in the Information Request 529*f439973dSWarner Losh packet. Option Request option can not be specified through 530*f439973dSWarner Losh OptionList parameter. 531*f439973dSWarner Losh @param[in] OptionCount Number of options in OptionList. 532*f439973dSWarner Losh @param[in] OptionList List of other DHCPv6 options. These options will be appended 533*f439973dSWarner Losh to the Option Request option. The caller is responsible for 534*f439973dSWarner Losh freeing this buffer. Type is defined in EFI_DHCP6_PROTOCOL.GetModeData(). 535*f439973dSWarner Losh @param[in] Retransmission Parameter to control Information Request packet retransmission 536*f439973dSWarner Losh behavior. The buffer can be freed after EFI_DHCP6_PROTOCOL.InfoRequest() 537*f439973dSWarner Losh returns. 538*f439973dSWarner Losh @param[in] TimeoutEvent If not NULL, this event is signaled when the information request 539*f439973dSWarner Losh exchange aborted because of no response. If NULL, the function 540*f439973dSWarner Losh call is a blocking operation; and it will return after the 541*f439973dSWarner Losh information-request exchange process finish or aborted by users. 542*f439973dSWarner Losh @param[in] ReplyCallback The callback function is to intercept various events that occur 543*f439973dSWarner Losh in the Information Request exchange process. It should not be 544*f439973dSWarner Losh set to NULL. 545*f439973dSWarner Losh @param[in] CallbackContext Pointer to the context that will be passed to ReplyCallback. 546*f439973dSWarner Losh 547*f439973dSWarner Losh @retval EFI_SUCCESS The DHCPv6 S.A.R.R process is completed and at least one IPv6 548*f439973dSWarner Losh @retval EFI_SUCCESS The DHCPv6 information request exchange process completed 549*f439973dSWarner Losh when TimeoutEvent is NULL. Information Request packet has been 550*f439973dSWarner Losh sent to DHCPv6 server when TimeoutEvent is not NULL. 551*f439973dSWarner Losh @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE: 552*f439973dSWarner Losh - This is NULL. 553*f439973dSWarner Losh - OptionRequest is NULL or OptionRequest->OpCode is invalid. 554*f439973dSWarner Losh - OptionCount > 0 and OptionList is NULL. 555*f439973dSWarner Losh - OptionList is not NULL, and Client Identify option or 556*f439973dSWarner Losh Option Request option is specified in the OptionList. 557*f439973dSWarner Losh - Retransimssion is NULL. 558*f439973dSWarner Losh - Both Retransimssion->Mrc and Retransmission->Mrd are zero. 559*f439973dSWarner Losh - ReplyCallback is NULL. 560*f439973dSWarner Losh @retval EFI_DEVICE_ERROR An unexpected network or system error occurred. 561*f439973dSWarner Losh @retval EFI_NO_RESPONSE The DHCPv6 information request exchange process failed 562*f439973dSWarner Losh because of no response, or not all requested-options are 563*f439973dSWarner Losh responded by DHCPv6 servers when Timeout happened. 564*f439973dSWarner Losh @retval EFI_ABORTED The DHCPv6 information request exchange process aborted by user. 565*f439973dSWarner Losh 566*f439973dSWarner Losh **/ 567*f439973dSWarner Losh typedef 568*f439973dSWarner Losh EFI_STATUS 569*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_INFO_REQUEST)( 570*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This, 571*f439973dSWarner Losh IN BOOLEAN SendClientId, 572*f439973dSWarner Losh IN EFI_DHCP6_PACKET_OPTION *OptionRequest, 573*f439973dSWarner Losh IN UINT32 OptionCount, 574*f439973dSWarner Losh IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL, 575*f439973dSWarner Losh IN EFI_DHCP6_RETRANSMISSION *Retransmission, 576*f439973dSWarner Losh IN EFI_EVENT TimeoutEvent OPTIONAL, 577*f439973dSWarner Losh IN EFI_DHCP6_INFO_CALLBACK ReplyCallback, 578*f439973dSWarner Losh IN VOID *CallbackContext OPTIONAL 579*f439973dSWarner Losh ); 580*f439973dSWarner Losh 581*f439973dSWarner Losh /** 582*f439973dSWarner Losh Manually extend the valid and preferred lifetimes for the IPv6 addresses of the configured 583*f439973dSWarner Losh IA and update other configuration parameters by sending Renew or Rebind packet. 584*f439973dSWarner Losh 585*f439973dSWarner Losh The RenewRebind() function is used to manually extend the valid and preferred lifetimes for the 586*f439973dSWarner Losh IPv6 addresses of the configured IA and update other configuration parameters by sending Renew or 587*f439973dSWarner Losh Rebind packet. 588*f439973dSWarner Losh - When RebindRequest is FALSE and the state of the configured IA is Dhcp6Bound, it 589*f439973dSWarner Losh will send Renew packet to the previously DHCPv6 server and transfer the state of the configured 590*f439973dSWarner Losh IA to Dhcp6Renewing. If valid Reply packet received, the state transfers to Dhcp6Bound 591*f439973dSWarner Losh and the valid and preferred timer restarts. If fails, the state transfers to Dhcp6Bound but the 592*f439973dSWarner Losh timer continues. 593*f439973dSWarner Losh - When RebindRequest is TRUE and the state of the configured IA is Dhcp6Bound, it will 594*f439973dSWarner Losh send Rebind packet. If valid Reply packet received, the state transfers to Dhcp6Bound and the 595*f439973dSWarner Losh valid and preferred timer restarts. If fails, the state transfers to Dhcp6Init and the IA can't 596*f439973dSWarner Losh be used. 597*f439973dSWarner Losh 598*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP4_PROTOCOL instance. 599*f439973dSWarner Losh @param[in] RebindRequest If TRUE, it will send Rebind packet and enter the Dhcp6Rebinding state. 600*f439973dSWarner Losh Otherwise, it will send Renew packet and enter the Dhcp6Renewing state. 601*f439973dSWarner Losh 602*f439973dSWarner Losh @retval EFI_SUCCESS The DHCPv6 renew/rebind exchange process has completed and at 603*f439973dSWarner Losh least one IPv6 address of the configured IA has been bound again 604*f439973dSWarner Losh when EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL. 605*f439973dSWarner Losh The EFI DHCPv6 Protocol instance has sent Renew or Rebind packet 606*f439973dSWarner Losh when EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL. 607*f439973dSWarner Losh @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured, or the state 608*f439973dSWarner Losh of the configured IA is not in Dhcp6Bound. 609*f439973dSWarner Losh @retval EFI_ALREADY_STARTED The state of the configured IA has already entered Dhcp6Renewing 610*f439973dSWarner Losh when RebindRequest is FALSE. 611*f439973dSWarner Losh The state of the configured IA has already entered Dhcp6Rebinding 612*f439973dSWarner Losh when RebindRequest is TRUE. 613*f439973dSWarner Losh @retval EFI_INVALID_PARAMETER This is NULL. 614*f439973dSWarner Losh @retval EFI_DEVICE_ERROR An unexpected system or system error occurred. 615*f439973dSWarner Losh @retval EFI_NO_RESPONSE The DHCPv6 renew/rebind exchange process failed because of no response. 616*f439973dSWarner Losh @retval EFI_NO_MAPPING No IPv6 address has been bound to the configured IA after the DHCPv6 617*f439973dSWarner Losh renew/rebind exchange process. 618*f439973dSWarner Losh @retval EFI_ABORTED The DHCPv6 renew/rebind exchange process aborted by user. 619*f439973dSWarner Losh 620*f439973dSWarner Losh **/ 621*f439973dSWarner Losh typedef 622*f439973dSWarner Losh EFI_STATUS 623*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_RENEW_REBIND)( 624*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This, 625*f439973dSWarner Losh IN BOOLEAN RebindRequest 626*f439973dSWarner Losh ); 627*f439973dSWarner Losh 628*f439973dSWarner Losh /** 629*f439973dSWarner Losh Inform that one or more IPv6 addresses assigned by a server are already in use by 630*f439973dSWarner Losh another node. 631*f439973dSWarner Losh 632*f439973dSWarner Losh The Decline() function is used to manually decline the assignment of IPv6 addresses, which 633*f439973dSWarner Losh have been already used by another node. If all IPv6 addresses of the configured IA are declined 634*f439973dSWarner Losh through this function, the state of the IA will switch through Dhcp6Declining to Dhcp6Init, 635*f439973dSWarner Losh otherwise, the state of the IA will restore to Dhcp6Bound after the declining process. The 636*f439973dSWarner Losh Decline() can only be called when the IA is in Dhcp6Bound state. If the 637*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, this function is a blocking operation. It 638*f439973dSWarner Losh will return after the declining process finishes, or aborted by user. 639*f439973dSWarner Losh 640*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP4_PROTOCOL instance. 641*f439973dSWarner Losh @param[in] AddressCount Number of declining IPv6 addresses. 642*f439973dSWarner Losh @param[in] Addresses Pointer to the buffer stored all the declining IPv6 addresses. 643*f439973dSWarner Losh 644*f439973dSWarner Losh @retval EFI_SUCCESS The DHCPv6 decline exchange process has completed when 645*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL. 646*f439973dSWarner Losh The EFI DHCPv6 Protocol instance has sent Decline packet when 647*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL. 648*f439973dSWarner Losh @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE 649*f439973dSWarner Losh - This is NULL. 650*f439973dSWarner Losh - AddressCount is zero or Addresses is NULL. 651*f439973dSWarner Losh @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with the configured IA 652*f439973dSWarner Losh for this instance. 653*f439973dSWarner Losh @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured, or the 654*f439973dSWarner Losh state of the configured IA is not in Dhcp6Bound. 655*f439973dSWarner Losh @retval EFI_DEVICE_ERROR An unexpected network or system error occurred. 656*f439973dSWarner Losh @retval EFI_ABORTED The DHCPv6 decline exchange process aborted by user. 657*f439973dSWarner Losh 658*f439973dSWarner Losh **/ 659*f439973dSWarner Losh typedef 660*f439973dSWarner Losh EFI_STATUS 661*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_DECLINE)( 662*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This, 663*f439973dSWarner Losh IN UINT32 AddressCount, 664*f439973dSWarner Losh IN EFI_IPv6_ADDRESS *Addresses 665*f439973dSWarner Losh ); 666*f439973dSWarner Losh 667*f439973dSWarner Losh /** 668*f439973dSWarner Losh Release one or more IPv6 addresses associated with the configured IA for current instance. 669*f439973dSWarner Losh 670*f439973dSWarner Losh The Release() function is used to manually release the one or more IPv6 address. If AddressCount 671*f439973dSWarner Losh is zero, it will release all IPv6 addresses of the configured IA. If all IPv6 addresses of the IA 672*f439973dSWarner Losh are released through this function, the state of the IA will switch through Dhcp6Releasing to 673*f439973dSWarner Losh Dhcp6Init, otherwise, the state of the IA will restore to Dhcp6Bound after the releasing process. 674*f439973dSWarner Losh The Release() can only be called when the IA is in Dhcp6Bound state. If the 675*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, the function is a blocking operation. It will return 676*f439973dSWarner Losh after the releasing process finishes, or aborted by user. 677*f439973dSWarner Losh 678*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance. 679*f439973dSWarner Losh @param[in] AddressCount Number of releasing IPv6 addresses. 680*f439973dSWarner Losh @param[in] Addresses Pointer to the buffer stored all the releasing IPv6 addresses. 681*f439973dSWarner Losh Ignored if AddressCount is zero. 682*f439973dSWarner Losh @retval EFI_SUCCESS The DHCPv6 release exchange process has completed when 683*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL. 684*f439973dSWarner Losh The EFI DHCPv6 Protocol instance has sent Release packet when 685*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL. 686*f439973dSWarner Losh @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE 687*f439973dSWarner Losh - This is NULL. 688*f439973dSWarner Losh - AddressCount is not zero or Addresses is NULL. 689*f439973dSWarner Losh @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with the configured 690*f439973dSWarner Losh IA for this instance. 691*f439973dSWarner Losh @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured, or the 692*f439973dSWarner Losh state of the configured IA is not in Dhcp6Bound. 693*f439973dSWarner Losh @retval EFI_DEVICE_ERROR An unexpected network or system error occurred. 694*f439973dSWarner Losh @retval EFI_ABORTED The DHCPv6 release exchange process aborted by user. 695*f439973dSWarner Losh 696*f439973dSWarner Losh **/ 697*f439973dSWarner Losh typedef 698*f439973dSWarner Losh EFI_STATUS 699*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_RELEASE)( 700*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This, 701*f439973dSWarner Losh IN UINT32 AddressCount, 702*f439973dSWarner Losh IN EFI_IPv6_ADDRESS *Addresses 703*f439973dSWarner Losh ); 704*f439973dSWarner Losh 705*f439973dSWarner Losh /** 706*f439973dSWarner Losh Stop the DHCPv6 S.A.R.R process. 707*f439973dSWarner Losh 708*f439973dSWarner Losh The Stop() function is used to stop the DHCPv6 S.A.R.R process. If this function is called 709*f439973dSWarner Losh successfully, all the IPv6 addresses of the configured IA will be released and the state of 710*f439973dSWarner Losh the configured IA will be transferred to Dhcp6Init. 711*f439973dSWarner Losh 712*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance. 713*f439973dSWarner Losh 714*f439973dSWarner Losh @retval EFI_SUCCESS The DHCPv6 S.A.R.R process has been stopped when 715*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL. 716*f439973dSWarner Losh The EFI DHCPv6 Protocol instance has sent Release packet if 717*f439973dSWarner Losh need release or has been stopped if needn't, when 718*f439973dSWarner Losh EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL. 719*f439973dSWarner Losh @retval EFI_INVALID_PARAMETER This is NULL. 720*f439973dSWarner Losh 721*f439973dSWarner Losh **/ 722*f439973dSWarner Losh typedef 723*f439973dSWarner Losh EFI_STATUS 724*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_STOP)( 725*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This 726*f439973dSWarner Losh ); 727*f439973dSWarner Losh 728*f439973dSWarner Losh /** 729*f439973dSWarner Losh Parse the option data in the DHCPv6 packet. 730*f439973dSWarner Losh 731*f439973dSWarner Losh The Parse() function is used to retrieve the option list in the DHCPv6 packet. 732*f439973dSWarner Losh 733*f439973dSWarner Losh @param[in] This Pointer to the EFI_DHCP6_PROTOCOL instance. 734*f439973dSWarner Losh 735*f439973dSWarner Losh @param[in] Packet Pointer to packet to be parsed. 736*f439973dSWarner Losh @param[in] OptionCount On input, the number of entries in the PacketOptionList. 737*f439973dSWarner Losh On output, the number of DHCPv6 options in the Packet. 738*f439973dSWarner Losh @param[in] PacketOptionList List of pointers to the DHCPv6 options in the Packet. 739*f439973dSWarner Losh The OpCode and OpLen in EFI_DHCP6_PACKET_OPTION are 740*f439973dSWarner Losh both stored in network byte order. 741*f439973dSWarner Losh @retval EFI_SUCCESS The packet was successfully parsed. 742*f439973dSWarner Losh @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE 743*f439973dSWarner Losh - This is NULL. 744*f439973dSWarner Losh - Packet is NULL. 745*f439973dSWarner Losh - Packet is not a well-formed DHCPv6 packet. 746*f439973dSWarner Losh - OptionCount is NULL. 747*f439973dSWarner Losh - *OptionCount is not zero and PacketOptionList is NULL. 748*f439973dSWarner Losh @retval EFI_BUFFER_TOO_SMALL *OptionCount is smaller than the number of options that were 749*f439973dSWarner Losh found in the Packet. 750*f439973dSWarner Losh 751*f439973dSWarner Losh **/ 752*f439973dSWarner Losh typedef 753*f439973dSWarner Losh EFI_STATUS 754*f439973dSWarner Losh (EFIAPI *EFI_DHCP6_PARSE)( 755*f439973dSWarner Losh IN EFI_DHCP6_PROTOCOL *This, 756*f439973dSWarner Losh IN EFI_DHCP6_PACKET *Packet, 757*f439973dSWarner Losh IN OUT UINT32 *OptionCount, 758*f439973dSWarner Losh OUT EFI_DHCP6_PACKET_OPTION *PacketOptionList[] OPTIONAL 759*f439973dSWarner Losh ); 760*f439973dSWarner Losh 761*f439973dSWarner Losh /// 762*f439973dSWarner Losh /// The EFI DHCPv6 Protocol is used to get IPv6 addresses and other configuration parameters 763*f439973dSWarner Losh /// from DHCPv6 servers. 764*f439973dSWarner Losh /// 765*f439973dSWarner Losh struct _EFI_DHCP6_PROTOCOL { 766*f439973dSWarner Losh EFI_DHCP6_GET_MODE_DATA GetModeData; 767*f439973dSWarner Losh EFI_DHCP6_CONFIGURE Configure; 768*f439973dSWarner Losh EFI_DHCP6_START Start; 769*f439973dSWarner Losh EFI_DHCP6_INFO_REQUEST InfoRequest; 770*f439973dSWarner Losh EFI_DHCP6_RENEW_REBIND RenewRebind; 771*f439973dSWarner Losh EFI_DHCP6_DECLINE Decline; 772*f439973dSWarner Losh EFI_DHCP6_RELEASE Release; 773*f439973dSWarner Losh EFI_DHCP6_STOP Stop; 774*f439973dSWarner Losh EFI_DHCP6_PARSE Parse; 775*f439973dSWarner Losh }; 776*f439973dSWarner Losh 777*f439973dSWarner Losh extern EFI_GUID gEfiDhcp6ProtocolGuid; 778*f439973dSWarner Losh extern EFI_GUID gEfiDhcp6ServiceBindingProtocolGuid; 779*f439973dSWarner Losh 780*f439973dSWarner Losh #endif 781