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