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