TianoCore EDK2 master
|
#include "Dhcp6Impl.h"
Go to the source code of this file.
Dhcp6 internal functions implementation.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Dhcp6Io.c.
EFI_STATUS EFIAPI Dhcp6CallbackUser | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_EVENT | Event, | ||
IN OUT EFI_DHCP6_PACKET ** | Packet | ||
) |
Callback to user when Dhcp6 transmit/receive occurs.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | Event | The current Dhcp6 event. |
[in,out] | Packet | The pointer to the packet sending or received. |
EFI_SUCCESS | The user function returns success. |
EFI_NOT_READY | Direct the caller to continue collecting the offer. |
EFI_ABORTED | The user function ask it to abort. |
VOID Dhcp6CleanupRetry | ( | IN DHCP6_INSTANCE * | Instance, |
IN UINT32 | Scope | ||
) |
VOID Dhcp6CleanupSession | ( | IN OUT DHCP6_INSTANCE * | Instance, |
IN EFI_STATUS | Status | ||
) |
EFI_STATUS Dhcp6DequeueRetry | ( | IN DHCP6_INSTANCE * | Instance, |
IN UINT32 | PacketXid, | ||
IN BOOLEAN | NeedSignal | ||
) |
Dequeue the packet from retry list if reply received or timeout at last.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | PacketXid | The packet transaction id to match. |
[in] | NeedSignal | If TRUE, then an timeout event need be signaled when it is existed. Otherwise, this parameter is ignored. |
EFI_SUCCESS | Successfully dequeued the packet into retry list . |
EFI_NOT_FOUND | There is no xid matched in retry list. |
EFI_STATUS Dhcp6EnqueueRetry | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_PACKET * | Packet, | ||
IN UINT16 * | Elapsed, | ||
IN EFI_DHCP6_RETRANSMISSION *RetryCtl | OPTIONAL | ||
) |
Enqueue the packet into the retry list in case of timeout.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | Packet | The pointer to the Dhcp6 packet to retry. |
[in] | Elapsed | The pointer to the elapsed time value in the packet. |
[in] | RetryCtl | The pointer to the transmission control of the packet. This parameter is optional and may be NULL. |
EFI_SUCCESS | Successfully enqueued the packet into the retry list according to its message type. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected message type. |
EFI_STATUS Dhcp6HandleAdvertiseMsg | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_PACKET * | Packet | ||
) |
Handle with the Dhcp6 advertisement message.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | Packet | The pointer to the Dhcp6 advertisement message. |
EFI_SUCCESS | Processed the advertisement message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected error. |
Others | Failed to process the advertise message. |
EFI_STATUS Dhcp6HandleReplyMsg | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_PACKET * | Packet | ||
) |
Handle with the Dhcp6 reply message.
[in] | Instance | The pointer to Dhcp6 instance. |
[in] | Packet | The pointer to the Dhcp6 reply message. |
EFI_SUCCESS | Processed the reply message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected error. |
Others | Failed to process the reply message. |
VOID Dhcp6HandleStateful | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_PACKET * | Packet | ||
) |
VOID Dhcp6HandleStateless | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_PACKET * | Packet | ||
) |
EFI_STATUS Dhcp6InitSolicitMsg | ( | IN DHCP6_INSTANCE * | Instance | ) |
Configure some parameter to initiate SolicitMsg.
[in] | Instance | The pointer to the Dhcp6 instance. |
EFI_SUCCESS | Created and sent the solicit message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
Others | Failed to send the solicit message. |
BOOLEAN Dhcp6IsValidTxCb | ( | IN DHCP6_INSTANCE * | Instance, |
IN DHCP6_TX_CB * | TxCb | ||
) |
Check whether the TxCb is still a valid control block in the instance's retry list.
[in] | Instance | The pointer to DHCP6_INSTANCE. |
[in] | TxCb | The control block for a transmitted message. |
TRUE | The control block is in Instance's retry list. |
FALSE | The control block is NOT in Instance's retry list. |
BOOLEAN Dhcp6LinkMovDetect | ( | IN DHCP6_INSTANCE * | Instance | ) |
Detect Link movement for specified network device.
This routine will try to invoke Snp->GetStatus() to get the media status. If media present status switches from unpresent to present, a link movement is detected. Note that the underlying UNDI driver may not support reporting media status from GET_STATUS command. If that, fail to detect link movement.
[in] | Instance | The pointer to DHCP6_INSTANCE. |
TRUE | A link movement is detected. |
FALSE | A link movement is not detected. |
VOID EFIAPI Dhcp6ReceivePacket | ( | IN NET_BUF * | Udp6Wrap, |
IN UDP_END_POINT * | EndPoint, | ||
IN EFI_STATUS | IoStatus, | ||
IN VOID * | Context | ||
) |
The receive callback function for Dhcp6 exchange process.
[in] | Udp6Wrap | The pointer to the received net buffer. |
[in] | EndPoint | The pointer to the udp end point. |
[in] | IoStatus | The return status from udp io. |
[in] | Context | The opaque parameter to the function. |
EFI_STATUS Dhcp6SeekInnerOptionSafe | ( | IN UINT16 | IaType, |
IN UINT8 * | Option, | ||
IN UINT32 | OptionLen, | ||
OUT UINT8 ** | IaInnerOpt, | ||
OUT UINT16 * | IaInnerLen | ||
) |
Seeks the Inner Options from a DHCP6 Option
[in] | IaType | The type of the IA option. |
[in] | Option | The pointer to the DHCP6 Option. |
[in] | OptionLen | The length of the DHCP6 Option. |
[out] | IaInnerOpt | The pointer to the IA inner option. |
[out] | IaInnerLen | The length of the IA inner option. |
EFI_SUCCESS | Seek the inner option successfully. |
EFI_DEVICE_ERROR | The OptionLen is invalid. On Error, the pointers are not modified |
EFI_STATUS Dhcp6SeekStsOption | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_PACKET * | Packet, | ||
OUT UINT8 ** | Option | ||
) |
Seek StatusCode Option in package. A Status Code option may appear in the options field of a DHCP message and/or in the options field of another option. See details in section 22.13, RFC3315.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | Packet | The pointer to reply messages. |
[out] | Option | The pointer to status code option. |
EFI_SUCCESS | Seek status code option successfully. |
EFI_DEVICE_ERROR | An unexpected error. |
EFI_STATUS Dhcp6SelectAdvertiseMsg | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_PACKET * | AdSelect | ||
) |
Select the appointed Dhcp6 advertisement message.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | AdSelect | The pointer to the selected Dhcp6 advertisement message. |
EFI_SUCCESS | Selected the right advertisement message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
Others | Failed to select the advertise message. |
EFI_STATUS Dhcp6SendConfirmMsg | ( | IN DHCP6_INSTANCE * | Instance | ) |
Create the Confirm message and send it.
[in] | Instance | The pointer to the Dhcp6 instance. |
EFI_SUCCESS | Created and sent the confirm message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected error. |
Others | Failed to send the confirm message. |
EFI_STATUS Dhcp6SendDeclineMsg | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_IA * | DecIa | ||
) |
Create the decline message and send it.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | DecIa | The pointer to the decline Ia. |
EFI_SUCCESS | Created and sent the decline message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected error. |
Others | Failed to send the decline message. |
EFI_STATUS Dhcp6SendInfoRequestMsg | ( | IN DHCP6_INSTANCE * | Instance, |
IN DHCP6_INF_CB * | InfCb, | ||
IN BOOLEAN | SendClientId, | ||
IN EFI_DHCP6_PACKET_OPTION * | OptionRequest, | ||
IN UINT32 | OptionCount, | ||
IN EFI_DHCP6_PACKET_OPTION * | OptionList[], | ||
IN EFI_DHCP6_RETRANSMISSION * | Retransmission | ||
) |
Create the information request message and send it.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | InfCb | The pointer to the information request control block. |
[in] | SendClientId | If TRUE, the client identifier option will be included in information request message. Otherwise, the client identifier option will not be included. |
[in] | OptionRequest | The pointer to the option request option. |
[in] | OptionCount | The number options in the OptionList. |
[in] | OptionList | The array pointers to the appended options. |
[in] | Retransmission | The pointer to the retransmission control. |
EFI_SUCCESS | Created and sent the info-request message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
Others | Failed to send the info-request message. |
EFI_STATUS Dhcp6SendReleaseMsg | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_IA * | RelIa | ||
) |
Create the release message and send it.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | RelIa | The pointer to the release Ia. |
EFI_SUCCESS | Created and sent the release message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected error. |
Others | Failed to send the release message. |
EFI_STATUS Dhcp6SendRenewRebindMsg | ( | IN DHCP6_INSTANCE * | Instance, |
IN BOOLEAN | RebindRequest | ||
) |
Create the renew/rebind message and send it.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | RebindRequest | If TRUE, it is a Rebind type message. Otherwise, it is a Renew type message. |
EFI_SUCCESS | Created and sent the renew/rebind message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected error. |
Others | Failed to send the renew/rebind message. |
EFI_STATUS Dhcp6SendRequestMsg | ( | IN DHCP6_INSTANCE * | Instance | ) |
Create the request message and send it.
[in] | Instance | The pointer to the Dhcp6 instance. |
EFI_SUCCESS | Created and sent the request message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_DEVICE_ERROR | An unexpected error. |
Others | Failed to send the request message. |
EFI_STATUS Dhcp6SendSolicitMsg | ( | IN DHCP6_INSTANCE * | Instance | ) |
Create the solicit message and send it.
[in] | Instance | The pointer to the Dhcp6 instance. |
EFI_SUCCESS | Created and sent the solicit message successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
Others | Failed to send the solicit message. |
EFI_STATUS Dhcp6StartInfoRequest | ( | IN DHCP6_INSTANCE * | Instance, |
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 | ||
) |
Start the information request process.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | SendClientId | If TRUE, the client identifier option will be included in information request message. Otherwise, the client identifier option will not be included. |
[in] | OptionRequest | The pointer to the option request option. |
[in] | OptionCount | The number options in the OptionList. |
[in] | OptionList | The array pointers to the appended options. |
[in] | Retransmission | The pointer to the retransmission control. |
[in] | TimeoutEvent | The event of timeout. |
[in] | ReplyCallback | The callback function when the reply was received. |
[in] | CallbackContext | The pointer to the parameter passed to the callback. |
EFI_SUCCESS | Start the info-request process successfully. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
EFI_NO_MAPPING | No source address is available for use. |
Others | Failed to start the info-request process. |
EFI_STATUS Dhcp6TransmitPacket | ( | IN DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_PACKET * | Packet, | ||
IN UINT16 * | Elapsed | ||
) |
Transmit Dhcp6 message by udpio.
[in] | Instance | The pointer to the Dhcp6 instance. |
[in] | Packet | The pointer to transmit message. |
[in] | Elapsed | The pointer to the elapsed time value to fill in. |
EFI_SUCCESS | Successfully transmitted the packet. |
EFI_OUT_OF_RESOURCES | Required system resources could not be allocated. |
Others | Failed to transmit the packet. |
EFI_STATUS Dhcp6UpdateIaInfo | ( | IN OUT DHCP6_INSTANCE * | Instance, |
IN EFI_DHCP6_PACKET * | Packet | ||
) |