--- /dev/null
+/** @file\r
+ EFI PXE Base Code Protocol definitions.\r
+\r
+ Copyright (c) 2006, Intel Corporation \r
+ All rights reserved. This program and the accompanying materials \r
+ are licensed and made available under the terms and conditions of the BSD License \r
+ which accompanies this distribution. The full text of the license may be found at \r
+ http://opensource.org/licenses/bsd-license.php \r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+ Module Name: PxeBaseCode.h\r
+\r
+**/\r
+#ifndef __PXE_BASE_CODE_PROTOCOL_H__\r
+#define __PXE_BASE_CODE_PROTOCOL_H__\r
+\r
+//\r
+// PXE Base Code protocol\r
+//\r
+#define EFI_PXE_BASE_CODE_PROTOCOL_GUID \\r
+ { \\r
+ 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+ }\r
+\r
+typedef struct _EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE_PROTOCOL;\r
+\r
+//\r
+// Default IP TTL and ToS.\r
+//\r
+#define DEFAULT_TTL 16\r
+#define DEFAULT_ToS 0\r
+\r
+//\r
+// ICMP error format\r
+//\r
+typedef struct {\r
+ UINT8 Type;\r
+ UINT8 Code;\r
+ UINT16 Checksum;\r
+ union {\r
+ UINT32 reserved;\r
+ UINT32 Mtu;\r
+ UINT32 Pointer;\r
+ struct {\r
+ UINT16 Identifier;\r
+ UINT16 Sequence;\r
+ } Echo;\r
+ } u;\r
+ UINT8 Data[494];\r
+} EFI_PXE_BASE_CODE_ICMP_ERROR;\r
+\r
+//\r
+// TFTP error format\r
+//\r
+typedef struct {\r
+ UINT8 ErrorCode;\r
+ CHAR8 ErrorString[127];\r
+} EFI_PXE_BASE_CODE_TFTP_ERROR;\r
+\r
+//\r
+// IP Receive Filter definitions\r
+//\r
+#define EFI_PXE_BASE_CODE_MAX_IPCNT 8\r
+\r
+typedef struct {\r
+ UINT8 Filters;\r
+ UINT8 IpCnt;\r
+ UINT16 reserved;\r
+ EFI_IP_ADDRESS IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];\r
+} EFI_PXE_BASE_CODE_IP_FILTER;\r
+\r
+#define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001\r
+#define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002\r
+#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004\r
+#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008\r
+\r
+//\r
+// ARP Cache definitions\r
+//\r
+typedef struct {\r
+ EFI_IP_ADDRESS IpAddr;\r
+ EFI_MAC_ADDRESS MacAddr;\r
+} EFI_PXE_BASE_CODE_ARP_ENTRY;\r
+\r
+typedef struct {\r
+ EFI_IP_ADDRESS IpAddr;\r
+ EFI_IP_ADDRESS SubnetMask;\r
+ EFI_IP_ADDRESS GwAddr;\r
+} EFI_PXE_BASE_CODE_ROUTE_ENTRY;\r
+\r
+//\r
+// UDP definitions\r
+//\r
+typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;\r
+\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020\r
+\r
+//\r
+// Discover() definitions\r
+//\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16\r
+//\r
+// 17 through 32767 are reserved\r
+// 32768 through 65279 are for vendor use\r
+// 65280 through 65534 are reserved\r
+//\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535\r
+\r
+#define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF\r
+#define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000\r
+\r
+//\r
+// Discover() server list structure.\r
+//\r
+typedef struct {\r
+ UINT16 Type;\r
+ BOOLEAN AcceptAnyResponse;\r
+ UINT8 Reserved;\r
+ EFI_IP_ADDRESS IpAddr;\r
+} EFI_PXE_BASE_CODE_SRVLIST;\r
+\r
+//\r
+// Discover() information override structure.\r
+//\r
+typedef struct {\r
+ BOOLEAN UseMCast;\r
+ BOOLEAN UseBCast;\r
+ BOOLEAN UseUCast;\r
+ BOOLEAN MustUseList;\r
+ EFI_IP_ADDRESS ServerMCastIp;\r
+ UINT16 IpCnt;\r
+ EFI_PXE_BASE_CODE_SRVLIST SrvList[1];\r
+} EFI_PXE_BASE_CODE_DISCOVER_INFO;\r
+\r
+//\r
+// Mtftp() definitions\r
+//\r
+typedef enum {\r
+ EFI_PXE_BASE_CODE_TFTP_FIRST,\r
+ EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,\r
+ EFI_PXE_BASE_CODE_TFTP_READ_FILE,\r
+ EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,\r
+ EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,\r
+ EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,\r
+ EFI_PXE_BASE_CODE_MTFTP_READ_FILE,\r
+ EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,\r
+ EFI_PXE_BASE_CODE_MTFTP_LAST\r
+} EFI_PXE_BASE_CODE_TFTP_OPCODE;\r
+\r
+typedef struct {\r
+ EFI_IP_ADDRESS MCastIp;\r
+ EFI_PXE_BASE_CODE_UDP_PORT CPort;\r
+ EFI_PXE_BASE_CODE_UDP_PORT SPort;\r
+ UINT16 ListenTimeout;\r
+ UINT16 TransmitTimeout;\r
+} EFI_PXE_BASE_CODE_MTFTP_INFO;\r
+\r
+//\r
+// PXE Base Code Mode structure\r
+//\r
+#define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8\r
+#define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8\r
+\r
+typedef struct {\r
+ BOOLEAN Started;\r
+ BOOLEAN Ipv6Available;\r
+ BOOLEAN Ipv6Supported;\r
+ BOOLEAN UsingIpv6;\r
+ BOOLEAN BisSupported;\r
+ BOOLEAN BisDetected;\r
+ BOOLEAN AutoArp;\r
+ BOOLEAN SendGUID;\r
+ BOOLEAN DhcpDiscoverValid;\r
+ BOOLEAN DhcpAckReceived;\r
+ BOOLEAN ProxyOfferReceived;\r
+ BOOLEAN PxeDiscoverValid;\r
+ BOOLEAN PxeReplyReceived;\r
+ BOOLEAN PxeBisReplyReceived;\r
+ BOOLEAN IcmpErrorReceived;\r
+ BOOLEAN TftpErrorReceived;\r
+ BOOLEAN MakeCallbacks;\r
+ UINT8 TTL;\r
+ UINT8 ToS;\r
+ EFI_IP_ADDRESS StationIp;\r
+ EFI_IP_ADDRESS SubnetMask;\r
+ EFI_PXE_BASE_CODE_PACKET DhcpDiscover;\r
+ EFI_PXE_BASE_CODE_PACKET DhcpAck;\r
+ EFI_PXE_BASE_CODE_PACKET ProxyOffer;\r
+ EFI_PXE_BASE_CODE_PACKET PxeDiscover;\r
+ EFI_PXE_BASE_CODE_PACKET PxeReply;\r
+ EFI_PXE_BASE_CODE_PACKET PxeBisReply;\r
+ EFI_PXE_BASE_CODE_IP_FILTER IpFilter;\r
+ UINT32 ArpCacheEntries;\r
+ EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];\r
+ UINT32 RouteTableEntries;\r
+ EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];\r
+ EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError;\r
+ EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;\r
+} EFI_PXE_BASE_CODE_MODE;\r
+\r
+//\r
+// PXE Base Code Interface Function definitions\r
+//\r
+\r
+/** \r
+ Enables the use of the PXE Base Code Protocol functions.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param UseIpv6 Specifies the type of IP addresses that are to be used during the session\r
+ that is being started. Set to TRUE for IPv6 addresses, and FALSE for \r
+ IPv4 addresses. \r
+ \r
+ @retval EFI_SUCCESS The PXE Base Code Protocol was started.\r
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this oper \r
+ @retval EFI_UNSUPPORTED UseIpv6 is TRUE, but the Ipv6Supported field of the\r
+ EFI_PXE_BASE_CODE_MODE structure is FALSE. \r
+ @retval EFI_ALREADY_STARTED The PXE Base Code Protocol is already in the started state. \r
+ @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
+ EFI_PXE_BASE_CODE_PROTOCOL structure. \r
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory or other resources to start the \r
+ PXE Base Code Protocol. \r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_START) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN BOOLEAN UseIpv6\r
+ );\r
+\r
+/** \r
+ Disables the use of the PXE Base Code Protocol functions.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ \r
+ @retval EFI_SUCCESS The PXE Base Code Protocol was stopped.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is already in the stopped state. \r
+ @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
+ EFI_PXE_BASE_CODE_PROTOCOL structure. \r
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_STOP) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This\r
+ );\r
+\r
+/** \r
+ Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6\r
+ S.A.R.R (solicit / advertise / request / reply) sequence.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param SortOffers TRUE if the offers received should be sorted. Set to FALSE to try the\r
+ offers in the order that they are received. \r
+ \r
+ @retval EFI_SUCCESS Valid DHCP has completed.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
+ EFI_PXE_BASE_CODE_PROTOCOL structure. \r
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete the DHCP Protocol.\r
+ @retval EFI_ABORTED The callback function aborted the DHCP Protocol.\r
+ @retval EFI_TIMEOUT The DHCP Protocol timed out.\r
+ @retval EFI_ICMP_ERROR An ICMP error packet was received during the DHCP session.\r
+ @retval EFI_NO_RESPONSE Valid PXE offer was not received.\r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_DHCP) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN BOOLEAN SortOffers\r
+ );\r
+\r
+/** \r
+ Attempts to complete the PXE Boot Server and/or boot image discovery sequence.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param Type The type of bootstrap to perform.\r
+ @param Layer Pointer to the boot server layer number to discover, which must be\r
+ PXE_BOOT_LAYER_INITIAL when a new server type is being \r
+ discovered. \r
+ @param UseBis TRUE if Boot Integrity Services are to be used. FALSE otherwise. \r
+ @param Info Pointer to a data structure that contains additional information on the\r
+ type of discovery operation that is to be performed. \r
+ \r
+ @retval EFI_SUCCESS The Discovery sequence has been completed.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete Discovery.\r
+ @retval EFI_ABORTED The callback function aborted the Discovery sequence.\r
+ @retval EFI_TIMEOUT The Discovery sequence timed out.\r
+ @retval EFI_ICMP_ERROR An ICMP error packet was received during the PXE discovery\r
+ session. \r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_DISCOVER) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN UINT16 Type,\r
+ IN UINT16 *Layer,\r
+ IN BOOLEAN UseBis,\r
+ IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL\r
+ );\r
+\r
+/** \r
+ Used to perform TFTP and MTFTP services.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param Operation The type of operation to perform.\r
+ @param BufferPtr A pointer to the data buffer. \r
+ @param Overwrite Only used on write file operations. TRUE if a file on a remote server can\r
+ be overwritten. \r
+ @param BufferSize For get-file-size operations, *BufferSize returns the size of the\r
+ requested file. \r
+ @param BlockSize The requested block size to be used during a TFTP transfer.\r
+ @param ServerIp The TFTP / MTFTP server IP address.\r
+ @param Filename A Null-terminated ASCII string that specifies a directory name or a file\r
+ name. \r
+ @param Info Pointer to the MTFTP information.\r
+ @param DontUseBuffer Set to FALSE for normal TFTP and MTFTP read file operation. \r
+ \r
+ @retval EFI_SUCCESS The TFTP/MTFTP operation was completed.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
+ @retval EFI_BUFFER_TOO_SMALL The buffer is not large enough to complete the read operation. \r
+ @retval EFI_ABORTED The callback function aborted the TFTP/MTFTP operation.\r
+ @retval EFI_TIMEOUT The TFTP/MTFTP operation timed out.\r
+ @retval EFI_ICMP_ERROR An ICMP error packet was received during the MTFTP session.\r
+ @retval EFI_TFTP_ERROR A TFTP error packet was received during the MTFTP session.\r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_MTFTP) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,\r
+ IN OUT VOID *BufferPtr OPTIONAL,\r
+ IN BOOLEAN Overwrite,\r
+ IN OUT UINT64 *BufferSize,\r
+ IN UINTN *BlockSize OPTIONAL,\r
+ IN EFI_IP_ADDRESS *ServerIp,\r
+ IN UINT8 *Filename OPTIONAL,\r
+ IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,\r
+ IN BOOLEAN DontUseBuffer\r
+ );\r
+\r
+/** \r
+ Writes a UDP packet to the network interface.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param OpFlags The UDP operation flags. \r
+ @param DestIp The destination IP address.\r
+ @param DestPort The destination UDP port number. \r
+ @param GatewayIp The gateway IP address. \r
+ @param SrcIp The source IP address.\r
+ @param SrcPort The source UDP port number.\r
+ @param HeaderSize An optional field which may be set to the length of a header at\r
+ HeaderPtr to be prefixed to the data at BufferPtr. \r
+ @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
+ data at BufferPtr. \r
+ @param BufferSize A pointer to the size of the data at BufferPtr.\r
+ @param BufferPtr A pointer to the data to be written.\r
+ \r
+ @retval EFI_SUCCESS The UDP Write operation was completed.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
+ @retval EFI_BAD_BUFFER_SIZE The buffer is too long to be transmitted. \r
+ @retval EFI_ABORTED The callback function aborted the UDP Write operation.\r
+ @retval EFI_TIMEOUT The UDP Write operation timed out.\r
+ @retval EFI_ICMP_ERROR An ICMP error packet was received during the UDP write session. \r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN UINT16 OpFlags,\r
+ IN EFI_IP_ADDRESS *DestIp,\r
+ IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,\r
+ IN EFI_IP_ADDRESS *GatewayIp, OPTIONAL\r
+ IN EFI_IP_ADDRESS *SrcIp, OPTIONAL\r
+ IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL\r
+ IN UINTN *HeaderSize, OPTIONAL\r
+ IN VOID *HeaderPtr, OPTIONAL\r
+ IN UINTN *BufferSize,\r
+ IN VOID *BufferPtr\r
+ );\r
+\r
+/** \r
+ Reads a UDP packet from the network interface.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param OpFlags The UDP operation flags. \r
+ @param DestIp The destination IP address.\r
+ @param DestPort The destination UDP port number. \r
+ @param GatewayIp The gateway IP address. \r
+ @param SrcIp The source IP address.\r
+ @param SrcPort The source UDP port number.\r
+ @param HeaderSize An optional field which may be set to the length of a header at\r
+ HeaderPtr to be prefixed to the data at BufferPtr. \r
+ @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
+ data at BufferPtr. \r
+ @param BufferSize A pointer to the size of the data at BufferPtr.\r
+ @param BufferPtr A pointer to the data to be read.\r
+ \r
+ @retval EFI_SUCCESS The UDP Write operation was completed.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r
+ @retval EFI_BUFFER_TOO_SMALL The packet is larger than Buffer can hold.\r
+ @retval EFI_ABORTED The callback function aborted the UDP Read operation.\r
+ @retval EFI_TIMEOUT The UDP Read operation timed out. \r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_UDP_READ) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN UINT16 OpFlags,\r
+ IN OUT EFI_IP_ADDRESS *DestIp, OPTIONAL\r
+ IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort, OPTIONAL\r
+ IN OUT EFI_IP_ADDRESS *SrcIp, OPTIONAL\r
+ IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL\r
+ IN UINTN *HeaderSize, OPTIONAL\r
+ IN VOID *HeaderPtr, OPTIONAL\r
+ IN OUT UINTN *BufferSize,\r
+ IN VOID *BufferPtr\r
+ );\r
+\r
+/** \r
+ Updates the IP receive filters of a network device and enables software filtering.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param NewFilter Pointer to the new set of IP receive filters.\r
+ \r
+ @retval EFI_SUCCESS The IP receive filter settings were updated.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter\r
+ );\r
+\r
+/** \r
+ Uses the ARP protocol to resolve a MAC address.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param IpAddr Pointer to the IP address that is used to resolve a MAC address.\r
+ @param MacAddr If not NULL, a pointer to the MAC address that was resolved with the\r
+ ARP protocol. \r
+ \r
+ @retval EFI_SUCCESS The IP or MAC address was resolved.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
+ @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
+ @retval EFI_ABORTED The callback function aborted the ARP Protocol.\r
+ @retval EFI_TIMEOUT The ARP Protocol encountered a timeout condition.\r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_ARP) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN EFI_IP_ADDRESS *IpAddr,\r
+ IN EFI_MAC_ADDRESS *MacAddr OPTIONAL\r
+ );\r
+\r
+/** \r
+ Updates the parameters that affect the operation of the PXE Base Code Protocol.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param NewAutoArp If not NULL, a pointer to a value that specifies whether to replace the\r
+ current value of AutoARP. \r
+ @param NewSendGUID If not NULL, a pointer to a value that specifies whether to replace the\r
+ current value of SendGUID. \r
+ @param NewTTL If not NULL, a pointer to be used in place of the current value of TTL,\r
+ the "time to live" field of the IP header. \r
+ @param NewToS If not NULL, a pointer to be used in place of the current value of ToS,\r
+ the "type of service" field of the IP header. \r
+ @param NewMakeCallback If not NULL, a pointer to a value that specifies whether to replace the\r
+ current value of the MakeCallback field of the Mode structure. \r
+ \r
+ @retval EFI_SUCCESS The new parameters values were updated.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN BOOLEAN *NewAutoArp, OPTIONAL\r
+ IN BOOLEAN *NewSendGUID, OPTIONAL\r
+ IN UINT8 *NewTTL, OPTIONAL\r
+ IN UINT8 *NewToS, OPTIONAL\r
+ IN BOOLEAN *NewMakeCallback OPTIONAL\r
+ );\r
+\r
+/** \r
+ Updates the station IP address and/or subnet mask values of a network device.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param NewStationIp Pointer to the new IP address to be used by the network device. \r
+ @param NewSubnetMask Pointer to the new subnet mask to be used by the network device. \r
+ \r
+ @retval EFI_SUCCESS The new station IP address and/or subnet mask were updated.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL\r
+ IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL\r
+ );\r
+\r
+/** \r
+ Updates the contents of the cached DHCP and Discover packets.\r
+ \r
+ @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+ @param NewDhcpDiscoverValid Pointer to a value that will replace the current\r
+ DhcpDiscoverValid field. \r
+ @param NewDhcpAckReceived Pointer to a value that will replace the current\r
+ DhcpAckReceived field. \r
+ @param NewProxyOfferReceived Pointer to a value that will replace the current\r
+ ProxyOfferReceived field. \r
+ @param NewPxeDiscoverValid Pointer to a value that will replace the current \r
+ ProxyOfferReceived field. \r
+ @param NewPxeReplyReceived Pointer to a value that will replace the current\r
+ PxeReplyReceived field. \r
+ @param NewPxeBisReplyReceived Pointer to a value that will replace the current\r
+ PxeBisReplyReceived field. \r
+ @param NewDhcpDiscover Pointer to the new cached DHCP Discover packet contents. \r
+ @param NewDhcpAck Pointer to the new cached DHCP Ack packet contents.\r
+ @param NewProxyOffer Pointer to the new cached Proxy Offer packet contents.\r
+ @param NewPxeDiscover Pointer to the new cached PXE Discover packet contents.\r
+ @param NewPxeReply Pointer to the new cached PXE Reply packet contents.\r
+ @param NewPxeBisReply Pointer to the new cached PXE BIS Reply packet contents.\r
+ \r
+ @retval EFI_SUCCESS The cached packet contents were updated.\r
+ @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
+ @retval EFI_INVALID_PARAMETER This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.\r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS) (\r
+ IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
+ BOOLEAN *NewDhcpDiscoverValid, OPTIONAL\r
+ BOOLEAN *NewDhcpAckReceived, OPTIONAL\r
+ BOOLEAN *NewProxyOfferReceived, OPTIONAL\r
+ BOOLEAN *NewPxeDiscoverValid, OPTIONAL\r
+ BOOLEAN *NewPxeReplyReceived, OPTIONAL\r
+ BOOLEAN *NewPxeBisReplyReceived, OPTIONAL\r
+ IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover, OPTIONAL\r
+ IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck, OPTIONAL\r
+ IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer, OPTIONAL\r
+ IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover, OPTIONAL\r
+ IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply, OPTIONAL\r
+ IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL\r
+ );\r
+\r
+//\r
+// PXE Base Code Protocol structure\r
+//\r
+#define EFI_PXE_BASE_CODE_INTERFACE_REVISION 0x00010000\r
+#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION EFI_PXE_BASE_CODE_INTERFACE_REVISION\r
+\r
+struct _EFI_PXE_BASE_CODE_PROTOCOL {\r
+ UINT64 Revision;\r
+ EFI_PXE_BASE_CODE_START Start;\r
+ EFI_PXE_BASE_CODE_STOP Stop;\r
+ EFI_PXE_BASE_CODE_DHCP Dhcp;\r
+ EFI_PXE_BASE_CODE_DISCOVER Discover;\r
+ EFI_PXE_BASE_CODE_MTFTP Mtftp;\r
+ EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite;\r
+ EFI_PXE_BASE_CODE_UDP_READ UdpRead;\r
+ EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter;\r
+ EFI_PXE_BASE_CODE_ARP Arp;\r
+ EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters;\r
+ EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp;\r
+ EFI_PXE_BASE_CODE_SET_PACKETS SetPackets;\r
+ EFI_PXE_BASE_CODE_MODE *Mode;\r
+};\r
+\r
+extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;\r
+\r
+#endif \r