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