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