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