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