NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c File Reference


Functions

EFI_STATUS EFIAPI EfiPxeBcStart (IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN UseIpv6)
EFI_STATUS EFIAPI EfiPxeBcStop (IN EFI_PXE_BASE_CODE_PROTOCOL *This)
EFI_STATUS EFIAPI EfiPxeBcDhcp (IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN SortOffers)
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)
EFI_STATUS EFIAPI EfiPxeBcMtftp (IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation, IN OUT VOID *BufferPtr, IN BOOLEAN Overwrite, IN OUT UINT64 *BufferSize, IN UINTN *BlockSize, IN EFI_IP_ADDRESS *ServerIp, IN UINT8 *Filename, IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info, IN BOOLEAN DontUseBuffer)
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, IN EFI_IP_ADDRESS *SrcIp, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, IN UINTN *HeaderSize, IN VOID *HeaderPtr, IN UINTN *BufferSize, IN VOID *BufferPtr)
EFI_STATUS EFIAPI EfiPxeBcUdpRead (IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN UINT16 OpFlags, IN OUT EFI_IP_ADDRESS *DestIp, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort, IN OUT EFI_IP_ADDRESS *SrcIp, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, IN UINTN *HeaderSize, IN VOID *HeaderPtr, IN OUT UINTN *BufferSize, IN VOID *BufferPtr)
EFI_STATUS EFIAPI EfiPxeBcSetIpFilter (IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter)
EFI_STATUS EFIAPI EfiPxeBcArp (IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_IP_ADDRESS *IpAddr, IN EFI_MAC_ADDRESS *MacAddr)
EFI_STATUS EFIAPI EfiPxeBcSetParameters (IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN *NewAutoArp, IN BOOLEAN *NewSendGUID, IN UINT8 *NewTTL, IN UINT8 *NewToS, IN BOOLEAN *NewMakeCallback)
EFI_STATUS EFIAPI EfiPxeBcSetStationIP (IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_IP_ADDRESS *NewStationIp, IN EFI_IP_ADDRESS *NewSubnetMask)
EFI_STATUS EFIAPI EfiPxeBcSetPackets (IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN *NewDhcpDiscoverValid, IN BOOLEAN *NewDhcpAckReceived, IN BOOLEAN *NewProxyOfferReceived, IN BOOLEAN *NewPxeDiscoverValid, IN BOOLEAN *NewPxeReplyReceived, IN BOOLEAN *NewPxeBisReplyReceived, IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover, IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck, IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer, IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover, IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply, IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply)
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)
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)

Variables

EFI_PXE_BASE_CODE_PROTOCOL gPxeBcProtocolTemplate
EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL gPxeBcCallBackTemplate
EFI_LOAD_FILE_PROTOCOL gLoadFileProtocolTemplate = { EfiPxeLoadFile }

Detailed Description

This implementation of EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.

Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

EFI_STATUS EFIAPI EfiPxeBcArp ( IN EFI_PXE_BASE_CODE_PROTOCOL *  This,
IN EFI_IP_ADDRESS *  IpAddr,
IN EFI_MAC_ADDRESS *  MacAddr 
)

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.

Parameters:
[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.
Return values:
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.

References _PXEBC_PRIVATE_DATA::Arp, _PXEBC_PRIVATE_DATA::IsAddressOk, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_PRIVATE_DATA_FROM_PXEBC, PxeBcArpCacheUpdate(), PxeBcCheckArpCache(), and PxeBcCommonNotify().

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.

Parameters:
[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.
Return values:
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.

References _PXEBC_PRIVATE_DATA::Dhcp4, _PXEBC_PRIVATE_DATA::Dhcp6, _PXEBC_PRIVATE_DATA::ElapsedTime, _PXEBC_PRIVATE_DATA::Function, _PXEBC_PRIVATE_DATA::IsOfferSorted, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_PRIVATE_DATA_FROM_PXEBC, PxeBcDhcp4Dora(), PxeBcDhcp6Sarr(), _PXEBC_PRIVATE_DATA::SolicitTimes, _PXEBC_PRIVATE_DATA::Udp4CfgData, _PXEBC_PRIVATE_DATA::Udp4Read, _PXEBC_PRIVATE_DATA::Udp6CfgData, and _PXEBC_PRIVATE_DATA::Udp6Read.

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 
)

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.

Parameters:
[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.
Return values:
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.

References PXEBC_DHCP4_PACKET::Ack, PXEBC_DHCP6_PACKET::Ack, PXEBC_DHCP_PACKET_CACHE::Dhcp4, PXEBC_DHCP_PACKET_CACHE::Dhcp6, _PXEBC_PRIVATE_DATA::Function, PXEBC_BOOT_SVR_ENTRY::IpAddr, _PXEBC_PRIVATE_DATA::IsAddressOk, _PXEBC_PRIVATE_DATA::IsDoDiscover, PXEBC_DHCP4_PACKET_CACHE::Packet, PXEBC_DHCP6_PACKET_CACHE::Packet, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_PRIVATE_DATA_FROM_PXEBC, PxeBcDiscoverBootServer(), PxeBcExtractDiscoverInfo(), PxeBcParseDhcp4Packet(), PxeBcParseDhcp6Packet(), _PXEBC_PRIVATE_DATA::PxeReply, _PXEBC_PRIVATE_DATA::ServerIp, _PXEBC_PRIVATE_DATA::Udp4CfgData, _PXEBC_PRIVATE_DATA::Udp4Read, _PXEBC_PRIVATE_DATA::Udp6CfgData, and _PXEBC_PRIVATE_DATA::Udp6Read.

EFI_STATUS EFIAPI EfiPxeBcMtftp ( IN EFI_PXE_BASE_CODE_PROTOCOL *  This,
IN EFI_PXE_BASE_CODE_TFTP_OPCODE  Operation,
IN OUT VOID *  BufferPtr,
IN BOOLEAN  Overwrite,
IN OUT UINT64 *  BufferSize,
IN UINTN *  BlockSize,
IN EFI_IP_ADDRESS *  ServerIp,
IN UINT8 *  Filename,
IN EFI_PXE_BASE_CODE_MTFTP_INFO *  Info,
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.

Parameters:
[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.
Return values:
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.

References _PXEBC_PRIVATE_DATA::GatewayIp, PXE_MTFTP_DEFAULT_BLOCK_SIZE, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_MTFTP_RETRIES, PXEBC_MTFTP_TIMEOUT, PXEBC_PRIVATE_DATA_FROM_PXEBC, PxeBcTftpGetFileSize(), PxeBcTftpReadDirectory(), PxeBcTftpReadFile(), PxeBcTftpWriteFile(), _PXEBC_PRIVATE_DATA::StationIp, _PXEBC_PRIVATE_DATA::SubnetMask, _PXEBC_PRIVATE_DATA::Udp4CfgData, _PXEBC_PRIVATE_DATA::Udp4Read, _PXEBC_PRIVATE_DATA::Udp6CfgData, and _PXEBC_PRIVATE_DATA::Udp6Read.

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.

Parameters:
[in] This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
[in] NewFilter Pointer to the new set of IP receive filters.
Return values:
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.

References _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_PRIVATE_DATA_FROM_PXEBC, _PXEBC_PRIVATE_DATA::Udp4CfgData, _PXEBC_PRIVATE_DATA::Udp4Read, _PXEBC_PRIVATE_DATA::Udp6CfgData, and _PXEBC_PRIVATE_DATA::Udp6Read.

EFI_STATUS EFIAPI EfiPxeBcSetPackets ( IN EFI_PXE_BASE_CODE_PROTOCOL *  This,
IN BOOLEAN *  NewDhcpDiscoverValid,
IN BOOLEAN *  NewDhcpAckReceived,
IN BOOLEAN *  NewProxyOfferReceived,
IN BOOLEAN *  NewPxeDiscoverValid,
IN BOOLEAN *  NewPxeReplyReceived,
IN BOOLEAN *  NewPxeBisReplyReceived,
IN EFI_PXE_BASE_CODE_PACKET *  NewDhcpDiscover,
IN EFI_PXE_BASE_CODE_PACKET *  NewDhcpAck,
IN EFI_PXE_BASE_CODE_PACKET *  NewProxyOffer,
IN EFI_PXE_BASE_CODE_PACKET *  NewPxeDiscover,
IN EFI_PXE_BASE_CODE_PACKET *  NewPxeReply,
IN EFI_PXE_BASE_CODE_PACKET *  NewPxeBisReply 
)

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.

Parameters:
[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.
Return values:
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.

References _PXEBC_PRIVATE_DATA::PxeBc, and PXEBC_PRIVATE_DATA_FROM_PXEBC.

EFI_STATUS EFIAPI EfiPxeBcSetParameters ( IN EFI_PXE_BASE_CODE_PROTOCOL *  This,
IN BOOLEAN *  NewAutoArp,
IN BOOLEAN *  NewSendGUID,
IN UINT8 *  NewTTL,
IN UINT8 *  NewToS,
IN BOOLEAN *  NewMakeCallback 
)

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.

Parameters:
[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.
Return values:
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.

References _PXEBC_PRIVATE_DATA::Controller, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_PRIVATE_DATA_FROM_PXEBC, and _PXEBC_PRIVATE_DATA::PxeBcCallback.

EFI_STATUS EFIAPI EfiPxeBcSetStationIP ( IN EFI_PXE_BASE_CODE_PROTOCOL *  This,
IN EFI_IP_ADDRESS *  NewStationIp,
IN EFI_IP_ADDRESS *  NewSubnetMask 
)

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.

Parameters:
[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.
Return values:
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.

References _PXEBC_PRIVATE_DATA::Arp, _PXEBC_PRIVATE_DATA::IsAddressOk, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_PRIVATE_DATA_FROM_PXEBC, PxeBcFlushStationIp(), PxeBcRegisterIp6Address(), _PXEBC_PRIVATE_DATA::StationIp, and _PXEBC_PRIVATE_DATA::SubnetMask.

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.

Parameters:
[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.
Return values:
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.

References PXEBC_DHCP4_PACKET::Ack, PXEBC_DHCP6_PACKET::Ack, _PXEBC_PRIVATE_DATA::ArpUpdateEvent, _PXEBC_PRIVATE_DATA::BlockSize, PXEBC_DHCP_PACKET_CACHE::Dhcp4, PXEBC_DHCP_PACKET_CACHE::Dhcp6, _PXEBC_PRIVATE_DATA::DhcpAck, _PXEBC_PRIVATE_DATA::Icmp6Token, _PXEBC_PRIVATE_DATA::IcmpToken, _PXEBC_PRIVATE_DATA::Ip4, _PXEBC_PRIVATE_DATA::Ip4MaxPacketSize, _PXEBC_PRIVATE_DATA::Ip4Nic, _PXEBC_PRIVATE_DATA::Ip6, _PXEBC_PRIVATE_DATA::Ip6MaxPacketSize, _PXEBC_PRIVATE_DATA::Ip6Nic, _PXEBC_PRIVATE_DATA::Ip6Policy, _PXEBC_PRIVATE_DATA::IsAddressOk, PXEBC_DHCP4_PACKET::Offer, PXEBC_DHCP6_PACKET::Offer, _PXEBC_PRIVATE_DATA::OfferBuffer, PXEBC_DHCP4_PACKET_CACHE::Packet, PXEBC_DHCP6_PACKET_CACHE::Packet, _PXEBC_PRIVATE_DATA::ProxyOffer, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE, PXEBC_DEFAULT_UDP_OVERHEAD_SIZE, PXEBC_DHCP4_PACKET_MAX_SIZE, PXEBC_DHCP6_PACKET_MAX_SIZE, PXEBC_IP6_POLICY_MAX, PXEBC_OFFER_MAX_NUM, PXEBC_PRIVATE_DATA_FROM_PXEBC, PxeBcArpCacheUpdate(), PxeBcIcmp6ErrorUpdate(), PxeBcIcmpErrorUpdate(), PxeBcSeedDhcp4Packet(), PxeBcSetIp4Policy(), PxeBcSetIp6Policy(), _PXEBC_PRIVATE_DATA::PxeReply, _PXEBC_PRIVATE_DATA::SeedPacket, _PXEBC_PRIVATE_DATA::Udp4CfgData, _PXEBC_PRIVATE_DATA::Udp4Read, _PXEBC_PRIVATE_DATA::Udp6CfgData, _PXEBC_PRIVATE_DATA::Udp6Read, and _PXEBC_PRIVATE_DATA::UdpTimeOutEvent.

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.

Parameters:
[in] This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
Return values:
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 

References _PXEBC_PRIVATE_DATA::ArpUpdateEvent, _PXEBC_PRIVATE_DATA::BootFileName, _PXEBC_PRIVATE_DATA::BootFileSize, _PXEBC_PRIVATE_DATA::CurSrcPort, _PXEBC_PRIVATE_DATA::Dhcp4, _PXEBC_PRIVATE_DATA::Dhcp6, _PXEBC_PRIVATE_DATA::Dhcp6Request, _PXEBC_PRIVATE_DATA::ElapsedTime, _PXEBC_PRIVATE_DATA::GatewayIp, _PXEBC_PRIVATE_DATA::Icmp6Token, _PXEBC_PRIVATE_DATA::IcmpToken, _PXEBC_PRIVATE_DATA::Ip4, _PXEBC_PRIVATE_DATA::Ip4CfgData, _PXEBC_PRIVATE_DATA::Ip6, _PXEBC_PRIVATE_DATA::Ip6CfgData, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_PRIVATE_DATA_FROM_PXEBC, PxeBcUnregisterIp6Address(), _PXEBC_PRIVATE_DATA::ServerIp, _PXEBC_PRIVATE_DATA::SolicitTimes, _PXEBC_PRIVATE_DATA::StationIp, _PXEBC_PRIVATE_DATA::SubnetMask, _PXEBC_PRIVATE_DATA::Udp4CfgData, _PXEBC_PRIVATE_DATA::Udp4Read, _PXEBC_PRIVATE_DATA::Udp4Write, _PXEBC_PRIVATE_DATA::Udp6CfgData, _PXEBC_PRIVATE_DATA::Udp6Read, _PXEBC_PRIVATE_DATA::Udp6Write, and _PXEBC_PRIVATE_DATA::UdpTimeOutEvent.

EFI_STATUS EFIAPI EfiPxeBcUdpRead ( IN EFI_PXE_BASE_CODE_PROTOCOL *  This,
IN UINT16  OpFlags,
IN OUT EFI_IP_ADDRESS *  DestIp,
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *  DestPort,
IN OUT EFI_IP_ADDRESS *  SrcIp,
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *  SrcPort,
IN UINTN *  HeaderSize,
IN VOID *  HeaderPtr,
IN OUT UINTN *  BufferSize,
IN VOID *  BufferPtr 
)

Reads a UDP packet from the network interface. + This function reads a UDP packet from a network interface. The data contents are returned in (the optional HeaderPtr and) BufferPtr, and the size of the buffer received is returned in BufferSize . If the input BufferSize is smaller than the UDP packet received (less optional HeaderSize), it will be set to the required size, and EFI_BUFFER_TOO_SMALL will be returned. In this case, the contents of BufferPtr are undefined, and the packet is lost. If a UDP packet is successfully received, then EFI_SUCCESS will be returned, and the information from the UDP header will be returned in DestIp, DestPort, SrcIp, and SrcPort if they are not NULL. Depending on the values of OpFlags and the DestIp, DestPort, SrcIp, and SrcPort input values, different types of UDP packet receive filtering will be performed. The following tables summarize these receive filter operations.

Parameters:
[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.
Return values:
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.

References _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_PRIVATE_DATA_FROM_PXEBC, PXEBC_UDP_TIMEOUT, PxeBcCommonNotify(), PxeBcUdp4Read(), PxeBcUdp6Read(), _PXEBC_PRIVATE_DATA::Udp4Read, _PXEBC_PRIVATE_DATA::Udp6Read, and _PXEBC_PRIVATE_DATA::UdpTimeOutEvent.

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,
IN EFI_IP_ADDRESS *  SrcIp,
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *  SrcPort,
IN UINTN *  HeaderSize,
IN VOID *  HeaderPtr,
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.

Parameters:
[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.
Return values:
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.

References _PXEBC_PRIVATE_DATA::CurSrcPort, _PXEBC_PRIVATE_DATA::GatewayIp, _PXEBC_PRIVATE_DATA::IsAddressOk, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_PRIVATE_DATA_FROM_PXEBC, PXEBC_UDP_TIMEOUT, PxeBcConfigUdp4Write(), PxeBcConfigUdp6Write(), PxeBcUdp4Write(), PxeBcUdp6Write(), _PXEBC_PRIVATE_DATA::StationIp, _PXEBC_PRIVATE_DATA::SubnetMask, _PXEBC_PRIVATE_DATA::Udp4Write, _PXEBC_PRIVATE_DATA::Udp6Write, and _PXEBC_PRIVATE_DATA::UdpTimeOutEvent.

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 
)

Causes the driver to load a specified file.

Parameters:
[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.
Return values:
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.

References _PXEBC_PRIVATE_DATA::Controller, _PXEBC_PRIVATE_DATA::Ip6Nic, _PXEBC_VIRTUAL_NIC::Private, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_VIRTUAL_NIC_FROM_LOADFILE, and PxeBcLoadBootFile().

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 
)

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.

Parameters:
[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.
Return values:
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.


Variable Documentation

EFI_LOAD_FILE_PROTOCOL gLoadFileProtocolTemplate = { EfiPxeLoadFile }

EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL gPxeBcCallBackTemplate

Initial value:

 {
  EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION,
  EfiPxeLoadFileCallback
}

Referenced by PxeBcInstallCallback().

EFI_PXE_BASE_CODE_PROTOCOL gPxeBcProtocolTemplate


Generated on Mon Sep 28 08:49:07 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1