]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h
1. Fix a bug in PXE driver that the PXE boot do not restart if a new boot option...
[mirror_edk2.git] / NetworkPkg / Dhcp6Dxe / Dhcp6Impl.h
1 /** @file
2 Dhcp6 internal data structure and definition declaration.
3
4 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __EFI_DHCP6_IMPL_H__
17 #define __EFI_DHCP6_IMPL_H__
18
19
20 #include <Uefi.h>
21
22 #include <Protocol/Dhcp6.h>
23 #include <Protocol/Udp6.h>
24 #include <Protocol/Ip6Config.h>
25 #include <Protocol/ServiceBinding.h>
26 #include <Protocol/DriverBinding.h>
27
28 #include <Library/UdpIoLib.h>
29 #include <Library/DebugLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/MemoryAllocationLib.h>
32 #include <Library/UefiBootServicesTableLib.h>
33 #include <Library/UefiRuntimeServicesTableLib.h>
34 #include <Library/UefiLib.h>
35 #include <Library/BaseLib.h>
36 #include <Library/NetLib.h>
37
38
39 typedef struct _DHCP6_IA_CB DHCP6_IA_CB;
40 typedef struct _DHCP6_INF_CB DHCP6_INF_CB;
41 typedef struct _DHCP6_TX_CB DHCP6_TX_CB;
42 typedef struct _DHCP6_SERVICE DHCP6_SERVICE;
43 typedef struct _DHCP6_INSTANCE DHCP6_INSTANCE;
44
45 #include "Dhcp6Utility.h"
46 #include "Dhcp6Io.h"
47 #include "Dhcp6Driver.h"
48
49 #define DHCP6_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'H', '6', 'S')
50 #define DHCP6_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'H', '6', 'I')
51
52 //
53 // Transmit parameters of solicit message, refers to section-5.5 of rfc-3315.
54 //
55 #define DHCP6_SOL_MAX_DELAY 1
56 #define DHCP6_SOL_IRT 1
57 #define DHCP6_SOL_MRC 0
58 #define DHCP6_SOL_MRT 120
59 #define DHCP6_SOL_MRD 0
60 //
61 // Transmit parameters of request message, refers to section-5.5 of rfc-3315.
62 //
63 #define DHCP6_REQ_IRT 1
64 #define DHCP6_REQ_MRC 10
65 #define DHCP6_REQ_MRT 30
66 #define DHCP6_REQ_MRD 0
67 //
68 // Transmit parameters of confirm message, refers to section-5.5 of rfc-3315.
69 //
70 #define DHCP6_CNF_MAX_DELAY 1
71 #define DHCP6_CNF_IRT 1
72 #define DHCP6_CNF_MRC 0
73 #define DHCP6_CNF_MRT 4
74 #define DHCP6_CNF_MRD 10
75 //
76 // Transmit parameters of renew message, refers to section-5.5 of rfc-3315.
77 //
78 #define DHCP6_REN_IRT 10
79 #define DHCP6_REN_MRC 0
80 #define DHCP6_REN_MRT 600
81 #define DHCP6_REN_MRD 0
82 //
83 // Transmit parameters of rebind message, refers to section-5.5 of rfc-3315.
84 //
85 #define DHCP6_REB_IRT 10
86 #define DHCP6_REB_MRC 0
87 #define DHCP6_REB_MRT 600
88 #define DHCP6_REB_MRD 0
89 //
90 // Transmit parameters of information request message, refers to section-5.5 of rfc-3315.
91 //
92 #define DHCP6_INF_MAX_DELAY 1
93 #define DHCP6_INF_IRT 1
94 #define DHCP6_INF_MRC 0
95 #define DHCP6_INF_MRT 120
96 #define DHCP6_INF_MRD 0
97 //
98 // Transmit parameters of release message, refers to section-5.5 of rfc-3315.
99 //
100 #define DHCP6_REL_IRT 1
101 #define DHCP6_REL_MRC 5
102 #define DHCP6_REL_MRT 0
103 #define DHCP6_REL_MRD 0
104 //
105 // Transmit parameters of decline message, refers to section-5.5 of rfc-3315.
106 //
107 #define DHCP6_DEC_IRT 1
108 #define DHCP6_DEC_MRC 5
109 #define DHCP6_DEC_MRT 0
110 #define DHCP6_DEC_MRD 0
111
112 #define DHCP6_PACKET_ALL 0
113 #define DHCP6_PACKET_STATEFUL 1
114 #define DHCP6_PACKET_STATELESS 2
115
116 #define DHCP6_BASE_PACKET_SIZE 1024
117
118 #define DHCP6_PORT_CLIENT 546
119 #define DHCP6_PORT_SERVER 547
120
121 #define DHCP6_INSTANCE_FROM_THIS(Instance) CR ((Instance), DHCP6_INSTANCE, Dhcp6, DHCP6_INSTANCE_SIGNATURE)
122 #define DHCP6_SERVICE_FROM_THIS(Service) CR ((Service), DHCP6_SERVICE, ServiceBinding, DHCP6_SERVICE_SIGNATURE)
123
124 extern EFI_IPv6_ADDRESS mAllDhcpRelayAndServersAddress;
125 extern EFI_IPv6_ADDRESS mAllDhcpServersAddress;
126 extern EFI_DHCP6_PROTOCOL gDhcp6ProtocolTemplate;
127
128 //
129 // Enumeration of Dhcp6 message type, refers to section-5.3 of rfc-3315.
130 //
131 typedef enum {
132 Dhcp6MsgSolicit = 1,
133 Dhcp6MsgAdvertise = 2,
134 Dhcp6MsgRequest = 3,
135 Dhcp6MsgConfirm = 4,
136 Dhcp6MsgRenew = 5,
137 Dhcp6MsgRebind = 6,
138 Dhcp6MsgReply = 7,
139 Dhcp6MsgRelease = 8,
140 Dhcp6MsgDecline = 9,
141 Dhcp6MsgReconfigure = 10,
142 Dhcp6MsgInfoRequest = 11
143 } DHCP6_MSG_TYPE;
144
145 //
146 // Enumeration of option code in Dhcp6 packet, refers to section-24.3 of rfc-3315.
147 //
148 typedef enum {
149 Dhcp6OptClientId = 1,
150 Dhcp6OptServerId = 2,
151 Dhcp6OptIana = 3,
152 Dhcp6OptIata = 4,
153 Dhcp6OptIaAddr = 5,
154 Dhcp6OptRequestOption = 6,
155 Dhcp6OptPreference = 7,
156 Dhcp6OptElapsedTime = 8,
157 Dhcp6OptReplayMessage = 9,
158 Dhcp6OptAuthentication = 11,
159 Dhcp6OptServerUnicast = 12,
160 Dhcp6OptStatusCode = 13,
161 Dhcp6OptRapidCommit = 14,
162 Dhcp6OptUserClass = 15,
163 Dhcp6OptVendorClass = 16,
164 Dhcp6OptVendorInfo = 17,
165 Dhcp6OptInterfaceId = 18,
166 Dhcp6OptReconfigMessage = 19,
167 Dhcp6OptReconfigureAccept = 20
168 } DHCP6_OPT_CODE;
169
170 //
171 // Enumeration of status code recorded by IANA, refers to section-24.4 of rfc-3315.
172 //
173 typedef enum {
174 Dhcp6StsSuccess = 0,
175 Dhcp6StsUnspecFail = 1,
176 Dhcp6StsNoAddrsAvail = 2,
177 Dhcp6StsNoBinding = 3,
178 Dhcp6StsNotOnLink = 4,
179 Dhcp6StsUseMulticast = 5
180 } DHCP6_STS_CODE;
181
182 //
183 // Enumeration of Duid type recorded by IANA, refers to section-24.5 of rfc-3315.
184 //
185 typedef enum {
186 Dhcp6DuidTypeLlt = 1,
187 Dhcp6DuidTypeEn = 2,
188 Dhcp6DuidTypeLl = 3,
189 Dhcp6DuidTypeUuid = 4
190 } DHCP6_DUID_TYPE;
191
192 //
193 // Control block for each IA.
194 //
195 struct _DHCP6_IA_CB {
196 EFI_DHCP6_IA *Ia;
197 UINT32 T1;
198 UINT32 T2;
199 UINT32 AllExpireTime;
200 UINT32 LeaseTime;
201 };
202
203 //
204 // Control block for each transmitted message.
205 //
206 struct _DHCP6_TX_CB {
207 LIST_ENTRY Link;
208 UINT32 Xid;
209 EFI_DHCP6_PACKET *TxPacket;
210 EFI_DHCP6_RETRANSMISSION RetryCtl;
211 UINT32 RetryCnt;
212 UINT32 RetryExp;
213 UINT32 RetryLos;
214 UINT32 TickTime;
215 UINT16 *Elapsed;
216 BOOLEAN SolicitRetry;
217 };
218
219 //
220 // Control block for each info-request message.
221 //
222 struct _DHCP6_INF_CB {
223 LIST_ENTRY Link;
224 UINT32 Xid;
225 EFI_DHCP6_INFO_CALLBACK ReplyCallback;
226 VOID *CallbackContext;
227 EFI_EVENT TimeoutEvent;
228 };
229
230 //
231 // Control block for Dhcp6 instance, it's per configuration data.
232 //
233 struct _DHCP6_INSTANCE {
234 UINT32 Signature;
235 EFI_HANDLE Handle;
236 DHCP6_SERVICE *Service;
237 LIST_ENTRY Link;
238 EFI_DHCP6_PROTOCOL Dhcp6;
239 EFI_EVENT Timer;
240 EFI_DHCP6_CONFIG_DATA *Config;
241 EFI_DHCP6_IA *CacheIa;
242 DHCP6_IA_CB IaCb;
243 LIST_ENTRY TxList;
244 LIST_ENTRY InfList;
245 EFI_DHCP6_PACKET *AdSelect;
246 UINT8 AdPref;
247 EFI_IPv6_ADDRESS *Unicast;
248 EFI_STATUS UdpSts;
249 BOOLEAN InDestroy;
250 BOOLEAN MediaPresent;
251 UINT64 StartTime;
252 };
253
254 //
255 // Control block for Dhcp6 service, it's per Nic handle.
256 //
257 struct _DHCP6_SERVICE {
258 UINT32 Signature;
259 EFI_HANDLE Controller;
260 EFI_HANDLE Image;
261 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
262 EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
263 EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg;
264 EFI_DHCP6_DUID *ClientId;
265 UDP_IO *UdpIo;
266 UINT32 Xid;
267 LIST_ENTRY Child;
268 UINTN NumOfChild;
269 BOOLEAN InDestroy;
270 };
271
272 /**
273 Starts the DHCPv6 standard S.A.R.R. process.
274
275 The Start() function starts the DHCPv6 standard process. This function can
276 be called only when the state of Dhcp6 instance is in the Dhcp6Init state.
277 If the DHCP process completes successfully, the state of the Dhcp6 instance
278 will be transferred through Dhcp6Selecting and Dhcp6Requesting to the
279 Dhcp6Bound state.
280 Refer to rfc-3315 for precise state transitions during this process. At the
281 time when each event occurs in this process, the callback function that was set
282 by EFI_DHCP6_PROTOCOL.Configure() will be called and the user can take this
283 opportunity to control the process.
284
285 @param[in] This The pointer to Dhcp6 protocol.
286
287 @retval EFI_SUCCESS The DHCPv6 standard process has started, or it
288 completed when CompletionEvent was NULL.
289 @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured.
290 @retval EFI_INVALID_PARAMETER This is NULL.
291 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
292 @retval EFI_TIMEOUT The DHCPv6 configuration process failed because no
293 response was received from the server within the
294 specified timeout value.
295 @retval EFI_ABORTED The user aborted the DHCPv6 process.
296 @retval EFI_ALREADY_STARTED Some other Dhcp6 instance already started the DHCPv6
297 standard process.
298 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
299
300 **/
301 EFI_STATUS
302 EFIAPI
303 EfiDhcp6Start (
304 IN EFI_DHCP6_PROTOCOL *This
305 );
306
307 /**
308 Stops the DHCPv6 standard S.A.R.R. process.
309
310 The Stop() function is used to stop the DHCPv6 standard process. After this
311 function is called successfully, the state of Dhcp6 instance is transferred
312 into the Dhcp6Init. EFI_DHCP6_PROTOCOL.Configure() needs to be called
313 before DHCPv6 standard process can be started again. This function can be
314 called when the Dhcp6 instance is in any state.
315
316 @param[in] This The pointer to the Dhcp6 protocol.
317
318 @retval EFI_SUCCESS The Dhcp6 instance is now in the Dhcp6Init state.
319 @retval EFI_INVALID_PARAMETER This is NULL.
320
321 **/
322 EFI_STATUS
323 EFIAPI
324 EfiDhcp6Stop (
325 IN EFI_DHCP6_PROTOCOL *This
326 );
327
328 /**
329 Returns the current operating mode data for the Dhcp6 instance.
330
331 The GetModeData() function returns the current operating mode and
332 cached data packet for the Dhcp6 instance.
333
334 @param[in] This The pointer to the Dhcp6 protocol.
335 @param[out] Dhcp6ModeData The pointer to the Dhcp6 mode data.
336 @param[out] Dhcp6ConfigData The pointer to the Dhcp6 configure data.
337
338 @retval EFI_SUCCESS The mode data was returned.
339 @retval EFI_INVALID_PARAMETER This is NULL.
340 @retval EFI_ACCESS_DENIED The EFI DHCPv6 Protocol instance has not
341 been configured when Dhcp6ConfigData is
342 not NULL.
343 **/
344 EFI_STATUS
345 EFIAPI
346 EfiDhcp6GetModeData (
347 IN EFI_DHCP6_PROTOCOL *This,
348 OUT EFI_DHCP6_MODE_DATA *Dhcp6ModeData OPTIONAL,
349 OUT EFI_DHCP6_CONFIG_DATA *Dhcp6ConfigData OPTIONAL
350 );
351
352 /**
353 Initializes, changes, or resets the operational settings for the Dhcp6 instance.
354
355 The Configure() function is used to initialize or clean up the configuration
356 data of the Dhcp6 instance:
357 - When Dhcp6CfgData is not NULL and Configure() is called successfully, the
358 configuration data will be initialized in the Dhcp6 instance and the state
359 of the configured IA will be transferred into Dhcp6Init.
360 - When Dhcp6CfgData is NULL and Configure() is called successfully, the
361 configuration data will be cleaned up and no IA will be associated with
362 the Dhcp6 instance.
363 To update the configuration data for an Dhcp6 instance, the original data
364 must be cleaned up before setting the new configuration data.
365
366 @param[in] This The pointer to the Dhcp6 protocol
367 @param[in] Dhcp6CfgData The pointer to the EFI_DHCP6_CONFIG_DATA.
368
369 @retval EFI_SUCCESS The Dhcp6 is configured successfully with the
370 Dhcp6Init state, or cleaned up the original
371 configuration setting.
372 @retval EFI_ACCESS_DENIED The Dhcp6 instance has been already configured
373 when Dhcp6CfgData is not NULL.
374 The Dhcp6 instance has already started the
375 DHCPv6 S.A.R.R when Dhcp6CfgData is NULL.
376 @retval EFI_INVALID_PARAMETER Some of the parameter is invalid.
377 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
378 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
379
380 **/
381 EFI_STATUS
382 EFIAPI
383 EfiDhcp6Configure (
384 IN EFI_DHCP6_PROTOCOL *This,
385 IN EFI_DHCP6_CONFIG_DATA *Dhcp6CfgData OPTIONAL
386 );
387
388 /**
389 Request configuration information without the assignment of any
390 Ia addresses of the client.
391
392 The InfoRequest() function is used to request configuration information
393 without the assignment of any IPv6 address of the client. Client sends
394 out Information Request packet to obtain the required configuration
395 information, and DHCPv6 server responds with Reply packet containing
396 the information for the client. The received Reply packet will be passed
397 to the user by ReplyCallback function. If user returns EFI_NOT_READY from
398 ReplyCallback, the Dhcp6 instance will continue to receive other Reply
399 packets unless timeout according to the Retransmission parameter.
400 Otherwise, the Information Request exchange process will be finished
401 successfully if user returns EFI_SUCCESS from ReplyCallback.
402
403 @param[in] This The pointer to the Dhcp6 protocol.
404 @param[in] SendClientId If TRUE, the DHCPv6 protocol instance will build Client
405 Identifier option and include it into Information Request
406 packet. Otherwise, Client Identifier option will not be included.
407 @param[in] OptionRequest The pointer to the buffer of option request options.
408 @param[in] OptionCount The option number in the OptionList.
409 @param[in] OptionList The list of appended options.
410 @param[in] Retransmission The pointer to the retransmission of the message.
411 @param[in] TimeoutEvent The event of timeout.
412 @param[in] ReplyCallback The callback function when a reply was received.
413 @param[in] CallbackContext The pointer to the parameter passed to the callback.
414
415 @retval EFI_SUCCESS The DHCPv6 information request exchange process
416 completed when TimeoutEvent is NULL. Information
417 Request packet has been sent to DHCPv6 server when
418 TimeoutEvent is not NULL.
419 @retval EFI_NO_RESPONSE The DHCPv6 information request exchange process failed
420 because of no response, or not all requested-options
421 are responded to by DHCPv6 servers when Timeout happened.
422 @retval EFI_ABORTED The DHCPv6 information request exchange process was aborted
423 by the user.
424 @retval EFI_INVALID_PARAMETER Some parameter is NULL.
425 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
426 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
427
428 **/
429 EFI_STATUS
430 EFIAPI
431 EfiDhcp6InfoRequest (
432 IN EFI_DHCP6_PROTOCOL *This,
433 IN BOOLEAN SendClientId,
434 IN EFI_DHCP6_PACKET_OPTION *OptionRequest,
435 IN UINT32 OptionCount,
436 IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL,
437 IN EFI_DHCP6_RETRANSMISSION *Retransmission,
438 IN EFI_EVENT TimeoutEvent OPTIONAL,
439 IN EFI_DHCP6_INFO_CALLBACK ReplyCallback,
440 IN VOID *CallbackContext OPTIONAL
441 );
442
443 /**
444 Manually extend the valid and preferred lifetimes for the IPv6 addresses
445 of the configured IA and update other configuration parameters by sending
446 Renew or Rebind packet.
447
448 The RenewRebind() function is used to manually extend the valid and preferred
449 lifetimes for the IPv6 addresses of the configured IA and update other
450 configuration parameters by sending a Renew or Rebind packet.
451 - When RebindRequest is FALSE and the state of the configured IA is Dhcp6Bound,
452 it will send Renew packet to the previously DHCPv6 server and transfer the
453 state of the configured IA to Dhcp6Renewing. If valid Reply packet received,
454 the state transfers to Dhcp6Bound and the valid and preferred timer restarts.
455 If fails, the state transfers to Dhcp6Bound but the timer continues.
456 - When RebindRequest is TRUE and the state of the configured IA is Dhcp6Bound,
457 it will send a Rebind packet. If a valid Reply packet is received, the state transfers
458 to Dhcp6Bound, and the valid and preferred timer restarts. If it fails, the state
459 transfers to Dhcp6Init, and the IA can't be used.
460
461 @param[in] This The pointer to the Dhcp6 protocol.
462 @param[in] RebindRequest If TRUE, Rebind packet will be sent and enter Dhcp6Rebinding state.
463 Otherwise, Renew packet will be sent and enter Dhcp6Renewing state.
464
465 @retval EFI_SUCCESS The DHCPv6 renew/rebind exchange process
466 completed and at least one IPv6 address of the
467 configured IA was bound again when
468 EFI_DHCP6_CONFIG_DATA.IaInfoEvent was NULL.
469 The EFI DHCPv6 Protocol instance has sent Renew
470 or Rebind packet when
471 EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.
472 @retval EFI_ACCESS_DENIED The Dhcp6 instance hasn't been configured, or the
473 state of the configured IA is not in Dhcp6Bound.
474 @retval EFI_ALREADY_STARTED The state of the configured IA has already entered
475 Dhcp6Renewing when RebindRequest is FALSE.
476 The state of the configured IA has already entered
477 Dhcp6Rebinding when RebindRequest is TRUE.
478 @retval EFI_ABORTED The DHCPv6 renew/rebind exchange process aborted
479 by user.
480 @retval EFI_NO_RESPONSE The DHCPv6 renew/rebind exchange process failed
481 because of no response.
482 @retval EFI_NO_MAPPING No IPv6 address has been bound to the configured
483 IA after the DHCPv6 renew/rebind exchange process.
484 @retval EFI_INVALID_PARAMETER Some parameter is NULL.
485 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
486
487 **/
488 EFI_STATUS
489 EFIAPI
490 EfiDhcp6RenewRebind (
491 IN EFI_DHCP6_PROTOCOL *This,
492 IN BOOLEAN RebindRequest
493 );
494
495 /**
496 Inform that one or more addresses assigned by a server are already
497 in use by another node.
498
499 The Decline() function is used to manually decline the assignment of
500 IPv6 addresses, which have been already used by another node. If all
501 IPv6 addresses of the configured IA are declined through this function,
502 the state of the IA will switch through Dhcp6Declining to Dhcp6Init.
503 Otherwise, the state of the IA will restore to Dhcp6Bound after the
504 declining process. The Decline() can only be called when the IA is in
505 Dhcp6Bound state. If the EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL,
506 this function is a blocking operation. It will return after the
507 declining process finishes, or aborted by user.
508
509 @param[in] This The pointer to the Dhcp6 protocol.
510 @param[in] AddressCount The number of declining addresses.
511 @param[in] Addresses The pointer to the buffer stored the declining
512 addresses.
513
514 @retval EFI_SUCCESS The DHCPv6 decline exchange process completed
515 when EFI_DHCP6_CONFIG_DATA.IaInfoEvent was NULL.
516 The Dhcp6 instance has sent Decline packet when
517 EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.
518 @retval EFI_ACCESS_DENIED The Dhcp6 instance hasn't been configured, or the
519 state of the configured IA is not in Dhcp6Bound.
520 @retval EFI_ABORTED The DHCPv6 decline exchange process was aborted by the user.
521 @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with
522 the configured IA for this instance.
523 @retval EFI_INVALID_PARAMETER Some parameter is NULL.
524 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
525
526 **/
527 EFI_STATUS
528 EFIAPI
529 EfiDhcp6Decline (
530 IN EFI_DHCP6_PROTOCOL *This,
531 IN UINT32 AddressCount,
532 IN EFI_IPv6_ADDRESS *Addresses
533 );
534
535 /**
536 Release one or more addresses associated with the configured Ia
537 for the current instance.
538
539 The Release() function is used to manually release the one or more
540 IPv6 address. If AddressCount is zero, it will release all IPv6
541 addresses of the configured IA. If all IPv6 addresses of the IA are
542 released through this function, the state of the IA will switch
543 through Dhcp6Releasing to Dhcp6Init, otherwise, the state of the
544 IA will restore to Dhcp6Bound after the releasing process.
545 The Release() can only be called when the IA is in a Dhcp6Bound state.
546 If the EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, the function is
547 a blocking operation. It will return after the releasing process
548 finishes, or aborted by user.
549
550 @param[in] This The pointer to the Dhcp6 protocol.
551 @param[in] AddressCount The number of releasing addresses.
552 @param[in] Addresses The pointer to the buffer stored the releasing
553 addresses.
554 @retval EFI_SUCCESS The DHCPv6 release exchange process has
555 completed when EFI_DHCP6_CONFIG_DATA.IaInfoEvent
556 is NULL. The Dhcp6 instance has sent Release
557 packet when EFI_DHCP6_CONFIG_DATA.IaInfoEvent
558 is not NULL.
559 @retval EFI_ACCESS_DENIED The Dhcp6 instance hasn't been configured, or the
560 state of the configured IA is not in Dhcp6Bound.
561 @retval EFI_ABORTED The DHCPv6 release exchange process was aborted by the user.
562 @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with
563 the configured IA for this instance.
564 @retval EFI_INVALID_PARAMETER Some parameter is NULL.
565 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
566
567 **/
568 EFI_STATUS
569 EFIAPI
570 EfiDhcp6Release (
571 IN EFI_DHCP6_PROTOCOL *This,
572 IN UINT32 AddressCount,
573 IN EFI_IPv6_ADDRESS *Addresses
574 );
575
576 /**
577 Parse the option data in the Dhcp6 packet.
578
579 The Parse() function is used to retrieve the option list in the DHCPv6 packet.
580
581 @param[in] This The pointer to the Dhcp6 protocol.
582 @param[in] Packet The pointer to the Dhcp6 packet.
583 @param[in, out] OptionCount The number of option in the packet.
584 @param[out] PacketOptionList The array of pointers to the each option in the packet.
585
586 @retval EFI_SUCCESS The packet was successfully parsed.
587 @retval EFI_INVALID_PARAMETER Some parameter is NULL.
588 @retval EFI_BUFFER_TOO_SMALL *OptionCount is smaller than the number of options
589 that were found in the Packet.
590
591 **/
592 EFI_STATUS
593 EFIAPI
594 EfiDhcp6Parse (
595 IN EFI_DHCP6_PROTOCOL *This,
596 IN EFI_DHCP6_PACKET *Packet,
597 IN OUT UINT32 *OptionCount,
598 OUT EFI_DHCP6_PACKET_OPTION *PacketOptionList[] OPTIONAL
599 );
600
601 #endif