iPXE
PxeBaseCode.h
Go to the documentation of this file.
00001 /** @file
00002   EFI PXE Base Code Protocol definitions, which is used to access PXE-compatible
00003   devices for network access and network booting.
00004 
00005 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
00006 This program and the accompanying materials are licensed and made available under
00007 the terms and conditions of the BSD License that accompanies this distribution.
00008 The full text of the license may be found at
00009 http://opensource.org/licenses/bsd-license.php.
00010 
00011 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00012 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00013 
00014   @par Revision Reference:
00015   This Protocol is introduced in EFI Specification 1.10.
00016 
00017 **/
00018 #ifndef __PXE_BASE_CODE_PROTOCOL_H__
00019 #define __PXE_BASE_CODE_PROTOCOL_H__
00020 
00021 FILE_LICENCE ( BSD3 );
00022 
00023 ///
00024 /// PXE Base Code protocol.
00025 ///
00026 #define EFI_PXE_BASE_CODE_PROTOCOL_GUID \
00027   { \
00028     0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
00029   }
00030 
00031 typedef struct _EFI_PXE_BASE_CODE_PROTOCOL  EFI_PXE_BASE_CODE_PROTOCOL;
00032 
00033 ///
00034 /// Protocol defined in EFI1.1.
00035 ///
00036 typedef EFI_PXE_BASE_CODE_PROTOCOL  EFI_PXE_BASE_CODE;
00037 
00038 ///
00039 /// Default IP TTL and ToS.
00040 ///
00041 #define DEFAULT_TTL 16
00042 #define DEFAULT_ToS 0
00043 
00044 ///
00045 /// ICMP error format.
00046 ///
00047 typedef struct {
00048   UINT8   Type;
00049   UINT8   Code;
00050   UINT16  Checksum;
00051   union {
00052     UINT32  reserved;
00053     UINT32  Mtu;
00054     UINT32  Pointer;
00055     struct {
00056       UINT16  Identifier;
00057       UINT16  Sequence;
00058     } Echo;
00059   } u;
00060   UINT8 Data[494];
00061 } EFI_PXE_BASE_CODE_ICMP_ERROR;
00062 
00063 ///
00064 /// TFTP error format.
00065 ///
00066 typedef struct {
00067   UINT8 ErrorCode;
00068   CHAR8 ErrorString[127];
00069 } EFI_PXE_BASE_CODE_TFTP_ERROR;
00070 
00071 ///
00072 /// IP Receive Filter definitions.
00073 ///
00074 #define EFI_PXE_BASE_CODE_MAX_IPCNT 8
00075 
00076 ///
00077 /// IP Receive Filter structure.
00078 ///
00079 typedef struct {
00080   UINT8           Filters;
00081   UINT8           IpCnt;
00082   UINT16          reserved;
00083   EFI_IP_ADDRESS  IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];
00084 } EFI_PXE_BASE_CODE_IP_FILTER;
00085 
00086 #define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP            0x0001
00087 #define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST             0x0002
00088 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS           0x0004
00089 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008
00090 
00091 ///
00092 /// ARP cache entries.
00093 ///
00094 typedef struct {
00095   EFI_IP_ADDRESS  IpAddr;
00096   EFI_MAC_ADDRESS MacAddr;
00097 } EFI_PXE_BASE_CODE_ARP_ENTRY;
00098 
00099 ///
00100 /// ARP route table entries.
00101 ///
00102 typedef struct {
00103   EFI_IP_ADDRESS  IpAddr;
00104   EFI_IP_ADDRESS  SubnetMask;
00105   EFI_IP_ADDRESS  GwAddr;
00106 } EFI_PXE_BASE_CODE_ROUTE_ENTRY;
00107 
00108 //
00109 // UDP definitions
00110 //
00111 typedef UINT16  EFI_PXE_BASE_CODE_UDP_PORT;
00112 
00113 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP    0x0001
00114 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT  0x0002
00115 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP   0x0004
00116 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008
00117 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER    0x0010
00118 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT  0x0020
00119 
00120 //
00121 // Discover() definitions
00122 //
00123 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP         0
00124 #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS      1
00125 #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM         2
00126 #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI           3
00127 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO        4
00128 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD          5
00129 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM          6
00130 #define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG  7
00131 #define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW       8
00132 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9         9
00133 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10        10
00134 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11        11
00135 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12       12
00136 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL    13
00137 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT       14
00138 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO             15
00139 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT           16
00140 //
00141 // 17 through 32767 are reserved
00142 // 32768 through 65279 are for vendor use
00143 // 65280 through 65534 are reserved
00144 //
00145 #define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST   65535
00146 
00147 #define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK     0x7FFF
00148 #define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL  0x0000
00149 
00150 //
00151 // PXE Tag definition that identifies the processor
00152 // and programming environment of the client system.
00153 // These identifiers are defined by IETF:
00154 // http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml
00155 //
00156 #if defined (MDE_CPU_IA32)
00157 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE    0x0006
00158 #elif defined (MDE_CPU_IPF)
00159 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE    0x0002
00160 #elif defined (MDE_CPU_X64)
00161 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE    0x0007
00162 #elif defined (MDE_CPU_ARM)
00163 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE    0x000A
00164 #elif defined (MDE_CPU_AARCH64)
00165 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE    0x000B
00166 #endif
00167 
00168 
00169 ///
00170 /// Discover() server list structure.
00171 ///
00172 typedef struct {
00173   UINT16          Type;
00174   BOOLEAN         AcceptAnyResponse;
00175   UINT8           Reserved;
00176   EFI_IP_ADDRESS  IpAddr;
00177 } EFI_PXE_BASE_CODE_SRVLIST;
00178 
00179 ///
00180 /// Discover() information override structure.
00181 ///
00182 typedef struct {
00183   BOOLEAN                   UseMCast;
00184   BOOLEAN                   UseBCast;
00185   BOOLEAN                   UseUCast;
00186   BOOLEAN                   MustUseList;
00187   EFI_IP_ADDRESS            ServerMCastIp;
00188   UINT16                    IpCnt;
00189   EFI_PXE_BASE_CODE_SRVLIST SrvList[1];
00190 } EFI_PXE_BASE_CODE_DISCOVER_INFO;
00191 
00192 ///
00193 /// TFTP opcode definitions.
00194 ///
00195 typedef enum {
00196   EFI_PXE_BASE_CODE_TFTP_FIRST,
00197   EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,
00198   EFI_PXE_BASE_CODE_TFTP_READ_FILE,
00199   EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,
00200   EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,
00201   EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,
00202   EFI_PXE_BASE_CODE_MTFTP_READ_FILE,
00203   EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,
00204   EFI_PXE_BASE_CODE_MTFTP_LAST
00205 } EFI_PXE_BASE_CODE_TFTP_OPCODE;
00206 
00207 ///
00208 /// MTFTP information. This information is required
00209 /// to start or join a multicast TFTP session. It is also required to
00210 /// perform the "get file size" and "read directory" operations of MTFTP.
00211 ///
00212 typedef struct {
00213   EFI_IP_ADDRESS              MCastIp;
00214   EFI_PXE_BASE_CODE_UDP_PORT  CPort;
00215   EFI_PXE_BASE_CODE_UDP_PORT  SPort;
00216   UINT16                      ListenTimeout;
00217   UINT16                      TransmitTimeout;
00218 } EFI_PXE_BASE_CODE_MTFTP_INFO;
00219 
00220 ///
00221 /// DHCPV4 Packet structure.
00222 ///
00223 typedef struct {
00224   UINT8   BootpOpcode;
00225   UINT8   BootpHwType;
00226   UINT8   BootpHwAddrLen;
00227   UINT8   BootpGateHops;
00228   UINT32  BootpIdent;
00229   UINT16  BootpSeconds;
00230   UINT16  BootpFlags;
00231   UINT8   BootpCiAddr[4];
00232   UINT8   BootpYiAddr[4];
00233   UINT8   BootpSiAddr[4];
00234   UINT8   BootpGiAddr[4];
00235   UINT8   BootpHwAddr[16];
00236   UINT8   BootpSrvName[64];
00237   UINT8   BootpBootFile[128];
00238   UINT32  DhcpMagik;
00239   UINT8   DhcpOptions[56];
00240 } EFI_PXE_BASE_CODE_DHCPV4_PACKET;
00241 
00242 ///
00243 /// DHCPV6 Packet structure.
00244 ///
00245 typedef struct {
00246   UINT32  MessageType:8;
00247   UINT32  TransactionId:24;
00248   UINT8   DhcpOptions[1024];
00249 } EFI_PXE_BASE_CODE_DHCPV6_PACKET;
00250 
00251 ///
00252 /// Packet structure.
00253 ///
00254 typedef union {
00255   UINT8                           Raw[1472];
00256   EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;
00257   EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6;
00258 } EFI_PXE_BASE_CODE_PACKET;
00259 
00260 //
00261 // PXE Base Code Mode structure
00262 //
00263 #define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES   8
00264 #define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8
00265 
00266 ///
00267 /// EFI_PXE_BASE_CODE_MODE.
00268 /// The data values in this structure are read-only and
00269 /// are updated by the code that produces the
00270 /// EFI_PXE_BASE_CODE_PROTOCOL functions.
00271 ///
00272 typedef struct {
00273   BOOLEAN                       Started;
00274   BOOLEAN                       Ipv6Available;
00275   BOOLEAN                       Ipv6Supported;
00276   BOOLEAN                       UsingIpv6;
00277   BOOLEAN                       BisSupported;
00278   BOOLEAN                       BisDetected;
00279   BOOLEAN                       AutoArp;
00280   BOOLEAN                       SendGUID;
00281   BOOLEAN                       DhcpDiscoverValid;
00282   BOOLEAN                       DhcpAckReceived;
00283   BOOLEAN                       ProxyOfferReceived;
00284   BOOLEAN                       PxeDiscoverValid;
00285   BOOLEAN                       PxeReplyReceived;
00286   BOOLEAN                       PxeBisReplyReceived;
00287   BOOLEAN                       IcmpErrorReceived;
00288   BOOLEAN                       TftpErrorReceived;
00289   BOOLEAN                       MakeCallbacks;
00290   UINT8                         TTL;
00291   UINT8                         ToS;
00292   EFI_IP_ADDRESS                StationIp;
00293   EFI_IP_ADDRESS                SubnetMask;
00294   EFI_PXE_BASE_CODE_PACKET      DhcpDiscover;
00295   EFI_PXE_BASE_CODE_PACKET      DhcpAck;
00296   EFI_PXE_BASE_CODE_PACKET      ProxyOffer;
00297   EFI_PXE_BASE_CODE_PACKET      PxeDiscover;
00298   EFI_PXE_BASE_CODE_PACKET      PxeReply;
00299   EFI_PXE_BASE_CODE_PACKET      PxeBisReply;
00300   EFI_PXE_BASE_CODE_IP_FILTER   IpFilter;
00301   UINT32                        ArpCacheEntries;
00302   EFI_PXE_BASE_CODE_ARP_ENTRY   ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];
00303   UINT32                        RouteTableEntries;
00304   EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];
00305   EFI_PXE_BASE_CODE_ICMP_ERROR  IcmpError;
00306   EFI_PXE_BASE_CODE_TFTP_ERROR  TftpError;
00307 } EFI_PXE_BASE_CODE_MODE;
00308 
00309 //
00310 // PXE Base Code Interface Function definitions
00311 //
00312 
00313 /**
00314   Enables the use of the PXE Base Code Protocol functions.
00315 
00316   This function enables the use of the PXE Base Code Protocol functions. If the
00317   Started field of the EFI_PXE_BASE_CODE_MODE structure is already TRUE, then
00318   EFI_ALREADY_STARTED will be returned. If UseIpv6 is TRUE, then IPv6 formatted
00319   addresses will be used in this session. If UseIpv6 is FALSE, then IPv4 formatted
00320   addresses will be used in this session. If UseIpv6 is TRUE, and the Ipv6Supported
00321   field of the EFI_PXE_BASE_CODE_MODE structure is FALSE, then EFI_UNSUPPORTED will
00322   be returned. If there is not enough memory or other resources to start the PXE
00323   Base Code Protocol, then EFI_OUT_OF_RESOURCES will be returned. Otherwise, the
00324   PXE Base Code Protocol will be started, and all of the fields of the EFI_PXE_BASE_CODE_MODE
00325   structure will be initialized as follows:
00326     StartedSet to TRUE.
00327     Ipv6SupportedUnchanged.
00328     Ipv6AvailableUnchanged.
00329     UsingIpv6Set to UseIpv6.
00330     BisSupportedUnchanged.
00331     BisDetectedUnchanged.
00332     AutoArpSet to TRUE.
00333     SendGUIDSet to FALSE.
00334     TTLSet to DEFAULT_TTL.
00335     ToSSet to DEFAULT_ToS.
00336     DhcpCompletedSet to FALSE.
00337     ProxyOfferReceivedSet to FALSE.
00338     StationIpSet to an address of all zeros.
00339     SubnetMaskSet to a subnet mask of all zeros.
00340     DhcpDiscoverZero-filled.
00341     DhcpAckZero-filled.
00342     ProxyOfferZero-filled.
00343     PxeDiscoverValidSet to FALSE.
00344     PxeDiscoverZero-filled.
00345     PxeReplyValidSet to FALSE.
00346     PxeReplyZero-filled.
00347     PxeBisReplyValidSet to FALSE.
00348     PxeBisReplyZero-filled.
00349     IpFilterSet the Filters field to 0 and the IpCnt field to 0.
00350     ArpCacheEntriesSet to 0.
00351     ArpCacheZero-filled.
00352     RouteTableEntriesSet to 0.
00353     RouteTableZero-filled.
00354     IcmpErrorReceivedSet to FALSE.
00355     IcmpErrorZero-filled.
00356     TftpErroReceivedSet to FALSE.
00357     TftpErrorZero-filled.
00358     MakeCallbacksSet to TRUE if the PXE Base Code Callback Protocol is available.
00359     Set to FALSE if the PXE Base Code Callback Protocol is not available.
00360 
00361   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00362   @param  UseIpv6               Specifies the type of IP addresses that are to be used during the session
00363                                 that is being started. Set to TRUE for IPv6 addresses, and FALSE for
00364                                 IPv4 addresses.
00365 
00366   @retval EFI_SUCCESS           The PXE Base Code Protocol was started.
00367   @retval EFI_DEVICE_ERROR      The network device encountered an error during this oper
00368   @retval EFI_UNSUPPORTED       UseIpv6 is TRUE, but the Ipv6Supported field of the
00369                                 EFI_PXE_BASE_CODE_MODE structure is FALSE.
00370   @retval EFI_ALREADY_STARTED   The PXE Base Code Protocol is already in the started state.
00371   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
00372                                 EFI_PXE_BASE_CODE_PROTOCOL structure.
00373   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory or other resources to start the
00374                                 PXE Base Code Protocol.
00375 
00376 **/
00377 typedef
00378 EFI_STATUS
00379 (EFIAPI *EFI_PXE_BASE_CODE_START)(
00380   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
00381   IN BOOLEAN                               UseIpv6
00382   );
00383 
00384 /**
00385   Disables the use of the PXE Base Code Protocol functions.
00386 
00387   This function stops all activity on the network device. All the resources allocated
00388   in Start() are released, the Started field of the EFI_PXE_BASE_CODE_MODE structure is
00389   set to FALSE and EFI_SUCCESS is returned. If the Started field of the EFI_PXE_BASE_CODE_MODE
00390   structure is already FALSE, then EFI_NOT_STARTED will be returned.
00391 
00392   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00393 
00394   @retval EFI_SUCCESS           The PXE Base Code Protocol was stopped.
00395   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is already in the stopped state.
00396   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
00397                                 EFI_PXE_BASE_CODE_PROTOCOL structure.
00398   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
00399 
00400 **/
00401 typedef
00402 EFI_STATUS
00403 (EFIAPI *EFI_PXE_BASE_CODE_STOP)(
00404   IN EFI_PXE_BASE_CODE_PROTOCOL    *This
00405   );
00406 
00407 /**
00408   Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6
00409   S.A.R.R (solicit / advertise / request / reply) sequence.
00410 
00411   This function attempts to complete the DHCP sequence. If this sequence is completed,
00412   then EFI_SUCCESS is returned, and the DhcpCompleted, ProxyOfferReceived, StationIp,
00413   SubnetMask, DhcpDiscover, DhcpAck, and ProxyOffer fields of the EFI_PXE_BASE_CODE_MODE
00414   structure are filled in.
00415   If SortOffers is TRUE, then the cached DHCP offer packets will be sorted before
00416   they are tried. If SortOffers is FALSE, then the cached DHCP offer packets will
00417   be tried in the order in which they are received. Please see the Preboot Execution
00418   Environment (PXE) Specification for additional details on the implementation of DHCP.
00419   This function can take at least 31 seconds to timeout and return control to the
00420   caller. If the DHCP sequence does not complete, then EFI_TIMEOUT will be returned.
00421   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
00422   then the DHCP sequence will be stopped and EFI_ABORTED will be returned.
00423 
00424   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00425   @param  SortOffers            TRUE if the offers received should be sorted. Set to FALSE to try the
00426                                 offers in the order that they are received.
00427 
00428   @retval EFI_SUCCESS           Valid DHCP has completed.
00429   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
00430   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
00431                                 EFI_PXE_BASE_CODE_PROTOCOL structure.
00432   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
00433   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete the DHCP Protocol.
00434   @retval EFI_ABORTED           The callback function aborted the DHCP Protocol.
00435   @retval EFI_TIMEOUT           The DHCP Protocol timed out.
00436   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the DHCP session.
00437   @retval EFI_NO_RESPONSE       Valid PXE offer was not received.
00438 
00439 **/
00440 typedef
00441 EFI_STATUS
00442 (EFIAPI *EFI_PXE_BASE_CODE_DHCP)(
00443   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
00444   IN BOOLEAN                               SortOffers
00445   );
00446 
00447 /**
00448   Attempts to complete the PXE Boot Server and/or boot image discovery sequence.
00449 
00450   This function attempts to complete the PXE Boot Server and/or boot image discovery
00451   sequence. If this sequence is completed, then EFI_SUCCESS is returned, and the
00452   PxeDiscoverValid, PxeDiscover, PxeReplyReceived, and PxeReply fields of the
00453   EFI_PXE_BASE_CODE_MODE structure are filled in. If UseBis is TRUE, then the
00454   PxeBisReplyReceived and PxeBisReply fields of the EFI_PXE_BASE_CODE_MODE structure
00455   will also be filled in. If UseBis is FALSE, then PxeBisReplyValid will be set to FALSE.
00456   In the structure referenced by parameter Info, the PXE Boot Server list, SrvList[],
00457   has two uses: It is the Boot Server IP address list used for unicast discovery
00458   (if the UseUCast field is TRUE), and it is the list used for Boot Server verification
00459   (if the MustUseList field is TRUE). Also, if the MustUseList field in that structure
00460   is TRUE and the AcceptAnyResponse field in the SrvList[] array is TRUE, any Boot
00461   Server reply of that type will be accepted. If the AcceptAnyResponse field is
00462   FALSE, only responses from Boot Servers with matching IP addresses will be accepted.
00463   This function can take at least 10 seconds to timeout and return control to the
00464   caller. If the Discovery sequence does not complete, then EFI_TIMEOUT will be
00465   returned. Please see the Preboot Execution Environment (PXE) Specification for
00466   additional details on the implementation of the Discovery sequence.
00467   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
00468   then the Discovery sequence is stopped and EFI_ABORTED will be returned.
00469 
00470   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00471   @param  Type                  The type of bootstrap to perform.
00472   @param  Layer                 The pointer to the boot server layer number to discover, which must be
00473                                 PXE_BOOT_LAYER_INITIAL when a new server type is being
00474                                 discovered.
00475   @param  UseBis                TRUE if Boot Integrity Services are to be used. FALSE otherwise.
00476   @param  Info                  The pointer to a data structure that contains additional information on the
00477                                 type of discovery operation that is to be performed.
00478 
00479   @retval EFI_SUCCESS           The Discovery sequence has been completed.
00480   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
00481   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00482   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
00483   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete Discovery.
00484   @retval EFI_ABORTED           The callback function aborted the Discovery sequence.
00485   @retval EFI_TIMEOUT           The Discovery sequence timed out.
00486   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the PXE discovery
00487                                 session.
00488 
00489 **/
00490 typedef
00491 EFI_STATUS
00492 (EFIAPI *EFI_PXE_BASE_CODE_DISCOVER)(
00493   IN EFI_PXE_BASE_CODE_PROTOCOL           *This,
00494   IN UINT16                               Type,
00495   IN UINT16                               *Layer,
00496   IN BOOLEAN                              UseBis,
00497   IN EFI_PXE_BASE_CODE_DISCOVER_INFO      *Info   OPTIONAL
00498   );
00499 
00500 /**
00501   Used to perform TFTP and MTFTP services.
00502 
00503   This function is used to perform TFTP and MTFTP services. This includes the
00504   TFTP operations to get the size of a file, read a directory, read a file, and
00505   write a file. It also includes the MTFTP operations to get the size of a file,
00506   read a directory, and read a file. The type of operation is specified by Operation.
00507   If the callback function that is invoked during the TFTP/MTFTP operation does
00508   not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will
00509   be returned.
00510   For read operations, the return data will be placed in the buffer specified by
00511   BufferPtr. If BufferSize is too small to contain the entire downloaded file,
00512   then EFI_BUFFER_TOO_SMALL will be returned and BufferSize will be set to zero
00513   or the size of the requested file (the size of the requested file is only returned
00514   if the TFTP server supports TFTP options). If BufferSize is large enough for the
00515   read operation, then BufferSize will be set to the size of the downloaded file,
00516   and EFI_SUCCESS will be returned. Applications using the PxeBc.Mtftp() services
00517   should use the get-file-size operations to determine the size of the downloaded
00518   file prior to using the read-file operations--especially when downloading large
00519   (greater than 64 MB) files--instead of making two calls to the read-file operation.
00520   Following this recommendation will save time if the file is larger than expected
00521   and the TFTP server does not support TFTP option extensions. Without TFTP option
00522   extension support, the client has to download the entire file, counting and discarding
00523   the received packets, to determine the file size.
00524   For write operations, the data to be sent is in the buffer specified by BufferPtr.
00525   BufferSize specifies the number of bytes to send. If the write operation completes
00526   successfully, then EFI_SUCCESS will be returned.
00527   For TFTP "get file size" operations, the size of the requested file or directory
00528   is returned in BufferSize, and EFI_SUCCESS will be returned. If the TFTP server
00529   does not support options, the file will be downloaded into a bit bucket and the
00530   length of the downloaded file will be returned. For MTFTP "get file size" operations,
00531   if the MTFTP server does not support the "get file size" option, EFI_UNSUPPORTED
00532   will be returned.
00533   This function can take up to 10 seconds to timeout and return control to the caller.
00534   If the TFTP sequence does not complete, EFI_TIMEOUT will be returned.
00535   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
00536   then the TFTP sequence is stopped and EFI_ABORTED will be returned.
00537   The format of the data returned from a TFTP read directory operation is a null-terminated
00538   filename followed by a null-terminated information string, of the form
00539   "size year-month-day hour:minute:second" (i.e. %d %d-%d-%d %d:%d:%f - note that
00540   the seconds field can be a decimal number), where the date and time are UTC. For
00541   an MTFTP read directory command, there is additionally a null-terminated multicast
00542   IP address preceding the filename of the form %d.%d.%d.%d for IP v4. The final
00543   entry is itself null-terminated, so that the final information string is terminated
00544   with two null octets.
00545 
00546   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00547   @param  Operation             The type of operation to perform.
00548   @param  BufferPtr             A pointer to the data buffer.
00549   @param  Overwrite             Only used on write file operations. TRUE if a file on a remote server can
00550                                 be overwritten.
00551   @param  BufferSize            For get-file-size operations, *BufferSize returns the size of the
00552                                 requested file.
00553   @param  BlockSize             The requested block size to be used during a TFTP transfer.
00554   @param  ServerIp              The TFTP / MTFTP server IP address.
00555   @param  Filename              A Null-terminated ASCII string that specifies a directory name or a file
00556                                 name.
00557   @param  Info                  The pointer to the MTFTP information.
00558   @param  DontUseBuffer         Set to FALSE for normal TFTP and MTFTP read file operation.
00559 
00560   @retval EFI_SUCCESS           The TFTP/MTFTP operation was completed.
00561   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
00562   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00563   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
00564   @retval EFI_BUFFER_TOO_SMALL  The buffer is not large enough to complete the read operation.
00565   @retval EFI_ABORTED           The callback function aborted the TFTP/MTFTP operation.
00566   @retval EFI_TIMEOUT           The TFTP/MTFTP operation timed out.
00567   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the MTFTP session.
00568   @retval EFI_TFTP_ERROR        A TFTP error packet was received during the MTFTP session.
00569 
00570 **/
00571 typedef
00572 EFI_STATUS
00573 (EFIAPI *EFI_PXE_BASE_CODE_MTFTP)(
00574   IN EFI_PXE_BASE_CODE_PROTOCOL                *This,
00575   IN EFI_PXE_BASE_CODE_TFTP_OPCODE             Operation,
00576   IN OUT VOID                                  *BufferPtr OPTIONAL,
00577   IN BOOLEAN                                   Overwrite,
00578   IN OUT UINT64                                *BufferSize,
00579   IN UINTN                                     *BlockSize OPTIONAL,
00580   IN EFI_IP_ADDRESS                            *ServerIp,
00581   IN UINT8                                     *Filename  OPTIONAL,
00582   IN EFI_PXE_BASE_CODE_MTFTP_INFO              *Info      OPTIONAL,
00583   IN BOOLEAN                                   DontUseBuffer
00584   );
00585 
00586 /**
00587   Writes a UDP packet to the network interface.
00588 
00589   This function writes a UDP packet specified by the (optional HeaderPtr and)
00590   BufferPtr parameters to the network interface. The UDP header is automatically
00591   built by this routine. It uses the parameters OpFlags, DestIp, DestPort, GatewayIp,
00592   SrcIp, and SrcPort to build this header. If the packet is successfully built and
00593   transmitted through the network interface, then EFI_SUCCESS will be returned.
00594   If a timeout occurs during the transmission of the packet, then EFI_TIMEOUT will
00595   be returned. If an ICMP error occurs during the transmission of the packet, then
00596   the IcmpErrorReceived field is set to TRUE, the IcmpError field is filled in and
00597   EFI_ICMP_ERROR will be returned. If the Callback Protocol does not return
00598   EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will be returned.
00599 
00600   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00601   @param  OpFlags               The UDP operation flags.
00602   @param  DestIp                The destination IP address.
00603   @param  DestPort              The destination UDP port number.
00604   @param  GatewayIp             The gateway IP address.
00605   @param  SrcIp                 The source IP address.
00606   @param  SrcPort               The source UDP port number.
00607   @param  HeaderSize            An optional field which may be set to the length of a header at
00608                                 HeaderPtr to be prefixed to the data at BufferPtr.
00609   @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the
00610                                 data at BufferPtr.
00611   @param  BufferSize            A pointer to the size of the data at BufferPtr.
00612   @param  BufferPtr             A pointer to the data to be written.
00613 
00614   @retval EFI_SUCCESS           The UDP Write operation was completed.
00615   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
00616   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00617   @retval EFI_BAD_BUFFER_SIZE   The buffer is too long to be transmitted.
00618   @retval EFI_ABORTED           The callback function aborted the UDP Write operation.
00619   @retval EFI_TIMEOUT           The UDP Write operation timed out.
00620   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the UDP write session.
00621 
00622 **/
00623 typedef
00624 EFI_STATUS
00625 (EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE)(
00626   IN EFI_PXE_BASE_CODE_PROTOCOL                *This,
00627   IN UINT16                                    OpFlags,
00628   IN EFI_IP_ADDRESS                            *DestIp,
00629   IN EFI_PXE_BASE_CODE_UDP_PORT                *DestPort,
00630   IN EFI_IP_ADDRESS                            *GatewayIp,  OPTIONAL
00631   IN EFI_IP_ADDRESS                            *SrcIp,      OPTIONAL
00632   IN OUT EFI_PXE_BASE_CODE_UDP_PORT            *SrcPort,    OPTIONAL
00633   IN UINTN                                     *HeaderSize, OPTIONAL
00634   IN VOID                                      *HeaderPtr,  OPTIONAL
00635   IN UINTN                                     *BufferSize,
00636   IN VOID                                      *BufferPtr
00637   );
00638 
00639 /**
00640   Reads a UDP packet from the network interface.
00641 
00642   This function reads a UDP packet from a network interface. The data contents
00643   are returned in (the optional HeaderPtr and) BufferPtr, and the size of the
00644   buffer received is returned in BufferSize. If the input BufferSize is smaller
00645   than the UDP packet received (less optional HeaderSize), it will be set to the
00646   required size, and EFI_BUFFER_TOO_SMALL will be returned. In this case, the
00647   contents of BufferPtr are undefined, and the packet is lost. If a UDP packet is
00648   successfully received, then EFI_SUCCESS will be returned, and the information
00649   from the UDP header will be returned in DestIp, DestPort, SrcIp, and SrcPort if
00650   they are not NULL.
00651   Depending on the values of OpFlags and the DestIp, DestPort, SrcIp, and SrcPort
00652   input values, different types of UDP packet receive filtering will be performed.
00653   The following tables summarize these receive filter operations.
00654 
00655   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00656   @param  OpFlags               The UDP operation flags.
00657   @param  DestIp                The destination IP address.
00658   @param  DestPort              The destination UDP port number.
00659   @param  SrcIp                 The source IP address.
00660   @param  SrcPort               The source UDP port number.
00661   @param  HeaderSize            An optional field which may be set to the length of a header at
00662                                 HeaderPtr to be prefixed to the data at BufferPtr.
00663   @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the
00664                                 data at BufferPtr.
00665   @param  BufferSize            A pointer to the size of the data at BufferPtr.
00666   @param  BufferPtr             A pointer to the data to be read.
00667 
00668   @retval EFI_SUCCESS           The UDP Read operation was completed.
00669   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
00670   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00671   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
00672   @retval EFI_BUFFER_TOO_SMALL  The packet is larger than Buffer can hold.
00673   @retval EFI_ABORTED           The callback function aborted the UDP Read operation.
00674   @retval EFI_TIMEOUT           The UDP Read operation timed out.
00675 
00676 **/
00677 typedef
00678 EFI_STATUS
00679 (EFIAPI *EFI_PXE_BASE_CODE_UDP_READ)(
00680   IN EFI_PXE_BASE_CODE_PROTOCOL                *This,
00681   IN UINT16                                    OpFlags,
00682   IN OUT EFI_IP_ADDRESS                        *DestIp,     OPTIONAL
00683   IN OUT EFI_PXE_BASE_CODE_UDP_PORT            *DestPort,   OPTIONAL
00684   IN OUT EFI_IP_ADDRESS                        *SrcIp,      OPTIONAL
00685   IN OUT EFI_PXE_BASE_CODE_UDP_PORT            *SrcPort,    OPTIONAL
00686   IN UINTN                                     *HeaderSize, OPTIONAL
00687   IN VOID                                      *HeaderPtr,  OPTIONAL
00688   IN OUT UINTN                                 *BufferSize,
00689   IN VOID                                      *BufferPtr
00690   );
00691 
00692 /**
00693   Updates the IP receive filters of a network device and enables software filtering.
00694 
00695   The NewFilter field is used to modify the network device's current IP receive
00696   filter settings and to enable a software filter. This function updates the IpFilter
00697   field of the EFI_PXE_BASE_CODE_MODE structure with the contents of NewIpFilter.
00698   The software filter is used when the USE_FILTER in OpFlags is set to UdpRead().
00699   The current hardware filter remains in effect no matter what the settings of OpFlags
00700   are, so that the meaning of ANY_DEST_IP set in OpFlags to UdpRead() is from those
00701   packets whose reception is enabled in hardware - physical NIC address (unicast),
00702   broadcast address, logical address or addresses (multicast), or all (promiscuous).
00703   UdpRead() does not modify the IP filter settings.
00704   Dhcp(), Discover(), and Mtftp() set the IP filter, and return with the IP receive
00705   filter list emptied and the filter set to EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP.
00706   If an application or driver wishes to preserve the IP receive filter settings,
00707   it will have to preserve the IP receive filter settings before these calls, and
00708   use SetIpFilter() to restore them after the calls. If incompatible filtering is
00709   requested (for example, PROMISCUOUS with anything else), or if the device does not
00710   support a requested filter setting and it cannot be accommodated in software
00711   (for example, PROMISCUOUS not supported), EFI_INVALID_PARAMETER will be returned.
00712   The IPlist field is used to enable IPs other than the StationIP. They may be
00713   multicast or unicast. If IPcnt is set as well as EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP,
00714   then both the StationIP and the IPs from the IPlist will be used.
00715 
00716   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00717   @param  NewFilter             The pointer to the new set of IP receive filters.
00718 
00719   @retval EFI_SUCCESS           The IP receive filter settings were updated.
00720   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
00721   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00722 
00723 **/
00724 typedef
00725 EFI_STATUS
00726 (EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER)(
00727   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
00728   IN EFI_PXE_BASE_CODE_IP_FILTER           *NewFilter
00729   );
00730 
00731 /**
00732   Uses the ARP protocol to resolve a MAC address.
00733 
00734   This function uses the ARP protocol to resolve a MAC address. The UsingIpv6 field
00735   of the EFI_PXE_BASE_CODE_MODE structure is used to determine if IPv4 or IPv6
00736   addresses are being used. The IP address specified by IpAddr is used to resolve
00737   a MAC address. If the ARP protocol succeeds in resolving the specified address,
00738   then the ArpCacheEntries and ArpCache fields of the EFI_PXE_BASE_CODE_MODE structure
00739   are updated, and EFI_SUCCESS is returned. If MacAddr is not NULL, the resolved
00740   MAC address is placed there as well.
00741   If the PXE Base Code protocol is in the stopped state, then EFI_NOT_STARTED is
00742   returned. If the ARP protocol encounters a timeout condition while attempting
00743   to resolve an address, then EFI_TIMEOUT is returned. If the Callback Protocol
00744   does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED is
00745   returned.
00746 
00747   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00748   @param  IpAddr                The pointer to the IP address that is used to resolve a MAC address.
00749   @param  MacAddr               If not NULL, a pointer to the MAC address that was resolved with the
00750                                 ARP protocol.
00751 
00752   @retval EFI_SUCCESS           The IP or MAC address was resolved.
00753   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
00754   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00755   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
00756   @retval EFI_ABORTED           The callback function aborted the ARP Protocol.
00757   @retval EFI_TIMEOUT           The ARP Protocol encountered a timeout condition.
00758 
00759 **/
00760 typedef
00761 EFI_STATUS
00762 (EFIAPI *EFI_PXE_BASE_CODE_ARP)(
00763   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
00764   IN EFI_IP_ADDRESS                        *IpAddr,
00765   IN EFI_MAC_ADDRESS                       *MacAddr OPTIONAL
00766   );
00767 
00768 /**
00769   Updates the parameters that affect the operation of the PXE Base Code Protocol.
00770 
00771   This function sets parameters that affect the operation of the PXE Base Code Protocol.
00772   The parameter specified by NewAutoArp is used to control the generation of ARP
00773   protocol packets. If NewAutoArp is TRUE, then ARP Protocol packets will be generated
00774   as required by the PXE Base Code Protocol. If NewAutoArp is FALSE, then no ARP
00775   Protocol packets will be generated. In this case, the only mappings that are
00776   available are those stored in the ArpCache of the EFI_PXE_BASE_CODE_MODE structure.
00777   If there are not enough mappings in the ArpCache to perform a PXE Base Code Protocol
00778   service, then the service will fail. This function updates the AutoArp field of
00779   the EFI_PXE_BASE_CODE_MODE structure to NewAutoArp.
00780   The SetParameters() call must be invoked after a Callback Protocol is installed
00781   to enable the use of callbacks.
00782 
00783   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00784   @param  NewAutoArp            If not NULL, a pointer to a value that specifies whether to replace the
00785                                 current value of AutoARP.
00786   @param  NewSendGUID           If not NULL, a pointer to a value that specifies whether to replace the
00787                                 current value of SendGUID.
00788   @param  NewTTL                If not NULL, a pointer to be used in place of the current value of TTL,
00789                                 the "time to live" field of the IP header.
00790   @param  NewToS                If not NULL, a pointer to be used in place of the current value of ToS,
00791                                 the "type of service" field of the IP header.
00792   @param  NewMakeCallback       If not NULL, a pointer to a value that specifies whether to replace the
00793                                 current value of the MakeCallback field of the Mode structure.
00794 
00795   @retval EFI_SUCCESS           The new parameters values were updated.
00796   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
00797   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00798 
00799 **/
00800 typedef
00801 EFI_STATUS
00802 (EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS)(
00803   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
00804   IN BOOLEAN                               *NewAutoArp,     OPTIONAL
00805   IN BOOLEAN                               *NewSendGUID,    OPTIONAL
00806   IN UINT8                                 *NewTTL,         OPTIONAL
00807   IN UINT8                                 *NewToS,         OPTIONAL
00808   IN BOOLEAN                               *NewMakeCallback OPTIONAL
00809   );
00810 
00811 /**
00812   Updates the station IP address and/or subnet mask values of a network device.
00813 
00814   This function updates the station IP address and/or subnet mask values of a network
00815   device.
00816   The NewStationIp field is used to modify the network device's current IP address.
00817   If NewStationIP is NULL, then the current IP address will not be modified. Otherwise,
00818   this function updates the StationIp field of the EFI_PXE_BASE_CODE_MODE structure
00819   with NewStationIp.
00820   The NewSubnetMask field is used to modify the network device's current subnet
00821   mask. If NewSubnetMask is NULL, then the current subnet mask will not be modified.
00822   Otherwise, this function updates the SubnetMask field of the EFI_PXE_BASE_CODE_MODE
00823   structure with NewSubnetMask.
00824 
00825   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00826   @param  NewStationIp          The pointer to the new IP address to be used by the network device.
00827   @param  NewSubnetMask         The pointer to the new subnet mask to be used by the network device.
00828 
00829   @retval EFI_SUCCESS           The new station IP address and/or subnet mask were updated.
00830   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
00831   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
00832 
00833 **/
00834 typedef
00835 EFI_STATUS
00836 (EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP)(
00837   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
00838   IN EFI_IP_ADDRESS                        *NewStationIp,   OPTIONAL
00839   IN EFI_IP_ADDRESS                        *NewSubnetMask   OPTIONAL
00840   );
00841 
00842 /**
00843   Updates the contents of the cached DHCP and Discover packets.
00844 
00845   The pointers to the new packets are used to update the contents of the cached
00846   packets in the EFI_PXE_BASE_CODE_MODE structure.
00847 
00848   @param  This                   The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
00849   @param  NewDhcpDiscoverValid   The pointer to a value that will replace the current
00850                                  DhcpDiscoverValid field.
00851   @param  NewDhcpAckReceived     The pointer to a value that will replace the current
00852                                  DhcpAckReceived field.
00853   @param  NewProxyOfferReceived  The pointer to a value that will replace the current
00854                                  ProxyOfferReceived field.
00855   @param  NewPxeDiscoverValid    The pointer to a value that will replace the current
00856                                  ProxyOfferReceived field.
00857   @param  NewPxeReplyReceived    The pointer to a value that will replace the current
00858                                  PxeReplyReceived field.
00859   @param  NewPxeBisReplyReceived The pointer to a value that will replace the current
00860                                  PxeBisReplyReceived field.
00861   @param  NewDhcpDiscover        The pointer to the new cached DHCP Discover packet contents.
00862   @param  NewDhcpAck             The pointer to the new cached DHCP Ack packet contents.
00863   @param  NewProxyOffer          The pointer to the new cached Proxy Offer packet contents.
00864   @param  NewPxeDiscover         The pointer to the new cached PXE Discover packet contents.
00865   @param  NewPxeReply            The pointer to the new cached PXE Reply packet contents.
00866   @param  NewPxeBisReply         The pointer to the new cached PXE BIS Reply packet contents.
00867 
00868   @retval EFI_SUCCESS            The cached packet contents were updated.
00869   @retval EFI_NOT_STARTED        The PXE Base Code Protocol is in the stopped state.
00870   @retval EFI_INVALID_PARAMETER  This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.
00871 
00872 **/
00873 typedef
00874 EFI_STATUS
00875 (EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS)(
00876   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
00877   BOOLEAN                                  *NewDhcpDiscoverValid,   OPTIONAL
00878   BOOLEAN                                  *NewDhcpAckReceived,     OPTIONAL
00879   BOOLEAN                                  *NewProxyOfferReceived,  OPTIONAL
00880   BOOLEAN                                  *NewPxeDiscoverValid,    OPTIONAL
00881   BOOLEAN                                  *NewPxeReplyReceived,    OPTIONAL
00882   BOOLEAN                                  *NewPxeBisReplyReceived, OPTIONAL
00883   IN EFI_PXE_BASE_CODE_PACKET              *NewDhcpDiscover,        OPTIONAL
00884   IN EFI_PXE_BASE_CODE_PACKET              *NewDhcpAck,             OPTIONAL
00885   IN EFI_PXE_BASE_CODE_PACKET              *NewProxyOffer,          OPTIONAL
00886   IN EFI_PXE_BASE_CODE_PACKET              *NewPxeDiscover,         OPTIONAL
00887   IN EFI_PXE_BASE_CODE_PACKET              *NewPxeReply,            OPTIONAL
00888   IN EFI_PXE_BASE_CODE_PACKET              *NewPxeBisReply          OPTIONAL
00889   );
00890 
00891 //
00892 // PXE Base Code Protocol structure
00893 //
00894 #define EFI_PXE_BASE_CODE_PROTOCOL_REVISION   0x00010000
00895 
00896 //
00897 // Revision defined in EFI1.1
00898 //
00899 #define EFI_PXE_BASE_CODE_INTERFACE_REVISION  EFI_PXE_BASE_CODE_PROTOCOL_REVISION
00900 
00901 ///
00902 /// The EFI_PXE_BASE_CODE_PROTOCOL is used to control PXE-compatible devices.
00903 /// An EFI_PXE_BASE_CODE_PROTOCOL will be layered on top of an
00904 /// EFI_MANAGED_NETWORK_PROTOCOL protocol in order to perform packet level transactions.
00905 /// The EFI_PXE_BASE_CODE_PROTOCOL handle also supports the
00906 /// EFI_LOAD_FILE_PROTOCOL protocol. This provides a clean way to obtain control from the
00907 /// boot manager if the boot path is from the remote device.
00908 ///
00909 struct _EFI_PXE_BASE_CODE_PROTOCOL {
00910   ///
00911   ///  The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must
00912   ///  be backwards compatible. If a future version is not backwards compatible
00913   ///  it is not the same GUID.
00914   ///
00915   UINT64                            Revision;
00916   EFI_PXE_BASE_CODE_START           Start;
00917   EFI_PXE_BASE_CODE_STOP            Stop;
00918   EFI_PXE_BASE_CODE_DHCP            Dhcp;
00919   EFI_PXE_BASE_CODE_DISCOVER        Discover;
00920   EFI_PXE_BASE_CODE_MTFTP           Mtftp;
00921   EFI_PXE_BASE_CODE_UDP_WRITE       UdpWrite;
00922   EFI_PXE_BASE_CODE_UDP_READ        UdpRead;
00923   EFI_PXE_BASE_CODE_SET_IP_FILTER   SetIpFilter;
00924   EFI_PXE_BASE_CODE_ARP             Arp;
00925   EFI_PXE_BASE_CODE_SET_PARAMETERS  SetParameters;
00926   EFI_PXE_BASE_CODE_SET_STATION_IP  SetStationIp;
00927   EFI_PXE_BASE_CODE_SET_PACKETS     SetPackets;
00928   ///
00929   /// The pointer to the EFI_PXE_BASE_CODE_MODE data for this device.
00930   ///
00931   EFI_PXE_BASE_CODE_MODE            *Mode;
00932 };
00933 
00934 extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;
00935 
00936 #endif