TianoCore EDK2 master
|
#include "PxeBcImpl.h"
Go to the source code of this file.
Variables | |
UINT8 | mInterestedDhcp4Tags [PXEBC_DHCP4_TAG_INDEX_MAX] |
UINT32 | mPxeDhcpTimeout [4] = { 4, 8, 16, 32 } |
Functions implementation related with DHCPv4 for UefiPxeBc Driver.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PxeBcDhcp4.c.
UINT32 PxeBcBuildDhcp4Options | ( | IN PXEBC_PRIVATE_DATA * | Private, |
OUT EFI_DHCP4_PACKET_OPTION ** | OptList, | ||
IN UINT8 * | Buffer, | ||
IN BOOLEAN | NeedMsgType | ||
) |
Build the options buffer for the DHCPv4 request packet.
[in] | Private | Pointer to PxeBc private data. |
[out] | OptList | Pointer to the option pointer array. |
[in] | Buffer | Pointer to the buffer to contain the option list. |
[in] | NeedMsgType | If TRUE, it is necessary to include the Msg type option. Otherwise, it is not necessary. |
Definition at line 217 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcCacheDhcp4Offer | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN EFI_DHCP4_PACKET * | RcvdOffer | ||
) |
Cache all the received DHCPv4 offers, and set OfferIndex and OfferCount.
[in] | Private | Pointer to PxeBc private data. |
[in] | RcvdOffer | Pointer to the received offer packet. |
EFI_SUCCESS | Cache and parse the packet successfully. |
Others | Operation failed. |
Definition at line 801 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcCacheDhcp4Packet | ( | IN EFI_DHCP4_PACKET * | Dst, |
IN EFI_DHCP4_PACKET * | Src | ||
) |
Cache the DHCPv4 packet.
[in] | Dst | Pointer to the cache buffer for DHCPv4 packet. |
[in] | Src | Pointer to the DHCPv4 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 420 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcCopyDhcp4Ack | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN EFI_DHCP4_PACKET * | Ack, | ||
IN BOOLEAN | Verified | ||
) |
Cache the DHCPv4 ack packet, and parse it on demand.
[in] | Private | Pointer to PxeBc private data. |
[in] | Ack | Pointer to the DHCPv4 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 622 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcCopyProxyOffer | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN UINT32 | OfferIndex | ||
) |
Cache the DHCPv4 proxy offer packet according to the received order.
[in] | Private | 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 661 of file PxeBcDhcp4.c.
EFI_STATUS EFIAPI PxeBcDhcp4CallBack | ( | IN EFI_DHCP4_PROTOCOL * | This, |
IN VOID * | Context, | ||
IN EFI_DHCP4_STATE | CurrentState, | ||
IN EFI_DHCP4_EVENT | Dhcp4Event, | ||
IN EFI_DHCP4_PACKET *Packet | OPTIONAL, | ||
OUT EFI_DHCP4_PACKET **NewPacket | OPTIONAL | ||
) |
EFI_DHCP4_CALLBACK is provided by the consumer of the EFI DHCPv4 Protocol driver to intercept events that occurred in the configuration process.
[in] | This | Pointer to the EFI DHCPv4 Protocol. |
[in] | Context | Pointer to the context set by EFI_DHCP4_PROTOCOL.Configure(). |
[in] | CurrentState | The current operational state of the EFI DHCPv4 Protocol driver. |
[in] | Dhcp4Event | The event that occurs in the current state, which usually means a state transition. |
[in] | Packet | The DHCPv4 packet that is going to be sent or already received. |
[out] | NewPacket | The packet that is used to replace the above Packet. |
EFI_SUCCESS | Tells the EFI DHCPv4 Protocol driver to continue the DHCP process. |
EFI_NOT_READY | Only used in the Dhcp4Selecting state. The EFI DHCPv4 Protocol driver will continue to wait for more DHCPOFFER packets until the retry timeout expires. |
EFI_ABORTED | Tells the EFI DHCPv4 Protocol driver to abort the current process and return to the Dhcp4Init or Dhcp4InitReboot state. |
Definition at line 1174 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcDhcp4Discover | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN UINT16 | Type, | ||
IN UINT16 * | Layer, | ||
IN BOOLEAN | UseBis, | ||
IN EFI_IP_ADDRESS * | DestIp, | ||
IN UINT16 | IpCount, | ||
IN EFI_PXE_BASE_CODE_SRVLIST * | SrvList | ||
) |
Build and send out the request packet for the bootfile, and parse the reply.
[in] | Private | Pointer to PxeBc private data. |
[in] | Type | PxeBc option boot item type. |
[in] | Layer | Pointer to option boot item layer. |
[in] | UseBis | Use BIS or not. |
[in] | DestIp | Pointer to the server address. |
[in] | IpCount | The total count of the server address. |
[in] | SrvList | Pointer to EFI_PXE_BASE_CODE_SRVLIST. |
EFI_SUCCESS | Successfully discovered boot file. |
EFI_OUT_OF_RESOURCES | Failed to allocate resource. |
EFI_NOT_FOUND | Can't get the PXE reply packet. |
Others | Failed to discover boot file. |
Definition at line 1355 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcDhcp4Dora | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN EFI_DHCP4_PROTOCOL * | Dhcp4 | ||
) |
Start the D.O.R.A DHCPv4 process to acquire the IPv4 address and other PXE boot information.
[in] | Private | Pointer to PxeBc private data. |
[in] | Dhcp4 | Pointer to the EFI_DHCP4_PROTOCOL |
EFI_SUCCESS | The D.O.R.A process successfully finished. |
Others | Failed to finish the D.O.R.A process. |
Definition at line 1657 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcHandleDhcp4Offer | ( | IN PXEBC_PRIVATE_DATA * | Private | ) |
Handle the DHCPv4 offer packet.
[in] | Private | Pointer to PxeBc private data. |
EFI_SUCCESS | Handled the DHCPv4 offer packet successfully. |
EFI_NO_RESPONSE | No response to the following request packet. |
EFI_NOT_FOUND | No boot filename received. |
EFI_BUFFER_TOO_SMALL | Can't cache the offer pacet. |
Definition at line 1013 of file PxeBcDhcp4.c.
EFI_DHCP4_PACKET_OPTION * PxeBcParseDhcp4Options | ( | IN UINT8 * | Buffer, |
IN UINT32 | Length, | ||
IN UINT8 | OptTag | ||
) |
Parse a certain dhcp4 option by OptTag in Buffer, and return with start pointer.
[in] | Buffer | Pointer to the option buffer. |
[in] | Length | Length of the option buffer. |
[in] | OptTag | Tag of the required option. |
NULL | Failed to find the required option. |
Others | The position of the required option. |
Definition at line 42 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcParseDhcp4Packet | ( | IN PXEBC_DHCP4_PACKET_CACHE * | Cache4 | ) |
Parse the cached DHCPv4 packet, including all the options.
[in] | Cache4 | Pointer to cached DHCPv4 packet. |
EFI_SUCCESS | Parsed the DHCPv4 packet successfully. |
EFI_DEVICE_ERROR | Failed to parse and invalid packet. |
Definition at line 445 of file PxeBcDhcp4.c.
VOID PxeBcParseVendorOptions | ( | IN EFI_DHCP4_PACKET_OPTION * | Dhcp4Option, |
IN PXEBC_VENDOR_OPTION * | VendorOption | ||
) |
Parse the PXE vendor options and extract the information from them.
[in] | Dhcp4Option | Pointer to vendor options in buffer. |
[in] | VendorOption | Pointer to structure to store information in vendor options. |
Definition at line 85 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcRetryBinlOffer | ( | IN PXEBC_PRIVATE_DATA * | Private, |
IN UINT32 | Index | ||
) |
Retry to request bootfile name by the BINL offer.
[in] | Private | Pointer to PxeBc private data. |
[in] | Index | The received order of offer packets. |
EFI_SUCCESS | Successfully retried to request bootfile name. |
EFI_DEVICE_ERROR | Failed to retry bootfile name. |
Definition at line 706 of file PxeBcDhcp4.c.
VOID PxeBcSeedDhcp4Packet | ( | OUT EFI_DHCP4_PACKET * | Seed, |
IN EFI_UDP4_PROTOCOL * | Udp4 | ||
) |
Create a template DHCPv4 packet as a seed.
[out] | Seed | Pointer to the seed packet. |
[in] | Udp4 | Pointer to EFI_UDP4_PROTOCOL. |
Definition at line 383 of file PxeBcDhcp4.c.
VOID PxeBcSelectDhcp4Offer | ( | IN PXEBC_PRIVATE_DATA * | Private | ) |
Select an DHCPv4 offer, and record SelectIndex and SelectProxyType.
[in] | Private | Pointer to PxeBc private data. |
Definition at line 892 of file PxeBcDhcp4.c.
EFI_STATUS PxeBcSetIp4Policy | ( | IN PXEBC_PRIVATE_DATA * | Private | ) |
Switch the Ip4 policy to static.
[in] | Private | The pointer to PXEBC_PRIVATE_DATA. |
EFI_SUCCESS | The policy is already configured to static. |
Others | Other error as indicated.. |
Definition at line 1609 of file PxeBcDhcp4.c.
UINT8 mInterestedDhcp4Tags[PXEBC_DHCP4_TAG_INDEX_MAX] |
Definition at line 15 of file PxeBcDhcp4.c.
UINT32 mPxeDhcpTimeout[4] = { 4, 8, 16, 32 } |
Definition at line 28 of file PxeBcDhcp4.c.