TianoCore EDK2 master
|
#include "PxeBcImpl.h"
Go to the source code of this file.
Variables | |
EFI_IPv6_ADDRESS | mAllDhcpRelayAndServersAddress |
Functions implementation related with DHCPv6 for UefiPxeBc Driver.
(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 PxeBcDhcp6.c.
UINT32 PxeBcBuildDhcp6Options | ( | IN PXEBC_PRIVATE_DATA * | Private, |
OUT EFI_DHCP6_PACKET_OPTION ** | OptList, | ||
IN UINT8 * | Buffer | ||
) |
Build the options buffer for the DHCPv6 request packet.
[in] | Private | The pointer to PxeBc private data. |
[out] | OptList | The pointer to the option pointer array. |
[in] | Buffer | The pointer to the buffer to contain the option list. |
Definition at line 73 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcCacheDhcp6Offer | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN EFI_DHCP6_PACKET * | RcvdOffer | ||
) |
Cache all the received DHCPv6 offers, and set OfferIndex and OfferCount.
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
[in] | RcvdOffer | The pointer to the received offer packet. |
EFI_SUCCESS | Cache and parse the packet successfully. |
Others | Operation failed. |
Definition at line 1171 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcCacheDhcp6Packet | ( | IN EFI_DHCP6_PACKET * | Dst, |
IN EFI_DHCP6_PACKET * | Src | ||
) |
Cache the DHCPv6 packet.
[in] | Dst | The pointer to the cache buffer for DHCPv6 packet. |
[in] | Src | The pointer to the DHCPv6 packet to be cached. |
EFI_SUCCESS | Packet is copied. |
EFI_BUFFER_TOO_SMALL | Cache buffer is not big enough to hold the packet. |
Definition at line 183 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcCacheDnsServerAddresses | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN PXEBC_DHCP6_PACKET_CACHE * | Cache6 | ||
) |
Cache the DHCPv6 DNS Server addresses
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
[in] | Cache6 | The pointer to PXEBC_DHCP6_PACKET_CACHE. |
EFI_SUCCESS | Cache the DHCPv6 DNS Server address successfully. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources. |
EFI_DEVICE_ERROR | The DNS Server Address Length provided by a untrusted option is not a multiple of 16 bytes (sizeof (EFI_IPv6_ADDRESS)). |
Definition at line 1356 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcCheckRouteTable | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN UINTN | TimeOutInSecond, | ||
OUT EFI_IPv6_ADDRESS * | GatewayAddr | ||
) |
Check whether IP driver could route the message which will be sent to ServerIp address.
This function will check the IP6 route table every 1 seconds until specified timeout is expired, if a valid route is found in IP6 route table, the address will be filed in GatewayAddr and return.
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
[in] | TimeOutInSecond | Timeout value in seconds. |
[out] | GatewayAddr | Pointer to store the gateway IP address. |
EFI_SUCCESS | Found a valid gateway address successfully. |
EFI_TIMEOUT | The operation is time out. |
Other | Unexpected error happened. |
Definition at line 1575 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcCopyDhcp6Ack | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN EFI_DHCP6_PACKET * | Ack, | ||
IN BOOLEAN | Verified | ||
) |
Cache the DHCPv6 ack packet, and parse it on demand.
[in] | Private | The pointer to PxeBc private data. |
[in] | Ack | The pointer to the DHCPv6 ack packet. |
[in] | Verified | If TRUE, parse the ACK packet and store info into mode data. |
EFI_SUCCESS | Cache and parse the packet successfully. |
EFI_BUFFER_TOO_SMALL | Cache buffer is not big enough to hold the packet. |
Definition at line 742 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcCopyDhcp6Proxy | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN UINT32 | OfferIndex | ||
) |
Cache the DHCPv6 proxy offer packet according to the received order.
[in] | Private | The pointer to PxeBc private data. |
[in] | OfferIndex | The received order of offer packets. |
EFI_SUCCESS | Cache and parse the packet successfully. |
EFI_BUFFER_TOO_SMALL | Cache buffer is not big enough to hold the packet. |
Definition at line 781 of file PxeBcDhcp6.c.
EFI_STATUS EFIAPI PxeBcDhcp6CallBack | ( | 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 driver to intercept events that occurred in the configuration process.
[in] | This | The pointer to the EFI DHCPv6 Protocol. |
[in] | Context | The pointer to the context set by EFI_DHCP6_PROTOCOL.Configure(). |
[in] | CurrentState | The current operational state of the EFI DHCPv Protocol driver. |
[in] | Dhcp6Event | The event that occurs in the current state, which usually means a state transition. |
[in] | Packet | The DHCPv6 packet that is going to be sent or was already received. |
[out] | NewPacket | The packet that is used to replace the Packet above. |
EFI_SUCCESS | Told the EFI DHCPv6 Protocol driver to continue the DHCP process. |
EFI_NOT_READY | Only used in the Dhcp6Selecting state. The EFI DHCPv6 Protocol driver will continue to wait for more packets. |
EFI_ABORTED | Told the EFI DHCPv6 Protocol driver to abort the current process. |
Definition at line 1986 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcDhcp6Discover | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN UINT16 | Type, | ||
IN UINT16 * | Layer, | ||
IN BOOLEAN | UseBis, | ||
IN EFI_IP_ADDRESS * | DestIp | ||
) |
Build and send out the request packet for the bootfile, and parse the reply.
[in] | Private | The pointer to PxeBc private data. |
[in] | Type | PxeBc option boot item type. |
[in] | Layer | The pointer to option boot item layer. |
[in] | UseBis | Use BIS or not. |
[in] | DestIp | The pointer to the server address. |
EFI_SUCCESS | Successfully discovered the boot file. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources. |
EFI_NOT_FOUND | Can't get the PXE reply packet. |
Others | Failed to discover the boot file. |
Definition at line 2161 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcDhcp6Sarr | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN EFI_DHCP6_PROTOCOL * | Dhcp6 | ||
) |
Start the DHCPv6 S.A.R.R. process to acquire the IPv6 address and other PXE boot information.
[in] | Private | The pointer to PxeBc private data. |
[in] | Dhcp6 | The pointer to the EFI_DHCP6_PROTOCOL |
EFI_SUCCESS | The S.A.R.R. process successfully finished. |
Others | Failed to finish the S.A.R.R. process. |
Definition at line 2335 of file PxeBcDhcp6.c.
Seek the address of the first byte of the option header.
[in] | Buf | The pointer to the buffer. |
[in] | SeekLen | The length to seek. |
[in] | OptType | The option type. |
NULL | If it failed to seek the option. |
others | The position to the option. |
Definition at line 827 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcDns6 | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN CHAR16 * | HostName, | ||
OUT EFI_IPv6_ADDRESS * | IpAddress | ||
) |
Retrieve the boot server address using the EFI_DNS6_PROTOCOL.
[in] | Private | Pointer to PxeBc private data. |
[in] | HostName | Pointer to buffer containing hostname. |
[out] | IpAddress | On output, pointer to buffer containing IPv6 address. |
EFI_SUCCESS | Operation succeeded. |
EFI_OUT_OF_RESOURCES | Failed to allocate needed resources. |
EFI_DEVICE_ERROR | An unexpected network error occurred. |
Others | Other errors as indicated. |
Definition at line 212 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcExtractBootFileParam | ( | IN CHAR8 * | BootFilePara, |
OUT UINT16 * | BootFileSize | ||
) |
Parse the Boot File Parameter option.
[in] | BootFilePara | The pointer to boot file parameter option data. |
[out] | BootFileSize | The pointer to the parsed boot file size. |
EFI_SUCCESS | Successfully obtained the boot file size from parameter option. |
EFI_NOT_FOUND | Failed to extract the boot file size from parameter option. |
Definition at line 580 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcExtractBootFileUrl | ( | IN PXEBC_PRIVATE_DATA * | Private, |
OUT UINT8 ** | FileName, | ||
IN OUT EFI_IPv6_ADDRESS * | SrvAddr, | ||
IN CHAR8 * | BootFile, | ||
IN UINT16 | Length | ||
) |
Parse the Boot File URL option.
[in] | Private | Pointer to PxeBc private data. |
[out] | FileName | The pointer to the boot file name. |
[in,out] | SrvAddr | The pointer to the boot server address. |
[in] | BootFile | The pointer to the boot file URL option data. |
[in] | Length | The length of the boot file URL option data. |
EFI_ABORTED | User cancel operation. |
EFI_SUCCESS | Selected the boot menu successfully. |
EFI_NOT_READY | Read the input key from the keyboard has not finish. |
Definition at line 380 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcHandleDhcp6Offer | ( | IN PXEBC_PRIVATE_DATA * | Private | ) |
Handle the DHCPv6 offer packet.
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
EFI_SUCCESS | Handled the DHCPv6 offer packet successfully. |
EFI_NO_RESPONSE | No response to the following request packet. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources. |
EFI_BUFFER_TOO_SMALL | Can't cache the offer pacet. |
Definition at line 1415 of file PxeBcDhcp6.c.
EFI_DHCP6_PACKET_OPTION * PxeBcParseDhcp6Options | ( | IN UINT8 * | Buffer, |
IN UINT32 | Length, | ||
IN UINT16 | OptTag | ||
) |
Parse out a DHCPv6 option by OptTag, and find the position in buffer.
[in] | Buffer | The pointer to the option buffer. |
[in] | Length | Length of the option buffer. |
[in] | OptTag | The required option tag. |
NULL | Failed to parse the required option. |
Others | The position of the required option in buffer. |
Definition at line 35 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcParseDhcp6Packet | ( | IN PXEBC_DHCP6_PACKET_CACHE * | Cache6 | ) |
Parse the cached DHCPv6 packet, including all the options.
[in] | Cache6 | The pointer to a cached DHCPv6 packet. |
EFI_SUCCESS | Parsed the DHCPv6 packet successfully. |
EFI_DEVICE_ERROR | Failed to parse and invalid the packet. |
Definition at line 632 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcRegisterIp6Address | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN EFI_IPv6_ADDRESS * | Address | ||
) |
Register the ready station address and gateway by Ip6Config protocol.
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
[in] | Address | The pointer to the ready address. |
EFI_SUCCESS | Registered the address successfully. |
Others | Failed to register the address. |
Definition at line 1696 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcRequestBootService | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN UINT32 | Index | ||
) |
Build and send out the request packet for the bootfile, and parse the reply.
[in] | Private | The pointer to PxeBc private data. |
[in] | Index | PxeBc option boot item type. |
EFI_SUCCESS | Successfully discovered the boot file. |
EFI_OUT_OF_RESOURCES | Failed to allocate resources. |
EFI_NOT_FOUND | Can't get the PXE reply packet. |
Others | Failed to discover the boot file. |
Definition at line 868 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcRetryDhcp6Binl | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN UINT32 | Index | ||
) |
Retry to request bootfile name by the BINL offer.
[in] | Private | The pointer to PxeBc private data. |
[in] | Index | The received order of offer packets. |
EFI_SUCCESS | Successfully retried a request for the bootfile name. |
EFI_DEVICE_ERROR | Failed to retry the bootfile name. |
Definition at line 1080 of file PxeBcDhcp6.c.
VOID PxeBcSelectDhcp6Offer | ( | IN PXEBC_PRIVATE_DATA * | Private | ) |
Select an DHCPv6 offer, and record SelectIndex and SelectProxyType.
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
Definition at line 1249 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcSetIp6Address | ( | IN PXEBC_PRIVATE_DATA * | Private | ) |
This function will register the station IP address and flush IP instance to start using the new IP address.
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
EFI_SUCCESS | The new IP address has been configured successfully. |
Others | Failed to configure the address. |
Definition at line 1935 of file PxeBcDhcp6.c.
EFI_STATUS PxeBcSetIp6Policy | ( | IN PXEBC_PRIVATE_DATA * | Private | ) |
Set the IP6 policy to Automatic.
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
EFI_SUCCESS | Switch the IP policy successfully. |
Others | Unexpected error happened. |
Definition at line 1881 of file PxeBcDhcp6.c.
VOID PxeBcUnregisterIp6Address | ( | IN PXEBC_PRIVATE_DATA * | Private | ) |
Unregister the address by Ip6Config protocol.
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
Definition at line 1547 of file PxeBcDhcp6.c.
EFI_IPv6_ADDRESS mAllDhcpRelayAndServersAddress |
Definition at line 19 of file PxeBcDhcp6.c.