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