TianoCore EDK2 master
|
#include "PxeBcImpl.h"
Go to the source code of this file.
Variables | |
EFI_PXE_BASE_CODE_PROTOCOL | gPxeBcProtocolTemplate |
EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL | gPxeBcCallBackTemplate |
EFI_LOAD_FILE_PROTOCOL | gLoadFileProtocolTemplate = { EfiPxeLoadFile } |
This implementation of EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcArp | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN EFI_IP_ADDRESS * | IpAddr, | ||
IN EFI_MAC_ADDRESS *MacAddr | OPTIONAL | ||
) |
Uses the ARP protocol to resolve a MAC address. It is not supported for IPv6.
This function uses the ARP protocol to resolve a MAC address. The IP address specified by IpAddr is used to resolve a MAC address. If the ARP protocol succeeds in resolving the specified address, then the ArpCacheEntries and ArpCache fields of the mode data are updated, and EFI_SUCCESS is returned. If MacAddr is not NULL, the resolved MAC address is placed there as well. If the PXE Base Code protocol is in the stopped state, then EFI_NOT_STARTED is returned. If the ARP protocol encounters a timeout condition while attempting to resolve an address, then EFI_TIMEOUT is returned. If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED is returned.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | IpAddr | Pointer to the IP address that is used to resolve a MAC address. |
[in] | MacAddr | If not NULL, a pointer to the MAC address that was resolved with the ARP protocol. |
EFI_SUCCESS | The IP or MAC address was resolved. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_DEVICE_ERROR | The network device encountered an error during this operation. |
EFI_ICMP_ERROR | An error occur with the ICMP packet message. |
Definition at line 1797 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcDhcp | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN BOOLEAN | SortOffers | ||
) |
Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6 S.A.R.R (solicit / advertise / request / reply) sequence.
If SortOffers is TRUE, then the cached DHCP offer packets will be sorted before they are tried. If SortOffers is FALSE, then the cached DHCP offer packets will be tried in the order in which they are received. Please see the Preboot Execution Environment (PXE) Specification and Unified Extensible Firmware Interface (UEFI) Specification for additional details on the implementation of DHCP. If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then the DHCP sequence will be stopped and EFI_ABORTED will be returned.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | SortOffers | TRUE if the offers received should be sorted. Set to FALSE to try the offers in the order that they are received. |
EFI_SUCCESS | Valid DHCP has completed. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | The This parameter is NULL or does not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure. |
EFI_DEVICE_ERROR | The network device encountered an error during this operation. |
EFI_OUT_OF_RESOURCES | Could not allocate enough memory to complete the DHCP Protocol. |
EFI_ABORTED | The callback function aborted the DHCP Protocol. |
EFI_TIMEOUT | The DHCP Protocol timed out. |
EFI_ICMP_ERROR | An ICMP error packet was received during the DHCP session. |
EFI_NO_RESPONSE | Valid PXE offer was not received. |
Definition at line 424 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcDiscover | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN UINT16 | Type, | ||
IN UINT16 * | Layer, | ||
IN BOOLEAN | UseBis, | ||
IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info | OPTIONAL | ||
) |
Attempts to complete the PXE Boot Server and/or boot image discovery sequence.
This function attempts to complete the PXE Boot Server and/or boot image discovery sequence. If this sequence is completed, then EFI_SUCCESS is returned, and the PxeDiscoverValid, PxeDiscover, PxeReplyReceived, and PxeReply fields of the EFI_PXE_BASE_CODE_MODE structure are filled in. If UseBis is TRUE, then the PxeBisReplyReceived and PxeBisReply fields of the EFI_PXE_BASE_CODE_MODE structure will also be filled in. If UseBis is FALSE, then PxeBisReplyValid will be set to FALSE. In the structure referenced by parameter Info, the PXE Boot Server list, SrvList[], has two uses: It is the Boot Server IP address list used for unicast discovery (if the UseUCast field is TRUE), and it is the list used for Boot Server verification (if the MustUseList field is TRUE). Also, if the MustUseList field in that structure is TRUE and the AcceptAnyResponse field in the SrvList[] array is TRUE, any Boot Server reply of that type will be accepted. If the AcceptAnyResponse field is FALSE, only responses from Boot Servers with matching IP addresses will be accepted. This function can take at least 10 seconds to timeout and return control to the caller. If the Discovery sequence does not complete, then EFI_TIMEOUT will be returned. Please see the Preboot Execution Environment (PXE) Specification for additional details on the implementation of the Discovery sequence. If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then the Discovery sequence is stopped and EFI_ABORTED will be returned.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | Type | The type of bootstrap to perform. |
[in] | Layer | Pointer to the boot server layer number to discover, which must be PXE_BOOT_LAYER_INITIAL when a new server type is being discovered. |
[in] | UseBis | TRUE if Boot Integrity Services are to be used. FALSE otherwise. |
[in] | Info | Pointer to a data structure that contains additional information on the type of discovery operation that is to be performed. It is optional. |
EFI_SUCCESS | The Discovery sequence has been completed. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_DEVICE_ERROR | The network device encountered an error during this operation. |
EFI_OUT_OF_RESOURCES | Could not allocate enough memory to complete Discovery. |
EFI_ABORTED | The callback function aborted the Discovery sequence. |
EFI_TIMEOUT | The Discovery sequence timed out. |
EFI_ICMP_ERROR | An ICMP error packet was received during the PXE discovery session. |
Definition at line 539 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcMtftp | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN EFI_PXE_BASE_CODE_TFTP_OPCODE | Operation, | ||
IN OUT VOID *BufferPtr | OPTIONAL, | ||
IN BOOLEAN | Overwrite, | ||
IN OUT UINT64 * | BufferSize, | ||
IN UINTN *BlockSize | OPTIONAL, | ||
IN EFI_IP_ADDRESS * | ServerIp, | ||
IN UINT8 * | Filename, | ||
IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info | OPTIONAL, | ||
IN BOOLEAN | DontUseBuffer | ||
) |
Used to perform TFTP and MTFTP services.
This function is used to perform TFTP and MTFTP services. This includes the TFTP operations to get the size of a file, read a directory, read a file, and write a file. It also includes the MTFTP operations to get the size of a file, read a directory, and read a file. The type of operation is specified by Operation. If the callback function that is invoked during the TFTP/MTFTP operation does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will be returned. For read operations, the return data will be placed in the buffer specified by BufferPtr. If BufferSize is too small to contain the entire downloaded file, then EFI_BUFFER_TOO_SMALL will be returned and BufferSize will be set to zero, or the size of the requested file. (NOTE: the size of the requested file is only returned if the TFTP server supports TFTP options). If BufferSize is large enough for the read operation, then BufferSize will be set to the size of the downloaded file, and EFI_SUCCESS will be returned. Applications using the PxeBc.Mtftp() services should use the get-file-size operations to determine the size of the downloaded file prior to using the read-file operations-especially when downloading large (greater than 64 MB) files-instead of making two calls to the read-file operation. Following this recommendation will save time if the file is larger than expected and the TFTP server does not support TFTP option extensions. Without TFTP option extension support, the client must download the entire file, counting and discarding the received packets, to determine the file size. For write operations, the data to be sent is in the buffer specified by BufferPtr. BufferSize specifies the number of bytes to send. If the write operation completes successfully, then EFI_SUCCESS will be returned. For TFTP "get file size" operations, the size of the requested file or directory is returned in BufferSize, and EFI_SUCCESS will be returned. If the TFTP server does not support options, the file will be downloaded into a bit bucket and the length of the downloaded file will be returned. For MTFTP "get file size" operations, if the MTFTP server does not support the "get file size" option, EFI_UNSUPPORTED will be returned. This function can take up to 10 seconds to timeout and return control to the caller. If the TFTP sequence does not complete, EFI_TIMEOUT will be returned. If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then the TFTP sequence is stopped and EFI_ABORTED will be returned.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | Operation | The type of operation to perform. |
[in,out] | BufferPtr | A pointer to the data buffer. |
[in] | Overwrite | Only used on write file operations. TRUE if a file on a remote server can be overwritten. |
[in,out] | BufferSize | For get-file-size operations, *BufferSize returns the size of the requested file. |
[in] | BlockSize | The requested block size to be used during a TFTP transfer. |
[in] | ServerIp | The TFTP / MTFTP server IP address. |
[in] | Filename | A Null-terminated ASCII string that specifies a directory name or a file name. |
[in] | Info | Pointer to the MTFTP information. |
[in] | DontUseBuffer | Set to FALSE for normal TFTP and MTFTP read file operation. |
EFI_SUCCESS | The TFTP/MTFTP operation was completed. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_DEVICE_ERROR | The network device encountered an error during this operation. |
EFI_BUFFER_TOO_SMALL | The buffer is not large enough to complete the read operation. |
EFI_ABORTED | The callback function aborted the TFTP/MTFTP operation. |
EFI_TIMEOUT | The TFTP/MTFTP operation timed out. |
EFI_ICMP_ERROR | An ICMP error packet was received during the MTFTP session. |
EFI_TFTP_ERROR | A TFTP error packet was received during the MTFTP session. |
Definition at line 834 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcSetIpFilter | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN EFI_PXE_BASE_CODE_IP_FILTER * | NewFilter | ||
) |
Updates the IP receive filters of a network device and enables software filtering.
The NewFilter field is used to modify the network device's current IP receive filter settings and to enable a software filter. This function updates the IpFilter field of the EFI_PXE_BASE_CODE_MODE structure with the contents of NewIpFilter. The software filter is used when the USE_FILTER in OpFlags is set to UdpRead(). The current hardware filter remains in effect no matter what the settings of OpFlags. This is so that the meaning of ANY_DEST_IP set in OpFlags to UdpRead() is from those packets whose reception is enabled in hardware-physical NIC address (unicast), broadcast address, logical address or addresses (multicast), or all (promiscuous). UdpRead() does not modify the IP filter settings. Dhcp(), Discover(), and Mtftp() set the IP filter, and return with the IP receive filter list emptied and the filter set to EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP. If an application or driver wishes to preserve the IP receive filter settings, it will have to preserve the IP receive filter settings before these calls, and use SetIpFilter() to restore them after the calls. If incompatible filtering is requested (for example, PROMISCUOUS with anything else), or if the device does not support a requested filter setting and it cannot be accommodated in software (for example, PROMISCUOUS not supported), EFI_INVALID_PARAMETER will be returned. The IPlist field is used to enable IPs other than the StationIP. They may be multicast or unicast. If IPcnt is set as well as EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP, then both the StationIP and the IPs from the IPlist will be used.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | NewFilter | Pointer to the new set of IP receive filters. |
EFI_SUCCESS | The IP receive filter settings were updated. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 1590 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcSetPackets | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN BOOLEAN *NewDhcpDiscoverValid | OPTIONAL, | ||
IN BOOLEAN *NewDhcpAckReceived | OPTIONAL, | ||
IN BOOLEAN *NewProxyOfferReceived | OPTIONAL, | ||
IN BOOLEAN *NewPxeDiscoverValid | OPTIONAL, | ||
IN BOOLEAN *NewPxeReplyReceived | OPTIONAL, | ||
IN BOOLEAN *NewPxeBisReplyReceived | OPTIONAL, | ||
IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover | OPTIONAL, | ||
IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck | OPTIONAL, | ||
IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer | OPTIONAL, | ||
IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover | OPTIONAL, | ||
IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply | OPTIONAL, | ||
IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply | OPTIONAL | ||
) |
Updates the contents of the cached DHCP and Discover packets.
The pointers to the new packets are used to update the contents of the cached packets in the EFI_PXE_BASE_CODE_MODE structure.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | NewDhcpDiscoverValid | Pointer to a value that will replace the current DhcpDiscoverValid field. |
[in] | NewDhcpAckReceived | Pointer to a value that will replace the current DhcpAckReceived field. |
[in] | NewProxyOfferReceived | Pointer to a value that will replace the current ProxyOfferReceived field. |
[in] | NewPxeDiscoverValid | Pointer to a value that will replace the current ProxyOfferReceived field. |
[in] | NewPxeReplyReceived | Pointer to a value that will replace the current PxeReplyReceived field. |
[in] | NewPxeBisReplyReceived | Pointer to a value that will replace the current PxeBisReplyReceived field. |
[in] | NewDhcpDiscover | Pointer to the new cached DHCP Discover packet contents. |
[in] | NewDhcpAck | Pointer to the new cached DHCP Ack packet contents. |
[in] | NewProxyOffer | Pointer to the new cached Proxy Offer packet contents. |
[in] | NewPxeDiscover | Pointer to the new cached PXE Discover packet contents. |
[in] | NewPxeReply | Pointer to the new cached PXE Reply packet contents. |
[in] | NewPxeBisReply | Pointer to the new cached PXE BIS Reply packet contents. |
EFI_SUCCESS | The cached packet contents were updated. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | This is NULL or does not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure. |
Definition at line 2129 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcSetParameters | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN BOOLEAN *NewAutoArp | OPTIONAL, | ||
IN BOOLEAN *NewSendGUID | OPTIONAL, | ||
IN UINT8 *NewTTL | OPTIONAL, | ||
IN UINT8 *NewToS | OPTIONAL, | ||
IN BOOLEAN *NewMakeCallback | OPTIONAL | ||
) |
Updates the parameters that affect the operation of the PXE Base Code Protocol.
This function sets parameters that affect the operation of the PXE Base Code Protocol. The parameter specified by NewAutoArp is used to control the generation of ARP protocol packets. If NewAutoArp is TRUE, then ARP Protocol packets will be generated as required by the PXE Base Code Protocol. If NewAutoArp is FALSE, then no ARP Protocol packets will be generated. In this case, the only mappings that are available are those stored in the ArpCache of the EFI_PXE_BASE_CODE_MODE structure. If there are not enough mappings in the ArpCache to perform a PXE Base Code Protocol service, then the service will fail. This function updates the AutoArp field of the EFI_PXE_BASE_CODE_MODE structure to NewAutoArp. The SetParameters() call must be invoked after a Callback Protocol is installed to enable the use of callbacks.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | NewAutoArp | If not NULL, a pointer to a value that specifies whether to replace the current value of AutoARP. |
[in] | NewSendGUID | If not NULL, a pointer to a value that specifies whether to replace the current value of SendGUID. |
[in] | NewTTL | If not NULL, a pointer to be used in place of the current value of TTL, the "time to live" field of the IP header. |
[in] | NewToS | If not NULL, a pointer to be used in place of the current value of ToS, the "type of service" field of the IP header. |
[in] | NewMakeCallback | If not NULL, a pointer to a value that specifies whether to replace the current value of the MakeCallback field of the Mode structure. |
EFI_SUCCESS | The new parameters values were updated. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 1931 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcSetStationIP | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN EFI_IP_ADDRESS *NewStationIp | OPTIONAL, | ||
IN EFI_IP_ADDRESS *NewSubnetMask | OPTIONAL | ||
) |
Updates the station IP address and/or subnet mask values of a network device.
This function updates the station IP address and/or subnet mask values of a network device. The NewStationIp field is used to modify the network device's current IP address. If NewStationIP is NULL, then the current IP address will not be modified. Otherwise, this function updates the StationIp field of the EFI_PXE_BASE_CODE_MODE structure with NewStationIp. The NewSubnetMask field is used to modify the network device's current subnet mask. If NewSubnetMask is NULL, then the current subnet mask will not be modified. Otherwise, this function updates the SubnetMask field of the EFI_PXE_BASE_CODE_MODE structure with NewSubnetMask.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | NewStationIp | Pointer to the new IP address to be used by the network device. |
[in] | NewSubnetMask | Pointer to the new subnet mask to be used by the network device. |
EFI_SUCCESS | The new station IP address and/or subnet mask were updated. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 2024 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcStart | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN BOOLEAN | UseIpv6 | ||
) |
Enables the use of the PXE Base Code Protocol functions.
This function enables the use of the PXE Base Code Protocol functions. If the Started field of the EFI_PXE_BASE_CODE_MODE structure is already TRUE, then EFI_ALREADY_STARTED will be returned. If UseIpv6 is TRUE, then IPv6 formatted addresses will be used in this session. If UseIpv6 is FALSE, then IPv4 formatted addresses will be used in this session. If UseIpv6 is TRUE, and the Ipv6Supported field of the EFI_PXE_BASE_CODE_MODE structure is FALSE, then EFI_UNSUPPORTED will be returned. If there is not enough memory or other resources to start the PXE Base Code Protocol, then EFI_OUT_OF_RESOURCES will be returned. Otherwise, the PXE Base Code Protocol will be started.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | UseIpv6 | Specifies the type of IP addresses that are to be used during the session that is being started. Set to TRUE for IPv6, and FALSE for IPv4. |
EFI_SUCCESS | The PXE Base Code Protocol was started. |
EFI_DEVICE_ERROR | The network device encountered an error during this operation. |
EFI_UNSUPPORTED | UseIpv6 is TRUE, but the Ipv6Supported field of the EFI_PXE_BASE_CODE_MODE structure is FALSE. |
EFI_ALREADY_STARTED | The PXE Base Code Protocol is already in the started state. |
EFI_INVALID_PARAMETER | The This parameter is NULL or does not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure. |
EFI_OUT_OF_RESOURCES | Could not allocate enough memory or other resources to start the PXE Base Code Protocol. |
Definition at line 43 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcStop | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This | ) |
Disable the use of the PXE Base Code Protocol functions.
This function stops all activity on the network device. All the resources allocated in Start() are released, the Started field of the EFI_PXE_BASE_CODE_MODE structure is set to FALSE, and EFI_SUCCESS is returned. If the Started field of the EFI_PXE_BASE_CODE_MODE structure is already FALSE, then EFI_NOT_STARTED will be returned.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
EFI_SUCCESS | The PXE Base Code Protocol was stopped. |
EFI_NOT_STARTED | The PXE Base Code Protocol is already in the stopped state. |
EFI_INVALID_PARAMETER | The This parameter is NULL or does not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure. |
Others |
Definition at line 293 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcUdpRead | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN UINT16 | OpFlags, | ||
IN OUT EFI_IP_ADDRESS *DestIp | OPTIONAL, | ||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort | OPTIONAL, | ||
IN OUT EFI_IP_ADDRESS *SrcIp | OPTIONAL, | ||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort | OPTIONAL, | ||
IN UINTN *HeaderSize | OPTIONAL, | ||
IN VOID *HeaderPtr | OPTIONAL, | ||
IN OUT UINTN * | BufferSize, | ||
IN VOID * | BufferPtr | ||
) |
Reads a UDP packet from the network interface.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | OpFlags | The UDP operation flags. |
[in,out] | DestIp | The destination IP address. |
[in,out] | DestPort | The destination UDP port number. |
[in,out] | SrcIp | The source IP address. |
[in,out] | SrcPort | The source UDP port number. |
[in] | HeaderSize | An optional field which may be set to the length of a header at HeaderPtr to be prefixed to the data at BufferPtr. |
[in] | HeaderPtr | If HeaderSize is not NULL, a pointer to a header to be prefixed to the data at BufferPtr. |
[in,out] | BufferSize | A pointer to the size of the data at BufferPtr. |
[in] | BufferPtr | A pointer to the data to be read. |
EFI_SUCCESS | The UDP Read operation was completed. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_DEVICE_ERROR | The network device encountered an error during this operation. |
EFI_BUFFER_TOO_SMALL | The packet is larger than Buffer can hold. |
EFI_ABORTED | The callback function aborted the UDP Read operation. |
EFI_TIMEOUT | The UDP Read operation timed out. |
Definition at line 1284 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeBcUdpWrite | ( | IN EFI_PXE_BASE_CODE_PROTOCOL * | This, |
IN UINT16 | OpFlags, | ||
IN EFI_IP_ADDRESS * | DestIp, | ||
IN EFI_PXE_BASE_CODE_UDP_PORT * | DestPort, | ||
IN EFI_IP_ADDRESS *GatewayIp | OPTIONAL, | ||
IN EFI_IP_ADDRESS *SrcIp | OPTIONAL, | ||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort | OPTIONAL, | ||
IN UINTN *HeaderSize | OPTIONAL, | ||
IN VOID *HeaderPtr | OPTIONAL, | ||
IN UINTN * | BufferSize, | ||
IN VOID * | BufferPtr | ||
) |
Writes a UDP packet to the network interface.
This function writes a UDP packet specified by the (optional HeaderPtr and) BufferPtr parameters to the network interface. The UDP header is automatically built by this routine. It uses the parameters OpFlags, DestIp, DestPort, GatewayIp, SrcIp, and SrcPort to build this header. If the packet is successfully built and transmitted through the network interface, then EFI_SUCCESS will be returned. If a timeout occurs during the transmission of the packet, then EFI_TIMEOUT will be returned. If an ICMP error occurs during the transmission of the packet, then the IcmpErrorReceived field is set to TRUE, the IcmpError field is filled in and EFI_ICMP_ERROR will be returned. If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will be returned.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. |
[in] | OpFlags | The UDP operation flags. |
[in] | DestIp | The destination IP address. |
[in] | DestPort | The destination UDP port number. |
[in] | GatewayIp | The gateway IP address. |
[in] | SrcIp | The source IP address. |
[in,out] | SrcPort | The source UDP port number. |
[in] | HeaderSize | An optional field which may be set to the length of a header at HeaderPtr to be prefixed to the data at BufferPtr. |
[in] | HeaderPtr | If HeaderSize is not NULL, a pointer to a header to be prefixed to the data at BufferPtr. |
[in] | BufferSize | A pointer to the size of the data at BufferPtr. |
[in] | BufferPtr | A pointer to the data to be written. |
EFI_SUCCESS | The UDP Write operation completed. |
EFI_NOT_STARTED | The PXE Base Code Protocol is in the stopped state. |
EFI_INVALID_PARAMETER | One or more parameters are invalid. |
EFI_BAD_BUFFER_SIZE | The buffer is too long to be transmitted. |
EFI_ABORTED | The callback function aborted the UDP Write operation. |
EFI_TIMEOUT | The UDP Write operation timed out. |
EFI_ICMP_ERROR | An ICMP error packet was received during the UDP write session. |
Definition at line 1073 of file PxeBcImpl.c.
EFI_STATUS EFIAPI EfiPxeLoadFile | ( | IN EFI_LOAD_FILE_PROTOCOL * | This, |
IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, | ||
IN BOOLEAN | BootPolicy, | ||
IN OUT UINTN * | BufferSize, | ||
IN VOID *Buffer | OPTIONAL | ||
) |
Causes the driver to load a specified file.
[in] | This | Protocol instance pointer. |
[in] | FilePath | The device specific path of the file to load. |
[in] | BootPolicy | If TRUE, indicates that the request originates from the boot manager is attempting to load FilePath as a boot selection. If FALSE, then FilePath must match an exact file to be loaded. |
[in,out] | BufferSize | On input the size of Buffer in bytes. On output with a return code of EFI_SUCCESS, the amount of data transferred to Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of Buffer required to retrieve the requested file. |
[in] | Buffer | The memory buffer to transfer the file to. IF Buffer is NULL, then no the size of the requested file is returned in BufferSize. |
EFI_SUCCESS | The file was loaded. |
EFI_UNSUPPORTED | The device does not support the provided BootPolicy. |
EFI_INVALID_PARAMETER | FilePath is not a valid device path, or BufferSize is NULL. |
EFI_NO_MEDIA | No medium was present to load the file. |
EFI_DEVICE_ERROR | The file was not loaded due to a device error. |
EFI_NO_RESPONSE | The remote system did not respond. |
EFI_NOT_FOUND | The file was not found. |
EFI_ABORTED | The file load process was manually cancelled. |
Definition at line 2354 of file PxeBcImpl.c.
EFI_PXE_BASE_CODE_CALLBACK_STATUS EFIAPI EfiPxeLoadFileCallback | ( | IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL * | This, |
IN EFI_PXE_BASE_CODE_FUNCTION | Function, | ||
IN BOOLEAN | Received, | ||
IN UINT32 | PacketLength, | ||
IN EFI_PXE_BASE_CODE_PACKET *PacketPtr | OPTIONAL | ||
) |
Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has received, or is waiting to receive a packet.
This function is invoked when the PXE Base Code Protocol is about to transmit, has received, or is waiting to receive a packet. Parameters Function and Received specify the type of event. Parameters PacketLen and Packet specify the packet that generated the event. If these fields are zero and NULL respectively, then this is a status update callback. If the operation specified by Function is to continue, then CALLBACK_STATUS_CONTINUE should be returned. If the operation specified by Function should be aborted, then CALLBACK_STATUS_ABORT should be returned. Due to the polling nature of UEFI device drivers, a callback function should not execute for more than 5 ms. The SetParameters() function must be called after a Callback Protocol is installed to enable the use of callbacks.
[in] | This | Pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance. |
[in] | Function | The PXE Base Code Protocol function that is waiting for an event. |
[in] | Received | TRUE if the callback is being invoked due to a receive event. FALSE if the callback is being invoked due to a transmit event. |
[in] | PacketLength | The length, in bytes, of Packet. This field will have a value of zero if this is a wait for receive event. |
[in] | PacketPtr | If Received is TRUE, a pointer to the packet that was just received; otherwise a pointer to the packet that is about to be transmitted. |
EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE | If Function specifies a continue operation. |
EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT | If Function specifies an abort operation. |
Definition at line 2256 of file PxeBcImpl.c.
EFI_LOAD_FILE_PROTOCOL gLoadFileProtocolTemplate = { EfiPxeLoadFile } |
Definition at line 2446 of file PxeBcImpl.c.
EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL gPxeBcCallBackTemplate |
Definition at line 2319 of file PxeBcImpl.c.
EFI_PXE_BASE_CODE_PROTOCOL gPxeBcProtocolTemplate |
Definition at line 2210 of file PxeBcImpl.c.