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