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