1 /** @file
2   EFI PXE Base Code Protocol definitions, which is used to access PXE-compatible
3   devices for network access and network booting.
4 
5 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
6 Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
7 
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9 
10   @par Revision Reference:
11   This Protocol is introduced in EFI Specification 1.10.
12 
13 **/
14 
15 #ifndef __PXE_BASE_CODE_PROTOCOL_H__
16 #define __PXE_BASE_CODE_PROTOCOL_H__
17 
18 ///
19 /// PXE Base Code protocol.
20 ///
21 #define EFI_PXE_BASE_CODE_PROTOCOL_GUID \
22   { \
23     0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
24   }
25 
26 typedef struct _EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE_PROTOCOL;
27 
28 ///
29 /// Protocol defined in EFI1.1.
30 ///
31 typedef EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE;
32 
33 ///
34 /// Default IP TTL and ToS.
35 ///
36 #define DEFAULT_TTL  16
37 #define DEFAULT_ToS  0
38 
39 ///
40 /// ICMP error format.
41 ///
42 typedef struct {
43   UINT8     Type;
44   UINT8     Code;
45   UINT16    Checksum;
46   union {
47     UINT32    reserved;
48     UINT32    Mtu;
49     UINT32    Pointer;
50     struct {
51       UINT16    Identifier;
52       UINT16    Sequence;
53     } Echo;
54   } u;
55   UINT8    Data[494];
56 } EFI_PXE_BASE_CODE_ICMP_ERROR;
57 
58 ///
59 /// TFTP error format.
60 ///
61 typedef struct {
62   UINT8    ErrorCode;
63   CHAR8    ErrorString[127];
64 } EFI_PXE_BASE_CODE_TFTP_ERROR;
65 
66 ///
67 /// IP Receive Filter definitions.
68 ///
69 #define EFI_PXE_BASE_CODE_MAX_IPCNT  8
70 
71 ///
72 /// IP Receive Filter structure.
73 ///
74 typedef struct {
75   UINT8             Filters;
76   UINT8             IpCnt;
77   UINT16            reserved;
78   EFI_IP_ADDRESS    IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];
79 } EFI_PXE_BASE_CODE_IP_FILTER;
80 
81 #define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP             0x0001
82 #define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST              0x0002
83 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS            0x0004
84 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST  0x0008
85 
86 ///
87 /// ARP cache entries.
88 ///
89 typedef struct {
90   EFI_IP_ADDRESS     IpAddr;
91   EFI_MAC_ADDRESS    MacAddr;
92 } EFI_PXE_BASE_CODE_ARP_ENTRY;
93 
94 ///
95 /// ARP route table entries.
96 ///
97 typedef struct {
98   EFI_IP_ADDRESS    IpAddr;
99   EFI_IP_ADDRESS    SubnetMask;
100   EFI_IP_ADDRESS    GwAddr;
101 } EFI_PXE_BASE_CODE_ROUTE_ENTRY;
102 
103 //
104 // UDP definitions
105 //
106 typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;
107 
108 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP     0x0001
109 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT   0x0002
110 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP    0x0004
111 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT  0x0008
112 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER     0x0010
113 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT   0x0020
114 
115 //
116 // Discover() definitions
117 //
118 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP         0
119 #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS      1
120 #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM         2
121 #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI           3
122 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO        4
123 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD          5
124 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM          6
125 #define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG  7
126 #define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW       8
127 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9         9
128 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10        10
129 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11        11
130 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12       12
131 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL    13
132 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT       14
133 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO             15
134 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT           16
135 //
136 // 17 through 32767 are reserved
137 // 32768 through 65279 are for vendor use
138 // 65280 through 65534 are reserved
139 //
140 #define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST  65535
141 
142 #define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK     0x7FFF
143 #define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL  0x0000
144 
145 //
146 // PXE Tag definition that identifies the processor
147 // and programming environment of the client system.
148 // These identifiers are defined by IETF:
149 // http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml
150 //
151 #if defined (MDE_CPU_IA32)
152 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE  0x0006
153 #elif defined (MDE_CPU_X64)
154 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE  0x0007
155 #elif defined (MDE_CPU_ARM)
156 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE  0x000A
157 #elif defined (MDE_CPU_AARCH64)
158 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE  0x000B
159 #elif defined (MDE_CPU_RISCV64)
160 #define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE  0x001B
161 #endif
162 
163 ///
164 /// Discover() server list structure.
165 ///
166 typedef struct {
167   UINT16            Type;
168   BOOLEAN           AcceptAnyResponse;
169   UINT8             Reserved;
170   EFI_IP_ADDRESS    IpAddr;
171 } EFI_PXE_BASE_CODE_SRVLIST;
172 
173 ///
174 /// Discover() information override structure.
175 ///
176 typedef struct {
177   BOOLEAN                      UseMCast;
178   BOOLEAN                      UseBCast;
179   BOOLEAN                      UseUCast;
180   BOOLEAN                      MustUseList;
181   EFI_IP_ADDRESS               ServerMCastIp;
182   UINT16                       IpCnt;
183   EFI_PXE_BASE_CODE_SRVLIST    SrvList[1];
184 } EFI_PXE_BASE_CODE_DISCOVER_INFO;
185 
186 ///
187 /// TFTP opcode definitions.
188 ///
189 typedef enum {
190   EFI_PXE_BASE_CODE_TFTP_FIRST,
191   EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,
192   EFI_PXE_BASE_CODE_TFTP_READ_FILE,
193   EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,
194   EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,
195   EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,
196   EFI_PXE_BASE_CODE_MTFTP_READ_FILE,
197   EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,
198   EFI_PXE_BASE_CODE_MTFTP_LAST
199 } EFI_PXE_BASE_CODE_TFTP_OPCODE;
200 
201 ///
202 /// MTFTP information. This information is required
203 /// to start or join a multicast TFTP session. It is also required to
204 /// perform the "get file size" and "read directory" operations of MTFTP.
205 ///
206 typedef struct {
207   EFI_IP_ADDRESS                MCastIp;
208   EFI_PXE_BASE_CODE_UDP_PORT    CPort;
209   EFI_PXE_BASE_CODE_UDP_PORT    SPort;
210   UINT16                        ListenTimeout;
211   UINT16                        TransmitTimeout;
212 } EFI_PXE_BASE_CODE_MTFTP_INFO;
213 
214 ///
215 /// DHCPV4 Packet structure.
216 ///
217 typedef struct {
218   UINT8     BootpOpcode;
219   UINT8     BootpHwType;
220   UINT8     BootpHwAddrLen;
221   UINT8     BootpGateHops;
222   UINT32    BootpIdent;
223   UINT16    BootpSeconds;
224   UINT16    BootpFlags;
225   UINT8     BootpCiAddr[4];
226   UINT8     BootpYiAddr[4];
227   UINT8     BootpSiAddr[4];
228   UINT8     BootpGiAddr[4];
229   UINT8     BootpHwAddr[16];
230   UINT8     BootpSrvName[64];
231   UINT8     BootpBootFile[128];
232   UINT32    DhcpMagik;
233   UINT8     DhcpOptions[56];
234 } EFI_PXE_BASE_CODE_DHCPV4_PACKET;
235 
236 ///
237 /// DHCPV6 Packet structure.
238 ///
239 typedef struct {
240   UINT32    MessageType   : 8;
241   UINT32    TransactionId : 24;
242   UINT8     DhcpOptions[1024];
243 } EFI_PXE_BASE_CODE_DHCPV6_PACKET;
244 
245 ///
246 /// Packet structure.
247 ///
248 typedef union {
249   UINT8                              Raw[1472];
250   EFI_PXE_BASE_CODE_DHCPV4_PACKET    Dhcpv4;
251   EFI_PXE_BASE_CODE_DHCPV6_PACKET    Dhcpv6;
252 } EFI_PXE_BASE_CODE_PACKET;
253 
254 //
255 // PXE Base Code Mode structure
256 //
257 #define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES    8
258 #define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES  8
259 
260 ///
261 /// EFI_PXE_BASE_CODE_MODE.
262 /// The data values in this structure are read-only and
263 /// are updated by the code that produces the
264 /// EFI_PXE_BASE_CODE_PROTOCOL functions.
265 ///
266 typedef struct {
267   BOOLEAN                          Started;
268   BOOLEAN                          Ipv6Available;
269   BOOLEAN                          Ipv6Supported;
270   BOOLEAN                          UsingIpv6;
271   BOOLEAN                          BisSupported;
272   BOOLEAN                          BisDetected;
273   BOOLEAN                          AutoArp;
274   BOOLEAN                          SendGUID;
275   BOOLEAN                          DhcpDiscoverValid;
276   BOOLEAN                          DhcpAckReceived;
277   BOOLEAN                          ProxyOfferReceived;
278   BOOLEAN                          PxeDiscoverValid;
279   BOOLEAN                          PxeReplyReceived;
280   BOOLEAN                          PxeBisReplyReceived;
281   BOOLEAN                          IcmpErrorReceived;
282   BOOLEAN                          TftpErrorReceived;
283   BOOLEAN                          MakeCallbacks;
284   UINT8                            TTL;
285   UINT8                            ToS;
286   EFI_IP_ADDRESS                   StationIp;
287   EFI_IP_ADDRESS                   SubnetMask;
288   EFI_PXE_BASE_CODE_PACKET         DhcpDiscover;
289   EFI_PXE_BASE_CODE_PACKET         DhcpAck;
290   EFI_PXE_BASE_CODE_PACKET         ProxyOffer;
291   EFI_PXE_BASE_CODE_PACKET         PxeDiscover;
292   EFI_PXE_BASE_CODE_PACKET         PxeReply;
293   EFI_PXE_BASE_CODE_PACKET         PxeBisReply;
294   EFI_PXE_BASE_CODE_IP_FILTER      IpFilter;
295   UINT32                           ArpCacheEntries;
296   EFI_PXE_BASE_CODE_ARP_ENTRY      ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];
297   UINT32                           RouteTableEntries;
298   EFI_PXE_BASE_CODE_ROUTE_ENTRY    RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];
299   EFI_PXE_BASE_CODE_ICMP_ERROR     IcmpError;
300   EFI_PXE_BASE_CODE_TFTP_ERROR     TftpError;
301 } EFI_PXE_BASE_CODE_MODE;
302 
303 //
304 // PXE Base Code Interface Function definitions
305 //
306 
307 /**
308   Enables the use of the PXE Base Code Protocol functions.
309 
310   This function enables the use of the PXE Base Code Protocol functions. If the
311   Started field of the EFI_PXE_BASE_CODE_MODE structure is already TRUE, then
312   EFI_ALREADY_STARTED will be returned. If UseIpv6 is TRUE, then IPv6 formatted
313   addresses will be used in this session. If UseIpv6 is FALSE, then IPv4 formatted
314   addresses will be used in this session. If UseIpv6 is TRUE, and the Ipv6Supported
315   field of the EFI_PXE_BASE_CODE_MODE structure is FALSE, then EFI_UNSUPPORTED will
316   be returned. If there is not enough memory or other resources to start the PXE
317   Base Code Protocol, then EFI_OUT_OF_RESOURCES will be returned. Otherwise, the
318   PXE Base Code Protocol will be started, and all of the fields of the EFI_PXE_BASE_CODE_MODE
319   structure will be initialized as follows:
320     StartedSet to TRUE.
321     Ipv6SupportedUnchanged.
322     Ipv6AvailableUnchanged.
323     UsingIpv6Set to UseIpv6.
324     BisSupportedUnchanged.
325     BisDetectedUnchanged.
326     AutoArpSet to TRUE.
327     SendGUIDSet to FALSE.
328     TTLSet to DEFAULT_TTL.
329     ToSSet to DEFAULT_ToS.
330     DhcpCompletedSet to FALSE.
331     ProxyOfferReceivedSet to FALSE.
332     StationIpSet to an address of all zeros.
333     SubnetMaskSet to a subnet mask of all zeros.
334     DhcpDiscoverZero-filled.
335     DhcpAckZero-filled.
336     ProxyOfferZero-filled.
337     PxeDiscoverValidSet to FALSE.
338     PxeDiscoverZero-filled.
339     PxeReplyValidSet to FALSE.
340     PxeReplyZero-filled.
341     PxeBisReplyValidSet to FALSE.
342     PxeBisReplyZero-filled.
343     IpFilterSet the Filters field to 0 and the IpCnt field to 0.
344     ArpCacheEntriesSet to 0.
345     ArpCacheZero-filled.
346     RouteTableEntriesSet to 0.
347     RouteTableZero-filled.
348     IcmpErrorReceivedSet to FALSE.
349     IcmpErrorZero-filled.
350     TftpErroReceivedSet to FALSE.
351     TftpErrorZero-filled.
352     MakeCallbacksSet to TRUE if the PXE Base Code Callback Protocol is available.
353     Set to FALSE if the PXE Base Code Callback Protocol is not available.
354 
355   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
356   @param  UseIpv6               Specifies the type of IP addresses that are to be used during the session
357                                 that is being started. Set to TRUE for IPv6 addresses, and FALSE for
358                                 IPv4 addresses.
359 
360   @retval EFI_SUCCESS           The PXE Base Code Protocol was started.
361   @retval EFI_DEVICE_ERROR      The network device encountered an error during this oper
362   @retval EFI_UNSUPPORTED       UseIpv6 is TRUE, but the Ipv6Supported field of the
363                                 EFI_PXE_BASE_CODE_MODE structure is FALSE.
364   @retval EFI_ALREADY_STARTED   The PXE Base Code Protocol is already in the started state.
365   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
366                                 EFI_PXE_BASE_CODE_PROTOCOL structure.
367   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory or other resources to start the
368                                 PXE Base Code Protocol.
369 
370 **/
371 typedef
372 EFI_STATUS
373 (EFIAPI *EFI_PXE_BASE_CODE_START)(
374   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
375   IN BOOLEAN                               UseIpv6
376   );
377 
378 /**
379   Disables the use of the PXE Base Code Protocol functions.
380 
381   This function stops all activity on the network device. All the resources allocated
382   in Start() are released, the Started field of the EFI_PXE_BASE_CODE_MODE structure is
383   set to FALSE and EFI_SUCCESS is returned. If the Started field of the EFI_PXE_BASE_CODE_MODE
384   structure is already FALSE, then EFI_NOT_STARTED will be returned.
385 
386   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
387 
388   @retval EFI_SUCCESS           The PXE Base Code Protocol was stopped.
389   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is already in the stopped state.
390   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
391                                 EFI_PXE_BASE_CODE_PROTOCOL structure.
392   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
393 
394 **/
395 typedef
396 EFI_STATUS
397 (EFIAPI *EFI_PXE_BASE_CODE_STOP)(
398   IN EFI_PXE_BASE_CODE_PROTOCOL    *This
399   );
400 
401 /**
402   Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6
403   S.A.R.R (solicit / advertise / request / reply) sequence.
404 
405   This function attempts to complete the DHCP sequence. If this sequence is completed,
406   then EFI_SUCCESS is returned, and the DhcpCompleted, ProxyOfferReceived, StationIp,
407   SubnetMask, DhcpDiscover, DhcpAck, and ProxyOffer fields of the EFI_PXE_BASE_CODE_MODE
408   structure are filled in.
409   If SortOffers is TRUE, then the cached DHCP offer packets will be sorted before
410   they are tried. If SortOffers is FALSE, then the cached DHCP offer packets will
411   be tried in the order in which they are received. Please see the Preboot Execution
412   Environment (PXE) Specification for additional details on the implementation of DHCP.
413   This function can take at least 31 seconds to timeout and return control to the
414   caller. If the DHCP sequence does not complete, then EFI_TIMEOUT will be returned.
415   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
416   then the DHCP sequence will be stopped and EFI_ABORTED will be returned.
417 
418   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
419   @param  SortOffers            TRUE if the offers received should be sorted. Set to FALSE to try the
420                                 offers in the order that they are received.
421 
422   @retval EFI_SUCCESS           Valid DHCP has completed.
423   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
424   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
425                                 EFI_PXE_BASE_CODE_PROTOCOL structure.
426   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
427   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete the DHCP Protocol.
428   @retval EFI_ABORTED           The callback function aborted the DHCP Protocol.
429   @retval EFI_TIMEOUT           The DHCP Protocol timed out.
430   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the DHCP session.
431   @retval EFI_NO_RESPONSE       Valid PXE offer was not received.
432 
433 **/
434 typedef
435 EFI_STATUS
436 (EFIAPI *EFI_PXE_BASE_CODE_DHCP)(
437   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
438   IN BOOLEAN                               SortOffers
439   );
440 
441 /**
442   Attempts to complete the PXE Boot Server and/or boot image discovery sequence.
443 
444   This function attempts to complete the PXE Boot Server and/or boot image discovery
445   sequence. If this sequence is completed, then EFI_SUCCESS is returned, and the
446   PxeDiscoverValid, PxeDiscover, PxeReplyReceived, and PxeReply fields of the
447   EFI_PXE_BASE_CODE_MODE structure are filled in. If UseBis is TRUE, then the
448   PxeBisReplyReceived and PxeBisReply fields of the EFI_PXE_BASE_CODE_MODE structure
449   will also be filled in. If UseBis is FALSE, then PxeBisReplyValid will be set to FALSE.
450   In the structure referenced by parameter Info, the PXE Boot Server list, SrvList[],
451   has two uses: It is the Boot Server IP address list used for unicast discovery
452   (if the UseUCast field is TRUE), and it is the list used for Boot Server verification
453   (if the MustUseList field is TRUE). Also, if the MustUseList field in that structure
454   is TRUE and the AcceptAnyResponse field in the SrvList[] array is TRUE, any Boot
455   Server reply of that type will be accepted. If the AcceptAnyResponse field is
456   FALSE, only responses from Boot Servers with matching IP addresses will be accepted.
457   This function can take at least 10 seconds to timeout and return control to the
458   caller. If the Discovery sequence does not complete, then EFI_TIMEOUT will be
459   returned. Please see the Preboot Execution Environment (PXE) Specification for
460   additional details on the implementation of the Discovery sequence.
461   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
462   then the Discovery sequence is stopped and EFI_ABORTED will be returned.
463 
464   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
465   @param  Type                  The type of bootstrap to perform.
466   @param  Layer                 The pointer to the boot server layer number to discover, which must be
467                                 PXE_BOOT_LAYER_INITIAL when a new server type is being
468                                 discovered.
469   @param  UseBis                TRUE if Boot Integrity Services are to be used. FALSE otherwise.
470   @param  Info                  The pointer to a data structure that contains additional information on the
471                                 type of discovery operation that is to be performed.
472 
473   @retval EFI_SUCCESS           The Discovery sequence has been completed.
474   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
475   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
476   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
477   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete Discovery.
478   @retval EFI_ABORTED           The callback function aborted the Discovery sequence.
479   @retval EFI_TIMEOUT           The Discovery sequence timed out.
480   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the PXE discovery
481                                 session.
482 
483 **/
484 typedef
485 EFI_STATUS
486 (EFIAPI *EFI_PXE_BASE_CODE_DISCOVER)(
487   IN EFI_PXE_BASE_CODE_PROTOCOL           *This,
488   IN UINT16                               Type,
489   IN UINT16                               *Layer,
490   IN BOOLEAN                              UseBis,
491   IN EFI_PXE_BASE_CODE_DISCOVER_INFO      *Info   OPTIONAL
492   );
493 
494 /**
495   Used to perform TFTP and MTFTP services.
496 
497   This function is used to perform TFTP and MTFTP services. This includes the
498   TFTP operations to get the size of a file, read a directory, read a file, and
499   write a file. It also includes the MTFTP operations to get the size of a file,
500   read a directory, and read a file. The type of operation is specified by Operation.
501   If the callback function that is invoked during the TFTP/MTFTP operation does
502   not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will
503   be returned.
504   For read operations, the return data will be placed in the buffer specified by
505   BufferPtr. If BufferSize is too small to contain the entire downloaded file,
506   then EFI_BUFFER_TOO_SMALL will be returned and BufferSize will be set to zero
507   or the size of the requested file (the size of the requested file is only returned
508   if the TFTP server supports TFTP options). If BufferSize is large enough for the
509   read operation, then BufferSize will be set to the size of the downloaded file,
510   and EFI_SUCCESS will be returned. Applications using the PxeBc.Mtftp() services
511   should use the get-file-size operations to determine the size of the downloaded
512   file prior to using the read-file operations--especially when downloading large
513   (greater than 64 MB) files--instead of making two calls to the read-file operation.
514   Following this recommendation will save time if the file is larger than expected
515   and the TFTP server does not support TFTP option extensions. Without TFTP option
516   extension support, the client has to download the entire file, counting and discarding
517   the received packets, to determine the file size.
518   For write operations, the data to be sent is in the buffer specified by BufferPtr.
519   BufferSize specifies the number of bytes to send. If the write operation completes
520   successfully, then EFI_SUCCESS will be returned.
521   For TFTP "get file size" operations, the size of the requested file or directory
522   is returned in BufferSize, and EFI_SUCCESS will be returned. If the TFTP server
523   does not support options, the file will be downloaded into a bit bucket and the
524   length of the downloaded file will be returned. For MTFTP "get file size" operations,
525   if the MTFTP server does not support the "get file size" option, EFI_UNSUPPORTED
526   will be returned.
527   This function can take up to 10 seconds to timeout and return control to the caller.
528   If the TFTP sequence does not complete, EFI_TIMEOUT will be returned.
529   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
530   then the TFTP sequence is stopped and EFI_ABORTED will be returned.
531   The format of the data returned from a TFTP read directory operation is a null-terminated
532   filename followed by a null-terminated information string, of the form
533   "size year-month-day hour:minute:second" (i.e. %d %d-%d-%d %d:%d:%f - note that
534   the seconds field can be a decimal number), where the date and time are UTC. For
535   an MTFTP read directory command, there is additionally a null-terminated multicast
536   IP address preceding the filename of the form %d.%d.%d.%d for IP v4. The final
537   entry is itself null-terminated, so that the final information string is terminated
538   with two null octets.
539 
540   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
541   @param  Operation             The type of operation to perform.
542   @param  BufferPtr             A pointer to the data buffer.
543   @param  Overwrite             Only used on write file operations. TRUE if a file on a remote server can
544                                 be overwritten.
545   @param  BufferSize            For get-file-size operations, *BufferSize returns the size of the
546                                 requested file.
547   @param  BlockSize             The requested block size to be used during a TFTP transfer.
548   @param  ServerIp              The TFTP / MTFTP server IP address.
549   @param  Filename              A Null-terminated ASCII string that specifies a directory name or a file
550                                 name.
551   @param  Info                  The pointer to the MTFTP information.
552   @param  DontUseBuffer         Set to FALSE for normal TFTP and MTFTP read file operation.
553 
554   @retval EFI_SUCCESS           The TFTP/MTFTP operation was completed.
555   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
556   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
557   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
558   @retval EFI_BUFFER_TOO_SMALL  The buffer is not large enough to complete the read operation.
559   @retval EFI_ABORTED           The callback function aborted the TFTP/MTFTP operation.
560   @retval EFI_TIMEOUT           The TFTP/MTFTP operation timed out.
561   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the MTFTP session.
562   @retval EFI_TFTP_ERROR        A TFTP error packet was received during the MTFTP session.
563 
564 **/
565 typedef
566 EFI_STATUS
567 (EFIAPI *EFI_PXE_BASE_CODE_MTFTP)(
568   IN EFI_PXE_BASE_CODE_PROTOCOL                *This,
569   IN EFI_PXE_BASE_CODE_TFTP_OPCODE             Operation,
570   IN OUT VOID                                  *BufferPtr OPTIONAL,
571   IN BOOLEAN                                   Overwrite,
572   IN OUT UINT64                                *BufferSize,
573   IN UINTN                                     *BlockSize OPTIONAL,
574   IN EFI_IP_ADDRESS                            *ServerIp,
575   IN UINT8                                     *Filename  OPTIONAL,
576   IN EFI_PXE_BASE_CODE_MTFTP_INFO              *Info      OPTIONAL,
577   IN BOOLEAN                                   DontUseBuffer
578   );
579 
580 /**
581   Writes a UDP packet to the network interface.
582 
583   This function writes a UDP packet specified by the (optional HeaderPtr and)
584   BufferPtr parameters to the network interface. The UDP header is automatically
585   built by this routine. It uses the parameters OpFlags, DestIp, DestPort, GatewayIp,
586   SrcIp, and SrcPort to build this header. If the packet is successfully built and
587   transmitted through the network interface, then EFI_SUCCESS will be returned.
588   If a timeout occurs during the transmission of the packet, then EFI_TIMEOUT will
589   be returned. If an ICMP error occurs during the transmission of the packet, then
590   the IcmpErrorReceived field is set to TRUE, the IcmpError field is filled in and
591   EFI_ICMP_ERROR will be returned. If the Callback Protocol does not return
592   EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will be returned.
593 
594   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
595   @param  OpFlags               The UDP operation flags.
596   @param  DestIp                The destination IP address.
597   @param  DestPort              The destination UDP port number.
598   @param  GatewayIp             The gateway IP address.
599   @param  SrcIp                 The source IP address.
600   @param  SrcPort               The source UDP port number.
601   @param  HeaderSize            An optional field which may be set to the length of a header at
602                                 HeaderPtr to be prefixed to the data at BufferPtr.
603   @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the
604                                 data at BufferPtr.
605   @param  BufferSize            A pointer to the size of the data at BufferPtr.
606   @param  BufferPtr             A pointer to the data to be written.
607 
608   @retval EFI_SUCCESS           The UDP Write operation was completed.
609   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
610   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
611   @retval EFI_BAD_BUFFER_SIZE   The buffer is too long to be transmitted.
612   @retval EFI_ABORTED           The callback function aborted the UDP Write operation.
613   @retval EFI_TIMEOUT           The UDP Write operation timed out.
614   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the UDP write session.
615 
616 **/
617 typedef
618 EFI_STATUS
619 (EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE)(
620   IN EFI_PXE_BASE_CODE_PROTOCOL                *This,
621   IN UINT16                                    OpFlags,
622   IN EFI_IP_ADDRESS                            *DestIp,
623   IN EFI_PXE_BASE_CODE_UDP_PORT                *DestPort,
624   IN EFI_IP_ADDRESS                            *GatewayIp   OPTIONAL,
625   IN EFI_IP_ADDRESS                            *SrcIp       OPTIONAL,
626   IN OUT EFI_PXE_BASE_CODE_UDP_PORT            *SrcPort     OPTIONAL,
627   IN UINTN                                     *HeaderSize  OPTIONAL,
628   IN VOID                                      *HeaderPtr   OPTIONAL,
629   IN UINTN                                     *BufferSize,
630   IN VOID                                      *BufferPtr
631   );
632 
633 /**
634   Reads a UDP packet from the network interface.
635 
636   This function reads a UDP packet from a network interface. The data contents
637   are returned in (the optional HeaderPtr and) BufferPtr, and the size of the
638   buffer received is returned in BufferSize. If the input BufferSize is smaller
639   than the UDP packet received (less optional HeaderSize), it will be set to the
640   required size, and EFI_BUFFER_TOO_SMALL will be returned. In this case, the
641   contents of BufferPtr are undefined, and the packet is lost. If a UDP packet is
642   successfully received, then EFI_SUCCESS will be returned, and the information
643   from the UDP header will be returned in DestIp, DestPort, SrcIp, and SrcPort if
644   they are not NULL.
645   Depending on the values of OpFlags and the DestIp, DestPort, SrcIp, and SrcPort
646   input values, different types of UDP packet receive filtering will be performed.
647   The following tables summarize these receive filter operations.
648 
649   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
650   @param  OpFlags               The UDP operation flags.
651   @param  DestIp                The destination IP address.
652   @param  DestPort              The destination UDP port number.
653   @param  SrcIp                 The source IP address.
654   @param  SrcPort               The source UDP port number.
655   @param  HeaderSize            An optional field which may be set to the length of a header at
656                                 HeaderPtr to be prefixed to the data at BufferPtr.
657   @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the
658                                 data at BufferPtr.
659   @param  BufferSize            A pointer to the size of the data at BufferPtr.
660   @param  BufferPtr             A pointer to the data to be read.
661 
662   @retval EFI_SUCCESS           The UDP Read operation was completed.
663   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
664   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
665   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
666   @retval EFI_BUFFER_TOO_SMALL  The packet is larger than Buffer can hold.
667   @retval EFI_ABORTED           The callback function aborted the UDP Read operation.
668   @retval EFI_TIMEOUT           The UDP Read operation timed out.
669 
670 **/
671 typedef
672 EFI_STATUS
673 (EFIAPI *EFI_PXE_BASE_CODE_UDP_READ)(
674   IN EFI_PXE_BASE_CODE_PROTOCOL                *This,
675   IN UINT16                                    OpFlags,
676   IN OUT EFI_IP_ADDRESS                        *DestIp      OPTIONAL,
677   IN OUT EFI_PXE_BASE_CODE_UDP_PORT            *DestPort    OPTIONAL,
678   IN OUT EFI_IP_ADDRESS                        *SrcIp       OPTIONAL,
679   IN OUT EFI_PXE_BASE_CODE_UDP_PORT            *SrcPort     OPTIONAL,
680   IN UINTN                                     *HeaderSize  OPTIONAL,
681   IN VOID                                      *HeaderPtr   OPTIONAL,
682   IN OUT UINTN                                 *BufferSize,
683   IN VOID                                      *BufferPtr
684   );
685 
686 /**
687   Updates the IP receive filters of a network device and enables software filtering.
688 
689   The NewFilter field is used to modify the network device's current IP receive
690   filter settings and to enable a software filter. This function updates the IpFilter
691   field of the EFI_PXE_BASE_CODE_MODE structure with the contents of NewIpFilter.
692   The software filter is used when the USE_FILTER in OpFlags is set to UdpRead().
693   The current hardware filter remains in effect no matter what the settings of OpFlags
694   are, so that the meaning of ANY_DEST_IP set in OpFlags to UdpRead() is from those
695   packets whose reception is enabled in hardware - physical NIC address (unicast),
696   broadcast address, logical address or addresses (multicast), or all (promiscuous).
697   UdpRead() does not modify the IP filter settings.
698   Dhcp(), Discover(), and Mtftp() set the IP filter, and return with the IP receive
699   filter list emptied and the filter set to EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP.
700   If an application or driver wishes to preserve the IP receive filter settings,
701   it will have to preserve the IP receive filter settings before these calls, and
702   use SetIpFilter() to restore them after the calls. If incompatible filtering is
703   requested (for example, PROMISCUOUS with anything else), or if the device does not
704   support a requested filter setting and it cannot be accommodated in software
705   (for example, PROMISCUOUS not supported), EFI_INVALID_PARAMETER will be returned.
706   The IPlist field is used to enable IPs other than the StationIP. They may be
707   multicast or unicast. If IPcnt is set as well as EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP,
708   then both the StationIP and the IPs from the IPlist will be used.
709 
710   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
711   @param  NewFilter             The pointer to the new set of IP receive filters.
712 
713   @retval EFI_SUCCESS           The IP receive filter settings were updated.
714   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
715   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
716 
717 **/
718 typedef
719 EFI_STATUS
720 (EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER)(
721   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
722   IN EFI_PXE_BASE_CODE_IP_FILTER           *NewFilter
723   );
724 
725 /**
726   Uses the ARP protocol to resolve a MAC address.
727 
728   This function uses the ARP protocol to resolve a MAC address. The UsingIpv6 field
729   of the EFI_PXE_BASE_CODE_MODE structure is used to determine if IPv4 or IPv6
730   addresses are being used. The IP address specified by IpAddr is used to resolve
731   a MAC address. If the ARP protocol succeeds in resolving the specified address,
732   then the ArpCacheEntries and ArpCache fields of the EFI_PXE_BASE_CODE_MODE structure
733   are updated, and EFI_SUCCESS is returned. If MacAddr is not NULL, the resolved
734   MAC address is placed there as well.
735   If the PXE Base Code protocol is in the stopped state, then EFI_NOT_STARTED is
736   returned. If the ARP protocol encounters a timeout condition while attempting
737   to resolve an address, then EFI_TIMEOUT is returned. If the Callback Protocol
738   does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED is
739   returned.
740 
741   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
742   @param  IpAddr                The pointer to the IP address that is used to resolve a MAC address.
743   @param  MacAddr               If not NULL, a pointer to the MAC address that was resolved with the
744                                 ARP protocol.
745 
746   @retval EFI_SUCCESS           The IP or MAC address was resolved.
747   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
748   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
749   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.
750   @retval EFI_ABORTED           The callback function aborted the ARP Protocol.
751   @retval EFI_TIMEOUT           The ARP Protocol encountered a timeout condition.
752 
753 **/
754 typedef
755 EFI_STATUS
756 (EFIAPI *EFI_PXE_BASE_CODE_ARP)(
757   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
758   IN EFI_IP_ADDRESS                        *IpAddr,
759   IN EFI_MAC_ADDRESS                       *MacAddr OPTIONAL
760   );
761 
762 /**
763   Updates the parameters that affect the operation of the PXE Base Code Protocol.
764 
765   This function sets parameters that affect the operation of the PXE Base Code Protocol.
766   The parameter specified by NewAutoArp is used to control the generation of ARP
767   protocol packets. If NewAutoArp is TRUE, then ARP Protocol packets will be generated
768   as required by the PXE Base Code Protocol. If NewAutoArp is FALSE, then no ARP
769   Protocol packets will be generated. In this case, the only mappings that are
770   available are those stored in the ArpCache of the EFI_PXE_BASE_CODE_MODE structure.
771   If there are not enough mappings in the ArpCache to perform a PXE Base Code Protocol
772   service, then the service will fail. This function updates the AutoArp field of
773   the EFI_PXE_BASE_CODE_MODE structure to NewAutoArp.
774   The SetParameters() call must be invoked after a Callback Protocol is installed
775   to enable the use of callbacks.
776 
777   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
778   @param  NewAutoArp            If not NULL, a pointer to a value that specifies whether to replace the
779                                 current value of AutoARP.
780   @param  NewSendGUID           If not NULL, a pointer to a value that specifies whether to replace the
781                                 current value of SendGUID.
782   @param  NewTTL                If not NULL, a pointer to be used in place of the current value of TTL,
783                                 the "time to live" field of the IP header.
784   @param  NewToS                If not NULL, a pointer to be used in place of the current value of ToS,
785                                 the "type of service" field of the IP header.
786   @param  NewMakeCallback       If not NULL, a pointer to a value that specifies whether to replace the
787                                 current value of the MakeCallback field of the Mode structure.
788 
789   @retval EFI_SUCCESS           The new parameters values were updated.
790   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
791   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
792 
793 **/
794 typedef
795 EFI_STATUS
796 (EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS)(
797   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
798   IN BOOLEAN                               *NewAutoArp      OPTIONAL,
799   IN BOOLEAN                               *NewSendGUID     OPTIONAL,
800   IN UINT8                                 *NewTTL          OPTIONAL,
801   IN UINT8                                 *NewToS          OPTIONAL,
802   IN BOOLEAN                               *NewMakeCallback OPTIONAL
803   );
804 
805 /**
806   Updates the station IP address and/or subnet mask values of a network device.
807 
808   This function updates the station IP address and/or subnet mask values of a network
809   device.
810   The NewStationIp field is used to modify the network device's current IP address.
811   If NewStationIP is NULL, then the current IP address will not be modified. Otherwise,
812   this function updates the StationIp field of the EFI_PXE_BASE_CODE_MODE structure
813   with NewStationIp.
814   The NewSubnetMask field is used to modify the network device's current subnet
815   mask. If NewSubnetMask is NULL, then the current subnet mask will not be modified.
816   Otherwise, this function updates the SubnetMask field of the EFI_PXE_BASE_CODE_MODE
817   structure with NewSubnetMask.
818 
819   @param  This                  The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
820   @param  NewStationIp          The pointer to the new IP address to be used by the network device.
821   @param  NewSubnetMask         The pointer to the new subnet mask to be used by the network device.
822 
823   @retval EFI_SUCCESS           The new station IP address and/or subnet mask were updated.
824   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.
825   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
826 
827 **/
828 typedef
829 EFI_STATUS
830 (EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP)(
831   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
832   IN EFI_IP_ADDRESS                        *NewStationIp    OPTIONAL,
833   IN EFI_IP_ADDRESS                        *NewSubnetMask   OPTIONAL
834   );
835 
836 /**
837   Updates the contents of the cached DHCP and Discover packets.
838 
839   The pointers to the new packets are used to update the contents of the cached
840   packets in the EFI_PXE_BASE_CODE_MODE structure.
841 
842   @param  This                   The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
843   @param  NewDhcpDiscoverValid   The pointer to a value that will replace the current
844                                  DhcpDiscoverValid field.
845   @param  NewDhcpAckReceived     The pointer to a value that will replace the current
846                                  DhcpAckReceived field.
847   @param  NewProxyOfferReceived  The pointer to a value that will replace the current
848                                  ProxyOfferReceived field.
849   @param  NewPxeDiscoverValid    The pointer to a value that will replace the current
850                                  ProxyOfferReceived field.
851   @param  NewPxeReplyReceived    The pointer to a value that will replace the current
852                                  PxeReplyReceived field.
853   @param  NewPxeBisReplyReceived The pointer to a value that will replace the current
854                                  PxeBisReplyReceived field.
855   @param  NewDhcpDiscover        The pointer to the new cached DHCP Discover packet contents.
856   @param  NewDhcpAck             The pointer to the new cached DHCP Ack packet contents.
857   @param  NewProxyOffer          The pointer to the new cached Proxy Offer packet contents.
858   @param  NewPxeDiscover         The pointer to the new cached PXE Discover packet contents.
859   @param  NewPxeReply            The pointer to the new cached PXE Reply packet contents.
860   @param  NewPxeBisReply         The pointer to the new cached PXE BIS Reply packet contents.
861 
862   @retval EFI_SUCCESS            The cached packet contents were updated.
863   @retval EFI_NOT_STARTED        The PXE Base Code Protocol is in the stopped state.
864   @retval EFI_INVALID_PARAMETER  This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.
865 
866 **/
867 typedef
868 EFI_STATUS
869 (EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS)(
870   IN EFI_PXE_BASE_CODE_PROTOCOL            *This,
871   BOOLEAN                                  *NewDhcpDiscoverValid    OPTIONAL,
872   BOOLEAN                                  *NewDhcpAckReceived      OPTIONAL,
873   BOOLEAN                                  *NewProxyOfferReceived   OPTIONAL,
874   BOOLEAN                                  *NewPxeDiscoverValid     OPTIONAL,
875   BOOLEAN                                  *NewPxeReplyReceived     OPTIONAL,
876   BOOLEAN                                  *NewPxeBisReplyReceived  OPTIONAL,
877   IN EFI_PXE_BASE_CODE_PACKET              *NewDhcpDiscover         OPTIONAL,
878   IN EFI_PXE_BASE_CODE_PACKET              *NewDhcpAck              OPTIONAL,
879   IN EFI_PXE_BASE_CODE_PACKET              *NewProxyOffer           OPTIONAL,
880   IN EFI_PXE_BASE_CODE_PACKET              *NewPxeDiscover          OPTIONAL,
881   IN EFI_PXE_BASE_CODE_PACKET              *NewPxeReply             OPTIONAL,
882   IN EFI_PXE_BASE_CODE_PACKET              *NewPxeBisReply          OPTIONAL
883   );
884 
885 //
886 // PXE Base Code Protocol structure
887 //
888 #define EFI_PXE_BASE_CODE_PROTOCOL_REVISION  0x00010000
889 
890 //
891 // Revision defined in EFI1.1
892 //
893 #define EFI_PXE_BASE_CODE_INTERFACE_REVISION  EFI_PXE_BASE_CODE_PROTOCOL_REVISION
894 
895 ///
896 /// The EFI_PXE_BASE_CODE_PROTOCOL is used to control PXE-compatible devices.
897 /// An EFI_PXE_BASE_CODE_PROTOCOL will be layered on top of an
898 /// EFI_MANAGED_NETWORK_PROTOCOL protocol in order to perform packet level transactions.
899 /// The EFI_PXE_BASE_CODE_PROTOCOL handle also supports the
900 /// EFI_LOAD_FILE_PROTOCOL protocol. This provides a clean way to obtain control from the
901 /// boot manager if the boot path is from the remote device.
902 ///
903 struct _EFI_PXE_BASE_CODE_PROTOCOL {
904   ///
905   ///  The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must
906   ///  be backwards compatible. If a future version is not backwards compatible
907   ///  it is not the same GUID.
908   ///
909   UINT64                              Revision;
910   EFI_PXE_BASE_CODE_START             Start;
911   EFI_PXE_BASE_CODE_STOP              Stop;
912   EFI_PXE_BASE_CODE_DHCP              Dhcp;
913   EFI_PXE_BASE_CODE_DISCOVER          Discover;
914   EFI_PXE_BASE_CODE_MTFTP             Mtftp;
915   EFI_PXE_BASE_CODE_UDP_WRITE         UdpWrite;
916   EFI_PXE_BASE_CODE_UDP_READ          UdpRead;
917   EFI_PXE_BASE_CODE_SET_IP_FILTER     SetIpFilter;
918   EFI_PXE_BASE_CODE_ARP               Arp;
919   EFI_PXE_BASE_CODE_SET_PARAMETERS    SetParameters;
920   EFI_PXE_BASE_CODE_SET_STATION_IP    SetStationIp;
921   EFI_PXE_BASE_CODE_SET_PACKETS       SetPackets;
922   ///
923   /// The pointer to the EFI_PXE_BASE_CODE_MODE data for this device.
924   ///
925   EFI_PXE_BASE_CODE_MODE              *Mode;
926 };
927 
928 extern EFI_GUID  gEfiPxeBaseCodeProtocolGuid;
929 
930 #endif
931