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