]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h
1. Fix bugs for PXE-IPv6 to accommodate the situation:
[mirror_edk2.git] / NetworkPkg / Dhcp6Dxe / Dhcp6Impl.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 Dhcp6 internal data structure and definition declaration.\r
3\r
33c09637 4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
a3bcde70
HT
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
33c09637 187 Dhcp6DuidTypeLl = 3,\r
188 Dhcp6DuidTypeUuid = 4\r
a3bcde70
HT
189} DHCP6_DUID_TYPE;\r
190\r
191//\r
192// Control block for each IA.\r
193//\r
194struct _DHCP6_IA_CB {\r
195 EFI_DHCP6_IA *Ia;\r
196 UINT32 T1;\r
197 UINT32 T2;\r
198 UINT32 AllExpireTime;\r
199 UINT32 LeaseTime;\r
200};\r
201\r
202//\r
203// Control block for each transmitted message.\r
204//\r
205struct _DHCP6_TX_CB {\r
206 LIST_ENTRY Link;\r
207 UINT32 Xid;\r
208 EFI_DHCP6_PACKET *TxPacket;\r
209 EFI_DHCP6_RETRANSMISSION RetryCtl;\r
210 UINT32 RetryCnt;\r
211 UINT32 RetryExp;\r
212 UINT32 RetryLos;\r
213 UINT32 TickTime;\r
214 UINT16 *Elapsed;\r
129b8b09 215 BOOLEAN SolicitRetry;\r
a3bcde70
HT
216};\r
217\r
218//\r
219// Control block for each info-request message.\r
220//\r
221struct _DHCP6_INF_CB {\r
222 LIST_ENTRY Link;\r
223 UINT32 Xid;\r
224 EFI_DHCP6_INFO_CALLBACK ReplyCallback;\r
225 VOID *CallbackContext;\r
226 EFI_EVENT TimeoutEvent;\r
227};\r
228\r
229//\r
230// Control block for Dhcp6 instance, it's per configuration data.\r
231//\r
232struct _DHCP6_INSTANCE {\r
233 UINT32 Signature;\r
234 EFI_HANDLE Handle;\r
235 DHCP6_SERVICE *Service;\r
236 LIST_ENTRY Link;\r
237 EFI_DHCP6_PROTOCOL Dhcp6;\r
238 EFI_EVENT Timer;\r
239 EFI_DHCP6_CONFIG_DATA *Config;\r
240 EFI_DHCP6_IA *CacheIa;\r
241 DHCP6_IA_CB IaCb;\r
242 LIST_ENTRY TxList;\r
243 LIST_ENTRY InfList;\r
244 EFI_DHCP6_PACKET *AdSelect;\r
245 UINT8 AdPref;\r
246 EFI_IPv6_ADDRESS *Unicast;\r
247 EFI_STATUS UdpSts;\r
248 BOOLEAN InDestory;\r
249 BOOLEAN MediaPresent;\r
250 UINT64 StartTime;\r
251};\r
252\r
253//\r
254// Control block for Dhcp6 service, it's per Nic handle.\r
255//\r
256struct _DHCP6_SERVICE {\r
257 UINT32 Signature;\r
258 EFI_HANDLE Controller;\r
259 EFI_HANDLE Image;\r
260 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
261 EFI_SIMPLE_NETWORK_PROTOCOL *Snp;\r
262 EFI_DHCP6_DUID *ClientId;\r
263 UDP_IO *UdpIo;\r
264 UINT32 Xid;\r
265 LIST_ENTRY Child;\r
266 UINTN NumOfChild;\r
267 BOOLEAN InDestory;\r
268};\r
269\r
270/**\r
271 Starts the DHCPv6 standard S.A.R.R. process.\r
272\r
273 The Start() function starts the DHCPv6 standard process. This function can\r
274 be called only when the state of Dhcp6 instance is in the Dhcp6Init state.\r
275 If the DHCP process completes successfully, the state of the Dhcp6 instance\r
276 will be transferred through Dhcp6Selecting and Dhcp6Requesting to the\r
277 Dhcp6Bound state.\r
278 Refer to rfc-3315 for precise state transitions during this process. At the\r
279 time when each event occurs in this process, the callback function that was set\r
280 by EFI_DHCP6_PROTOCOL.Configure() will be called and the user can take this\r
281 opportunity to control the process.\r
282\r
283 @param[in] This The pointer to Dhcp6 protocol.\r
284\r
285 @retval EFI_SUCCESS The DHCPv6 standard process has started, or it\r
286 completed when CompletionEvent was NULL.\r
287 @retval EFI_ACCESS_DENIED The EFI DHCPv6 Child instance hasn't been configured.\r
288 @retval EFI_INVALID_PARAMETER This is NULL.\r
289 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
290 @retval EFI_TIMEOUT The DHCPv6 configuration process failed because no\r
291 response was received from the server within the\r
292 specified timeout value.\r
293 @retval EFI_ABORTED The user aborted the DHCPv6 process.\r
294 @retval EFI_ALREADY_STARTED Some other Dhcp6 instance already started the DHCPv6\r
295 standard process.\r
296 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
297\r
298**/\r
299EFI_STATUS\r
300EFIAPI\r
301EfiDhcp6Start (\r
302 IN EFI_DHCP6_PROTOCOL *This\r
303 );\r
304\r
305/**\r
306 Stops the DHCPv6 standard S.A.R.R. process.\r
307\r
308 The Stop() function is used to stop the DHCPv6 standard process. After this\r
309 function is called successfully, the state of Dhcp6 instance is transferred\r
310 into the Dhcp6Init. EFI_DHCP6_PROTOCOL.Configure() needs to be called\r
311 before DHCPv6 standard process can be started again. This function can be\r
312 called when the Dhcp6 instance is in any state.\r
313\r
314 @param[in] This The pointer to the Dhcp6 protocol.\r
315\r
316 @retval EFI_SUCCESS The Dhcp6 instance is now in the Dhcp6Init state.\r
317 @retval EFI_INVALID_PARAMETER This is NULL.\r
318\r
319**/\r
320EFI_STATUS\r
321EFIAPI\r
322EfiDhcp6Stop (\r
323 IN EFI_DHCP6_PROTOCOL *This\r
324 );\r
325\r
326/**\r
327 Returns the current operating mode data for the Dhcp6 instance.\r
328\r
329 The GetModeData() function returns the current operating mode and\r
330 cached data packet for the Dhcp6 instance.\r
331\r
332 @param[in] This The pointer to the Dhcp6 protocol.\r
333 @param[out] Dhcp6ModeData The pointer to the Dhcp6 mode data.\r
334 @param[out] Dhcp6ConfigData The pointer to the Dhcp6 configure data.\r
335\r
336 @retval EFI_SUCCESS The mode data was returned.\r
337 @retval EFI_INVALID_PARAMETER This is NULL.\r
338 @retval EFI_ACCESS_DENIED The EFI DHCPv6 Protocol instance has not\r
339 been configured when Dhcp6ConfigData is\r
340 not NULL.\r
341**/\r
342EFI_STATUS\r
343EFIAPI\r
344EfiDhcp6GetModeData (\r
345 IN EFI_DHCP6_PROTOCOL *This,\r
346 OUT EFI_DHCP6_MODE_DATA *Dhcp6ModeData OPTIONAL,\r
347 OUT EFI_DHCP6_CONFIG_DATA *Dhcp6ConfigData OPTIONAL\r
348 );\r
349\r
350/**\r
351 Initializes, changes, or resets the operational settings for the Dhcp6 instance.\r
352\r
353 The Configure() function is used to initialize or clean up the configuration\r
354 data of the Dhcp6 instance:\r
355 - When Dhcp6CfgData is not NULL and Configure() is called successfully, the\r
356 configuration data will be initialized in the Dhcp6 instance and the state\r
357 of the configured IA will be transferred into Dhcp6Init.\r
358 - When Dhcp6CfgData is NULL and Configure() is called successfully, the\r
359 configuration data will be cleaned up and no IA will be associated with\r
360 the Dhcp6 instance.\r
361 To update the configuration data for an Dhcp6 instance, the original data\r
362 must be cleaned up before setting the new configuration data.\r
363\r
364 @param[in] This The pointer to the Dhcp6 protocol\r
365 @param[in] Dhcp6CfgData The pointer to the EFI_DHCP6_CONFIG_DATA.\r
366\r
367 @retval EFI_SUCCESS The Dhcp6 is configured successfully with the\r
368 Dhcp6Init state, or cleaned up the original\r
369 configuration setting.\r
370 @retval EFI_ACCESS_DENIED The Dhcp6 instance has been already configured\r
371 when Dhcp6CfgData is not NULL.\r
372 The Dhcp6 instance has already started the\r
373 DHCPv6 S.A.R.R when Dhcp6CfgData is NULL.\r
374 @retval EFI_INVALID_PARAMETER Some of the parameter is invalid.\r
375 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
376 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
377\r
378**/\r
379EFI_STATUS\r
380EFIAPI\r
381EfiDhcp6Configure (\r
382 IN EFI_DHCP6_PROTOCOL *This,\r
383 IN EFI_DHCP6_CONFIG_DATA *Dhcp6CfgData OPTIONAL\r
384 );\r
385\r
386/**\r
387 Request configuration information without the assignment of any\r
388 Ia addresses of the client.\r
389\r
390 The InfoRequest() function is used to request configuration information\r
391 without the assignment of any IPv6 address of the client. Client sends\r
392 out Information Request packet to obtain the required configuration\r
393 information, and DHCPv6 server responds with Reply packet containing\r
394 the information for the client. The received Reply packet will be passed\r
395 to the user by ReplyCallback function. If user returns EFI_NOT_READY from\r
396 ReplyCallback, the Dhcp6 instance will continue to receive other Reply\r
397 packets unless timeout according to the Retransmission parameter.\r
398 Otherwise, the Information Request exchange process will be finished\r
399 successfully if user returns EFI_SUCCESS from ReplyCallback.\r
400\r
401 @param[in] This The pointer to the Dhcp6 protocol.\r
402 @param[in] SendClientId If TRUE, the DHCPv6 protocol instance will build Client\r
403 Identifier option and include it into Information Request\r
404 packet. Otherwise, Client Identifier option will not be included.\r
405 @param[in] OptionRequest The pointer to the buffer of option request options.\r
406 @param[in] OptionCount The option number in the OptionList.\r
407 @param[in] OptionList The list of appended options.\r
408 @param[in] Retransmission The pointer to the retransmission of the message.\r
409 @param[in] TimeoutEvent The event of timeout.\r
410 @param[in] ReplyCallback The callback function when a reply was received.\r
411 @param[in] CallbackContext The pointer to the parameter passed to the callback.\r
412\r
413 @retval EFI_SUCCESS The DHCPv6 information request exchange process\r
414 completed when TimeoutEvent is NULL. Information\r
415 Request packet has been sent to DHCPv6 server when\r
416 TimeoutEvent is not NULL.\r
417 @retval EFI_NO_RESPONSE The DHCPv6 information request exchange process failed\r
418 because of no response, or not all requested-options\r
419 are responded to by DHCPv6 servers when Timeout happened.\r
420 @retval EFI_ABORTED The DHCPv6 information request exchange process was aborted\r
421 by the user.\r
422 @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
423 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
424 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
425\r
426**/\r
427EFI_STATUS\r
428EFIAPI\r
429EfiDhcp6InfoRequest (\r
430 IN EFI_DHCP6_PROTOCOL *This,\r
431 IN BOOLEAN SendClientId,\r
432 IN EFI_DHCP6_PACKET_OPTION *OptionRequest,\r
433 IN UINT32 OptionCount,\r
434 IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL,\r
435 IN EFI_DHCP6_RETRANSMISSION *Retransmission,\r
436 IN EFI_EVENT TimeoutEvent OPTIONAL,\r
437 IN EFI_DHCP6_INFO_CALLBACK ReplyCallback,\r
438 IN VOID *CallbackContext OPTIONAL\r
439 );\r
440\r
441/**\r
442 Manually extend the valid and preferred lifetimes for the IPv6 addresses\r
443 of the configured IA and update other configuration parameters by sending\r
444 Renew or Rebind packet.\r
445\r
446 The RenewRebind() function is used to manually extend the valid and preferred\r
447 lifetimes for the IPv6 addresses of the configured IA and update other\r
448 configuration parameters by sending a Renew or Rebind packet.\r
449 - When RebindRequest is FALSE and the state of the configured IA is Dhcp6Bound,\r
450 it will send Renew packet to the previously DHCPv6 server and transfer the\r
451 state of the configured IA to Dhcp6Renewing. If valid Reply packet received,\r
452 the state transfers to Dhcp6Bound and the valid and preferred timer restarts.\r
453 If fails, the state transfers to Dhcp6Bound but the timer continues.\r
454 - When RebindRequest is TRUE and the state of the configured IA is Dhcp6Bound,\r
455 it will send a Rebind packet. If a valid Reply packet is received, the state transfers\r
456 to Dhcp6Bound, and the valid and preferred timer restarts. If it fails, the state\r
457 transfers to Dhcp6Init, and the IA can't be used.\r
458\r
459 @param[in] This The pointer to the Dhcp6 protocol.\r
460 @param[in] RebindRequest If TRUE, Rebind packet will be sent and enter Dhcp6Rebinding state.\r
461 Otherwise, Renew packet will be sent and enter Dhcp6Renewing state.\r
462\r
463 @retval EFI_SUCCESS The DHCPv6 renew/rebind exchange process\r
464 completed and at least one IPv6 address of the\r
465 configured IA was bound again when\r
466 EFI_DHCP6_CONFIG_DATA.IaInfoEvent was NULL.\r
467 The EFI DHCPv6 Protocol instance has sent Renew\r
468 or Rebind packet when\r
469 EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.\r
470 @retval EFI_ACCESS_DENIED The Dhcp6 instance hasn't been configured, or the\r
471 state of the configured IA is not in Dhcp6Bound.\r
472 @retval EFI_ALREADY_STARTED The state of the configured IA has already entered\r
473 Dhcp6Renewing when RebindRequest is FALSE.\r
474 The state of the configured IA has already entered\r
475 Dhcp6Rebinding when RebindRequest is TRUE.\r
476 @retval EFI_ABORTED The DHCPv6 renew/rebind exchange process aborted\r
477 by user.\r
478 @retval EFI_NO_RESPONSE The DHCPv6 renew/rebind exchange process failed\r
479 because of no response.\r
480 @retval EFI_NO_MAPPING No IPv6 address has been bound to the configured\r
481 IA after the DHCPv6 renew/rebind exchange process.\r
482 @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
483 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
484\r
485**/\r
486EFI_STATUS\r
487EFIAPI\r
488EfiDhcp6RenewRebind (\r
489 IN EFI_DHCP6_PROTOCOL *This,\r
490 IN BOOLEAN RebindRequest\r
491 );\r
492\r
493/**\r
494 Inform that one or more addresses assigned by a server are already\r
495 in use by another node.\r
496\r
497 The Decline() function is used to manually decline the assignment of\r
498 IPv6 addresses, which have been already used by another node. If all\r
499 IPv6 addresses of the configured IA are declined through this function,\r
500 the state of the IA will switch through Dhcp6Declining to Dhcp6Init.\r
501 Otherwise, the state of the IA will restore to Dhcp6Bound after the\r
502 declining process. The Decline() can only be called when the IA is in\r
503 Dhcp6Bound state. If the EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL,\r
504 this function is a blocking operation. It will return after the\r
505 declining process finishes, or aborted by user.\r
506\r
507 @param[in] This The pointer to the Dhcp6 protocol.\r
508 @param[in] AddressCount The number of declining addresses.\r
509 @param[in] Addresses The pointer to the buffer stored the declining\r
510 addresses.\r
511\r
512 @retval EFI_SUCCESS The DHCPv6 decline exchange process completed\r
513 when EFI_DHCP6_CONFIG_DATA.IaInfoEvent was NULL.\r
514 The Dhcp6 instance has sent Decline packet when\r
515 EFI_DHCP6_CONFIG_DATA.IaInfoEvent is not NULL.\r
516 @retval EFI_ACCESS_DENIED The Dhcp6 instance hasn't been configured, or the\r
517 state of the configured IA is not in Dhcp6Bound.\r
518 @retval EFI_ABORTED The DHCPv6 decline exchange process was aborted by the user.\r
519 @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with\r
520 the configured IA for this instance.\r
521 @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
522 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
523\r
524**/\r
525EFI_STATUS\r
526EFIAPI\r
527EfiDhcp6Decline (\r
528 IN EFI_DHCP6_PROTOCOL *This,\r
529 IN UINT32 AddressCount,\r
530 IN EFI_IPv6_ADDRESS *Addresses\r
531 );\r
532\r
533/**\r
534 Release one or more addresses associated with the configured Ia\r
535 for the current instance.\r
536\r
537 The Release() function is used to manually release the one or more\r
538 IPv6 address. If AddressCount is zero, it will release all IPv6\r
539 addresses of the configured IA. If all IPv6 addresses of the IA are\r
540 released through this function, the state of the IA will switch\r
541 through Dhcp6Releasing to Dhcp6Init, otherwise, the state of the\r
542 IA will restore to Dhcp6Bound after the releasing process.\r
543 The Release() can only be called when the IA is in a Dhcp6Bound state.\r
544 If the EFI_DHCP6_CONFIG_DATA.IaInfoEvent is NULL, the function is\r
545 a blocking operation. It will return after the releasing process\r
546 finishes, or aborted by user.\r
547\r
548 @param[in] This The pointer to the Dhcp6 protocol.\r
549 @param[in] AddressCount The number of releasing addresses.\r
550 @param[in] Addresses The pointer to the buffer stored the releasing\r
551 addresses.\r
552 @retval EFI_SUCCESS The DHCPv6 release exchange process has\r
553 completed when EFI_DHCP6_CONFIG_DATA.IaInfoEvent\r
554 is NULL. The Dhcp6 instance has sent Release\r
555 packet when EFI_DHCP6_CONFIG_DATA.IaInfoEvent\r
556 is not NULL.\r
557 @retval EFI_ACCESS_DENIED The Dhcp6 instance hasn't been configured, or the\r
558 state of the configured IA is not in Dhcp6Bound.\r
559 @retval EFI_ABORTED The DHCPv6 release exchange process was aborted by the user.\r
560 @retval EFI_NOT_FOUND Any specified IPv6 address is not correlated with\r
561 the configured IA for this instance.\r
562 @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
563 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
564\r
565**/\r
566EFI_STATUS\r
567EFIAPI\r
568EfiDhcp6Release (\r
569 IN EFI_DHCP6_PROTOCOL *This,\r
570 IN UINT32 AddressCount,\r
571 IN EFI_IPv6_ADDRESS *Addresses\r
572 );\r
573\r
574/**\r
575 Parse the option data in the Dhcp6 packet.\r
576\r
577 The Parse() function is used to retrieve the option list in the DHCPv6 packet.\r
578\r
579 @param[in] This The pointer to the Dhcp6 protocol.\r
580 @param[in] Packet The pointer to the Dhcp6 packet.\r
581 @param[in, out] OptionCount The number of option in the packet.\r
582 @param[out] PacketOptionList The array of pointers to the each option in the packet.\r
583\r
584 @retval EFI_SUCCESS The packet was successfully parsed.\r
585 @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
586 @retval EFI_BUFFER_TOO_SMALL *OptionCount is smaller than the number of options\r
587 that were found in the Packet.\r
588\r
589**/\r
590EFI_STATUS\r
591EFIAPI\r
592EfiDhcp6Parse (\r
593 IN EFI_DHCP6_PROTOCOL *This,\r
594 IN EFI_DHCP6_PACKET *Packet,\r
595 IN OUT UINT32 *OptionCount,\r
596 OUT EFI_DHCP6_PACKET_OPTION *PacketOptionList[] OPTIONAL\r
597 );\r
598\r
599#endif\r