]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/PxeBaseCode.h
Code have been checked with spec
[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
4ca9b6c4 5 Copyright (c) 2006 - 2008, 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
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
13\r
d1f95000 14**/\r
15#ifndef __PXE_BASE_CODE_PROTOCOL_H__\r
16#define __PXE_BASE_CODE_PROTOCOL_H__\r
17\r
99e8ed21 18///\r
19/// PXE Base Code protocol\r
20///\r
d1f95000 21#define EFI_PXE_BASE_CODE_PROTOCOL_GUID \\r
22 { \\r
23 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
24 }\r
25\r
a6508c05 26typedef struct _EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE_PROTOCOL;\r
27\r
99e8ed21 28///\r
29/// Protocol defined in EFI1.1.\r
30/// \r
a6508c05 31typedef EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE;\r
d1f95000 32\r
99e8ed21 33///\r
34/// Default IP TTL and ToS.\r
35///\r
d1f95000 36#define DEFAULT_TTL 16\r
37#define DEFAULT_ToS 0\r
38\r
99e8ed21 39///\r
40/// ICMP error format\r
41///\r
d1f95000 42typedef struct {\r
43 UINT8 Type;\r
44 UINT8 Code;\r
45 UINT16 Checksum;\r
46 union {\r
47 UINT32 reserved;\r
48 UINT32 Mtu;\r
49 UINT32 Pointer;\r
50 struct {\r
51 UINT16 Identifier;\r
52 UINT16 Sequence;\r
53 } Echo;\r
54 } u;\r
55 UINT8 Data[494];\r
56} EFI_PXE_BASE_CODE_ICMP_ERROR;\r
57\r
99e8ed21 58///\r
59/// TFTP error format\r
60///\r
d1f95000 61typedef struct {\r
62 UINT8 ErrorCode;\r
63 CHAR8 ErrorString[127];\r
64} EFI_PXE_BASE_CODE_TFTP_ERROR;\r
65\r
99e8ed21 66///\r
67/// IP Receive Filter definitions\r
68///\r
d1f95000 69#define EFI_PXE_BASE_CODE_MAX_IPCNT 8\r
70\r
9319d2c2
LG
71///\r
72/// IP Receive Filter structure\r
73///\r
d1f95000 74typedef struct {\r
75 UINT8 Filters;\r
76 UINT8 IpCnt;\r
77 UINT16 reserved;\r
78 EFI_IP_ADDRESS IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];\r
79} EFI_PXE_BASE_CODE_IP_FILTER;\r
80\r
81#define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001\r
82#define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002\r
83#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004\r
84#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008\r
85\r
99e8ed21 86///\r
9319d2c2 87/// ARP cache entries\r
99e8ed21 88///\r
d1f95000 89typedef struct {\r
90 EFI_IP_ADDRESS IpAddr;\r
91 EFI_MAC_ADDRESS MacAddr;\r
92} EFI_PXE_BASE_CODE_ARP_ENTRY;\r
93\r
9319d2c2
LG
94///\r
95/// ARP route table entries\r
96///\r
d1f95000 97typedef struct {\r
98 EFI_IP_ADDRESS IpAddr;\r
99 EFI_IP_ADDRESS SubnetMask;\r
100 EFI_IP_ADDRESS GwAddr;\r
101} EFI_PXE_BASE_CODE_ROUTE_ENTRY;\r
102\r
103//\r
104// UDP definitions\r
105//\r
106typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;\r
107\r
108#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001\r
109#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002\r
110#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004\r
111#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008\r
112#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010\r
113#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020\r
114\r
115//\r
116// Discover() definitions\r
117//\r
118#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0\r
119#define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1\r
120#define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2\r
121#define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3\r
122#define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4\r
123#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5\r
124#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6\r
125#define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7\r
126#define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8\r
127#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9\r
128#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10\r
129#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11\r
130#define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12\r
131#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13\r
132#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14\r
133#define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15\r
134#define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16\r
135//\r
136// 17 through 32767 are reserved\r
137// 32768 through 65279 are for vendor use\r
138// 65280 through 65534 are reserved\r
139//\r
140#define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535\r
141\r
142#define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF\r
143#define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000\r
144\r
99e8ed21 145///\r
146/// Discover() server list structure.\r
147///\r
d1f95000 148typedef struct {\r
149 UINT16 Type;\r
150 BOOLEAN AcceptAnyResponse;\r
151 UINT8 Reserved;\r
152 EFI_IP_ADDRESS IpAddr;\r
153} EFI_PXE_BASE_CODE_SRVLIST;\r
154\r
99e8ed21 155///\r
156/// Discover() information override structure.\r
157///\r
d1f95000 158typedef struct {\r
159 BOOLEAN UseMCast;\r
160 BOOLEAN UseBCast;\r
161 BOOLEAN UseUCast;\r
162 BOOLEAN MustUseList;\r
163 EFI_IP_ADDRESS ServerMCastIp;\r
164 UINT16 IpCnt;\r
165 EFI_PXE_BASE_CODE_SRVLIST SrvList[1];\r
166} EFI_PXE_BASE_CODE_DISCOVER_INFO;\r
167\r
99e8ed21 168///\r
9319d2c2 169/// TFTP opcode definitions\r
99e8ed21 170///\r
d1f95000 171typedef enum {\r
172 EFI_PXE_BASE_CODE_TFTP_FIRST,\r
173 EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,\r
174 EFI_PXE_BASE_CODE_TFTP_READ_FILE,\r
175 EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,\r
176 EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,\r
177 EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,\r
178 EFI_PXE_BASE_CODE_MTFTP_READ_FILE,\r
179 EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,\r
180 EFI_PXE_BASE_CODE_MTFTP_LAST\r
181} EFI_PXE_BASE_CODE_TFTP_OPCODE;\r
182\r
9319d2c2
LG
183///\r
184/// MTFTP information. This information is required\r
185/// to start or join a multicast TFTP session. It is also required to\r
186/// perform the "get file size" and "read directory" operations of MTFTP.\r
187///\r
d1f95000 188typedef struct {\r
189 EFI_IP_ADDRESS MCastIp;\r
190 EFI_PXE_BASE_CODE_UDP_PORT CPort;\r
191 EFI_PXE_BASE_CODE_UDP_PORT SPort;\r
192 UINT16 ListenTimeout;\r
193 UINT16 TransmitTimeout;\r
194} EFI_PXE_BASE_CODE_MTFTP_INFO;\r
195\r
3ed785e9 196///\r
9319d2c2 197/// DHCPV4 Packet structure\r
3ed785e9 198///\r
199typedef struct {\r
200 UINT8 BootpOpcode;\r
201 UINT8 BootpHwType;\r
202 UINT8 BootpHwAddrLen;\r
203 UINT8 BootpGateHops;\r
204 UINT32 BootpIdent;\r
205 UINT16 BootpSeconds;\r
206 UINT16 BootpFlags;\r
207 UINT8 BootpCiAddr[4];\r
208 UINT8 BootpYiAddr[4];\r
209 UINT8 BootpSiAddr[4];\r
210 UINT8 BootpGiAddr[4];\r
211 UINT8 BootpHwAddr[16];\r
212 UINT8 BootpSrvName[64];\r
213 UINT8 BootpBootFile[128];\r
214 UINT32 DhcpMagik;\r
215 UINT8 DhcpOptions[56];\r
216} EFI_PXE_BASE_CODE_DHCPV4_PACKET;\r
217\r
9319d2c2
LG
218///\r
219/// Packet structure\r
220///\r
3ed785e9 221typedef union {\r
222 UINT8 Raw[1472];\r
223 EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;\r
9319d2c2
LG
224 //\r
225 // EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6;\r
226 //\r
3ed785e9 227} EFI_PXE_BASE_CODE_PACKET;\r
228\r
d1f95000 229//\r
230// PXE Base Code Mode structure\r
231//\r
232#define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8\r
233#define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8\r
234\r
9319d2c2
LG
235///\r
236/// EFI_PXE_BASE_CODE_MODE\r
237/// The data values in this structure are read-only and \r
238/// are updated by the code that produces the\r
239/// EFI_PXE_BASE_CODE_PROTOCOL functions.\r
240///\r
d1f95000 241typedef struct {\r
242 BOOLEAN Started;\r
243 BOOLEAN Ipv6Available;\r
244 BOOLEAN Ipv6Supported;\r
245 BOOLEAN UsingIpv6;\r
246 BOOLEAN BisSupported;\r
247 BOOLEAN BisDetected;\r
248 BOOLEAN AutoArp;\r
249 BOOLEAN SendGUID;\r
250 BOOLEAN DhcpDiscoverValid;\r
251 BOOLEAN DhcpAckReceived;\r
252 BOOLEAN ProxyOfferReceived;\r
253 BOOLEAN PxeDiscoverValid;\r
254 BOOLEAN PxeReplyReceived;\r
255 BOOLEAN PxeBisReplyReceived;\r
256 BOOLEAN IcmpErrorReceived;\r
257 BOOLEAN TftpErrorReceived;\r
258 BOOLEAN MakeCallbacks;\r
259 UINT8 TTL;\r
260 UINT8 ToS;\r
261 EFI_IP_ADDRESS StationIp;\r
262 EFI_IP_ADDRESS SubnetMask;\r
263 EFI_PXE_BASE_CODE_PACKET DhcpDiscover;\r
264 EFI_PXE_BASE_CODE_PACKET DhcpAck;\r
265 EFI_PXE_BASE_CODE_PACKET ProxyOffer;\r
266 EFI_PXE_BASE_CODE_PACKET PxeDiscover;\r
267 EFI_PXE_BASE_CODE_PACKET PxeReply;\r
268 EFI_PXE_BASE_CODE_PACKET PxeBisReply;\r
269 EFI_PXE_BASE_CODE_IP_FILTER IpFilter;\r
270 UINT32 ArpCacheEntries;\r
271 EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];\r
272 UINT32 RouteTableEntries;\r
273 EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];\r
274 EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError;\r
275 EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;\r
276} EFI_PXE_BASE_CODE_MODE;\r
277\r
278//\r
279// PXE Base Code Interface Function definitions\r
280//\r
281\r
282/** \r
283 Enables the use of the PXE Base Code Protocol functions.\r
284 \r
285 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
286 @param UseIpv6 Specifies the type of IP addresses that are to be used during the session\r
287 that is being started. Set to TRUE for IPv6 addresses, and FALSE for \r
288 IPv4 addresses. \r
289 \r
290 @retval EFI_SUCCESS The PXE Base Code Protocol was started.\r
291 @retval EFI_DEVICE_ERROR The network device encountered an error during this oper \r
292 @retval EFI_UNSUPPORTED UseIpv6 is TRUE, but the Ipv6Supported field of the\r
293 EFI_PXE_BASE_CODE_MODE structure is FALSE. \r
294 @retval EFI_ALREADY_STARTED The PXE Base Code Protocol is already in the started state. \r
295 @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
296 EFI_PXE_BASE_CODE_PROTOCOL structure. \r
297 @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory or other resources to start the \r
298 PXE Base Code Protocol. \r
299 \r
300**/\r
301typedef\r
302EFI_STATUS\r
8b13229b 303(EFIAPI *EFI_PXE_BASE_CODE_START)(\r
d1f95000 304 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
305 IN BOOLEAN UseIpv6\r
306 );\r
307\r
308/** \r
309 Disables the use of the PXE Base Code Protocol functions.\r
310 \r
311 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
312 \r
313 @retval EFI_SUCCESS The PXE Base Code Protocol was stopped.\r
314 @retval EFI_NOT_STARTED The PXE Base Code Protocol is already in the stopped state. \r
315 @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
316 EFI_PXE_BASE_CODE_PROTOCOL structure. \r
317 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
318 \r
319**/\r
320typedef\r
321EFI_STATUS\r
8b13229b 322(EFIAPI *EFI_PXE_BASE_CODE_STOP)(\r
d1f95000 323 IN EFI_PXE_BASE_CODE_PROTOCOL *This\r
324 );\r
325\r
326/** \r
327 Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6\r
328 S.A.R.R (solicit / advertise / request / reply) sequence.\r
329 \r
330 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
331 @param SortOffers TRUE if the offers received should be sorted. Set to FALSE to try the\r
332 offers in the order that they are received. \r
333 \r
334 @retval EFI_SUCCESS Valid DHCP has completed.\r
335 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
336 @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
337 EFI_PXE_BASE_CODE_PROTOCOL structure. \r
338 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
339 @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete the DHCP Protocol.\r
340 @retval EFI_ABORTED The callback function aborted the DHCP Protocol.\r
341 @retval EFI_TIMEOUT The DHCP Protocol timed out.\r
342 @retval EFI_ICMP_ERROR An ICMP error packet was received during the DHCP session.\r
343 @retval EFI_NO_RESPONSE Valid PXE offer was not received.\r
344 \r
345**/\r
346typedef\r
347EFI_STATUS\r
8b13229b 348(EFIAPI *EFI_PXE_BASE_CODE_DHCP)(\r
d1f95000 349 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
350 IN BOOLEAN SortOffers\r
351 );\r
352\r
353/** \r
354 Attempts to complete the PXE Boot Server and/or boot image discovery sequence.\r
355 \r
356 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
357 @param Type The type of bootstrap to perform.\r
358 @param Layer Pointer to the boot server layer number to discover, which must be\r
359 PXE_BOOT_LAYER_INITIAL when a new server type is being \r
360 discovered. \r
361 @param UseBis TRUE if Boot Integrity Services are to be used. FALSE otherwise. \r
362 @param Info Pointer to a data structure that contains additional information on the\r
363 type of discovery operation that is to be performed. \r
364 \r
365 @retval EFI_SUCCESS The Discovery sequence has been completed.\r
366 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
367 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
368 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
369 @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete Discovery.\r
370 @retval EFI_ABORTED The callback function aborted the Discovery sequence.\r
371 @retval EFI_TIMEOUT The Discovery sequence timed out.\r
372 @retval EFI_ICMP_ERROR An ICMP error packet was received during the PXE discovery\r
373 session. \r
374 \r
375**/\r
376typedef\r
377EFI_STATUS\r
8b13229b 378(EFIAPI *EFI_PXE_BASE_CODE_DISCOVER)(\r
d1f95000 379 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
380 IN UINT16 Type,\r
381 IN UINT16 *Layer,\r
382 IN BOOLEAN UseBis,\r
383 IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL\r
384 );\r
385\r
386/** \r
387 Used to perform TFTP and MTFTP services.\r
388 \r
389 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
390 @param Operation The type of operation to perform.\r
391 @param BufferPtr A pointer to the data buffer. \r
392 @param Overwrite Only used on write file operations. TRUE if a file on a remote server can\r
393 be overwritten. \r
394 @param BufferSize For get-file-size operations, *BufferSize returns the size of the\r
395 requested file. \r
396 @param BlockSize The requested block size to be used during a TFTP transfer.\r
397 @param ServerIp The TFTP / MTFTP server IP address.\r
398 @param Filename A Null-terminated ASCII string that specifies a directory name or a file\r
399 name. \r
400 @param Info Pointer to the MTFTP information.\r
401 @param DontUseBuffer Set to FALSE for normal TFTP and MTFTP read file operation. \r
402 \r
403 @retval EFI_SUCCESS The TFTP/MTFTP operation was completed.\r
404 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
405 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
406 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
407 @retval EFI_BUFFER_TOO_SMALL The buffer is not large enough to complete the read operation. \r
408 @retval EFI_ABORTED The callback function aborted the TFTP/MTFTP operation.\r
409 @retval EFI_TIMEOUT The TFTP/MTFTP operation timed out.\r
410 @retval EFI_ICMP_ERROR An ICMP error packet was received during the MTFTP session.\r
411 @retval EFI_TFTP_ERROR A TFTP error packet was received during the MTFTP session.\r
412 \r
413**/\r
414typedef\r
415EFI_STATUS\r
8b13229b 416(EFIAPI *EFI_PXE_BASE_CODE_MTFTP)(\r
d1f95000 417 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
418 IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,\r
419 IN OUT VOID *BufferPtr OPTIONAL,\r
420 IN BOOLEAN Overwrite,\r
421 IN OUT UINT64 *BufferSize,\r
422 IN UINTN *BlockSize OPTIONAL,\r
423 IN EFI_IP_ADDRESS *ServerIp,\r
424 IN UINT8 *Filename OPTIONAL,\r
425 IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,\r
426 IN BOOLEAN DontUseBuffer\r
427 );\r
428\r
429/** \r
430 Writes a UDP packet to the network interface.\r
431 \r
432 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
433 @param OpFlags The UDP operation flags. \r
434 @param DestIp The destination IP address.\r
435 @param DestPort The destination UDP port number. \r
436 @param GatewayIp The gateway IP address. \r
437 @param SrcIp The source IP address.\r
438 @param SrcPort The source UDP port number.\r
439 @param HeaderSize An optional field which may be set to the length of a header at\r
440 HeaderPtr to be prefixed to the data at BufferPtr. \r
441 @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
442 data at BufferPtr. \r
443 @param BufferSize A pointer to the size of the data at BufferPtr.\r
444 @param BufferPtr A pointer to the data to be written.\r
445 \r
446 @retval EFI_SUCCESS The UDP Write operation was completed.\r
447 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
448 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
449 @retval EFI_BAD_BUFFER_SIZE The buffer is too long to be transmitted. \r
450 @retval EFI_ABORTED The callback function aborted the UDP Write operation.\r
451 @retval EFI_TIMEOUT The UDP Write operation timed out.\r
452 @retval EFI_ICMP_ERROR An ICMP error packet was received during the UDP write session. \r
453 \r
454**/\r
455typedef\r
456EFI_STATUS\r
8b13229b 457(EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE)(\r
d1f95000 458 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
459 IN UINT16 OpFlags,\r
460 IN EFI_IP_ADDRESS *DestIp,\r
461 IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,\r
462 IN EFI_IP_ADDRESS *GatewayIp, OPTIONAL\r
463 IN EFI_IP_ADDRESS *SrcIp, OPTIONAL\r
464 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL\r
465 IN UINTN *HeaderSize, OPTIONAL\r
466 IN VOID *HeaderPtr, OPTIONAL\r
467 IN UINTN *BufferSize,\r
468 IN VOID *BufferPtr\r
469 );\r
470\r
471/** \r
472 Reads a UDP packet from the network interface.\r
473 \r
474 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
475 @param OpFlags The UDP operation flags. \r
476 @param DestIp The destination IP address.\r
477 @param DestPort The destination UDP port number. \r
478 @param GatewayIp The gateway IP address. \r
479 @param SrcIp The source IP address.\r
480 @param SrcPort The source UDP port number.\r
481 @param HeaderSize An optional field which may be set to the length of a header at\r
482 HeaderPtr to be prefixed to the data at BufferPtr. \r
483 @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
484 data at BufferPtr. \r
485 @param BufferSize A pointer to the size of the data at BufferPtr.\r
486 @param BufferPtr A pointer to the data to be read.\r
487 \r
488 @retval EFI_SUCCESS The UDP Write operation was completed.\r
489 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
490 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
491 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r
492 @retval EFI_BUFFER_TOO_SMALL The packet is larger than Buffer can hold.\r
493 @retval EFI_ABORTED The callback function aborted the UDP Read operation.\r
494 @retval EFI_TIMEOUT The UDP Read operation timed out. \r
495 \r
496**/\r
497typedef\r
498EFI_STATUS\r
8b13229b 499(EFIAPI *EFI_PXE_BASE_CODE_UDP_READ)(\r
d1f95000 500 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
501 IN UINT16 OpFlags,\r
502 IN OUT EFI_IP_ADDRESS *DestIp, OPTIONAL\r
503 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort, OPTIONAL\r
504 IN OUT EFI_IP_ADDRESS *SrcIp, OPTIONAL\r
505 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL\r
506 IN UINTN *HeaderSize, OPTIONAL\r
507 IN VOID *HeaderPtr, OPTIONAL\r
508 IN OUT UINTN *BufferSize,\r
509 IN VOID *BufferPtr\r
510 );\r
511\r
512/** \r
513 Updates the IP receive filters of a network device and enables software filtering.\r
514 \r
515 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
516 @param NewFilter Pointer to the new set of IP receive filters.\r
517 \r
518 @retval EFI_SUCCESS The IP receive filter settings were updated.\r
519 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
520 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
521 \r
522**/\r
523typedef\r
524EFI_STATUS\r
8b13229b 525(EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER)(\r
d1f95000 526 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
527 IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter\r
528 );\r
529\r
530/** \r
531 Uses the ARP protocol to resolve a MAC address.\r
532 \r
533 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
534 @param IpAddr Pointer to the IP address that is used to resolve a MAC address.\r
535 @param MacAddr If not NULL, a pointer to the MAC address that was resolved with the\r
536 ARP protocol. \r
537 \r
538 @retval EFI_SUCCESS The IP or MAC address was resolved.\r
539 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
540 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
541 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
542 @retval EFI_ABORTED The callback function aborted the ARP Protocol.\r
543 @retval EFI_TIMEOUT The ARP Protocol encountered a timeout condition.\r
544 \r
545**/\r
546typedef\r
547EFI_STATUS\r
8b13229b 548(EFIAPI *EFI_PXE_BASE_CODE_ARP)(\r
d1f95000 549 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
550 IN EFI_IP_ADDRESS *IpAddr,\r
551 IN EFI_MAC_ADDRESS *MacAddr OPTIONAL\r
552 );\r
553\r
554/** \r
555 Updates the parameters that affect the operation of the PXE Base Code Protocol.\r
556 \r
557 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
558 @param NewAutoArp If not NULL, a pointer to a value that specifies whether to replace the\r
559 current value of AutoARP. \r
560 @param NewSendGUID If not NULL, a pointer to a value that specifies whether to replace the\r
561 current value of SendGUID. \r
562 @param NewTTL If not NULL, a pointer to be used in place of the current value of TTL,\r
563 the "time to live" field of the IP header. \r
564 @param NewToS If not NULL, a pointer to be used in place of the current value of ToS,\r
565 the "type of service" field of the IP header. \r
566 @param NewMakeCallback If not NULL, a pointer to a value that specifies whether to replace the\r
567 current value of the MakeCallback field of the Mode structure. \r
568 \r
569 @retval EFI_SUCCESS The new parameters values were updated.\r
570 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
571 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
572 \r
573**/\r
574typedef\r
575EFI_STATUS\r
8b13229b 576(EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS)(\r
d1f95000 577 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
578 IN BOOLEAN *NewAutoArp, OPTIONAL\r
579 IN BOOLEAN *NewSendGUID, OPTIONAL\r
580 IN UINT8 *NewTTL, OPTIONAL\r
581 IN UINT8 *NewToS, OPTIONAL\r
582 IN BOOLEAN *NewMakeCallback OPTIONAL\r
583 );\r
584\r
585/** \r
586 Updates the station IP address and/or subnet mask values of a network device.\r
587 \r
588 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
589 @param NewStationIp Pointer to the new IP address to be used by the network device. \r
590 @param NewSubnetMask Pointer to the new subnet mask to be used by the network device. \r
591 \r
592 @retval EFI_SUCCESS The new station IP address and/or subnet mask were updated.\r
593 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
594 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
595 \r
596**/\r
597typedef\r
598EFI_STATUS\r
8b13229b 599(EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP)(\r
d1f95000 600 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
601 IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL\r
602 IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL\r
603 );\r
604\r
605/** \r
606 Updates the contents of the cached DHCP and Discover packets.\r
607 \r
608 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
609 @param NewDhcpDiscoverValid Pointer to a value that will replace the current\r
610 DhcpDiscoverValid field. \r
611 @param NewDhcpAckReceived Pointer to a value that will replace the current\r
612 DhcpAckReceived field. \r
613 @param NewProxyOfferReceived Pointer to a value that will replace the current\r
614 ProxyOfferReceived field. \r
615 @param NewPxeDiscoverValid Pointer to a value that will replace the current \r
616 ProxyOfferReceived field. \r
617 @param NewPxeReplyReceived Pointer to a value that will replace the current\r
618 PxeReplyReceived field. \r
619 @param NewPxeBisReplyReceived Pointer to a value that will replace the current\r
620 PxeBisReplyReceived field. \r
621 @param NewDhcpDiscover Pointer to the new cached DHCP Discover packet contents. \r
622 @param NewDhcpAck Pointer to the new cached DHCP Ack packet contents.\r
623 @param NewProxyOffer Pointer to the new cached Proxy Offer packet contents.\r
624 @param NewPxeDiscover Pointer to the new cached PXE Discover packet contents.\r
625 @param NewPxeReply Pointer to the new cached PXE Reply packet contents.\r
626 @param NewPxeBisReply Pointer to the new cached PXE BIS Reply packet contents.\r
627 \r
628 @retval EFI_SUCCESS The cached packet contents were updated.\r
629 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
630 @retval EFI_INVALID_PARAMETER This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.\r
631 \r
632**/\r
633typedef\r
634EFI_STATUS\r
8b13229b 635(EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS)(\r
d1f95000 636 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
637 BOOLEAN *NewDhcpDiscoverValid, OPTIONAL\r
638 BOOLEAN *NewDhcpAckReceived, OPTIONAL\r
639 BOOLEAN *NewProxyOfferReceived, OPTIONAL\r
640 BOOLEAN *NewPxeDiscoverValid, OPTIONAL\r
641 BOOLEAN *NewPxeReplyReceived, OPTIONAL\r
642 BOOLEAN *NewPxeBisReplyReceived, OPTIONAL\r
643 IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover, OPTIONAL\r
644 IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck, OPTIONAL\r
645 IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer, OPTIONAL\r
646 IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover, OPTIONAL\r
647 IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply, OPTIONAL\r
648 IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL\r
649 );\r
650\r
651//\r
652// PXE Base Code Protocol structure\r
653//\r
a6508c05 654#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION 0x00010000\r
655\r
656//\r
657// Revision defined in EFI1.1\r
658// \r
659#define EFI_PXE_BASE_CODE_INTERFACE_REVISION EFI_PXE_BASE_CODE_PROTOCOL_REVISION\r
d1f95000 660\r
44717a39 661///\r
662/// The EFI_PXE_BASE_CODE_PROTOCOL is used to control PXE-compatible devices.\r
663/// An EFI_PXE_BASE_CODE_PROTOCOL will be layered on top of an\r
664/// EFI_MANAGED_NETWORK_PROTOCOL protocol in order to perform packet level transactions.\r
665/// The EFI_PXE_BASE_CODE_PROTOCOL handle also supports the\r
666/// EFI_LOAD_FILE_PROTOCOL protocol. This provides a clean way to obtain control from the\r
667/// boot manager if the boot path is from the remote device.\r
668///\r
d1f95000 669struct _EFI_PXE_BASE_CODE_PROTOCOL {\r
1f08a159 670 ///\r
671 /// The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must \r
672 /// be backwards compatible. If a future version is not backwards compatible \r
673 /// it is not the same GUID.\r
674 ///\r
d1f95000 675 UINT64 Revision;\r
676 EFI_PXE_BASE_CODE_START Start;\r
677 EFI_PXE_BASE_CODE_STOP Stop;\r
678 EFI_PXE_BASE_CODE_DHCP Dhcp;\r
679 EFI_PXE_BASE_CODE_DISCOVER Discover;\r
680 EFI_PXE_BASE_CODE_MTFTP Mtftp;\r
681 EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite;\r
682 EFI_PXE_BASE_CODE_UDP_READ UdpRead;\r
683 EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter;\r
684 EFI_PXE_BASE_CODE_ARP Arp;\r
685 EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters;\r
686 EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp;\r
687 EFI_PXE_BASE_CODE_SET_PACKETS SetPackets;\r
44717a39 688 ///\r
689 /// Pointer to the EFI_PXE_BASE_CODE_MODE data for this device.\r
690 ///\r
d1f95000 691 EFI_PXE_BASE_CODE_MODE *Mode;\r
692};\r
693\r
694extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;\r
695\r
696#endif \r