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