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