]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/PxeBaseCode.h
Code Scrub for Protocol and Ppi Definition
[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
18//\r
19// PXE Base Code protocol\r
20//\r
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
28//\r
29// Protocol defined in EFI1.1.\r
30// \r
31typedef EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE;\r
d1f95000 32\r
33//\r
34// Default IP TTL and ToS.\r
35//\r
36#define DEFAULT_TTL 16\r
37#define DEFAULT_ToS 0\r
38\r
39//\r
40// ICMP error format\r
41//\r
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
58//\r
59// TFTP error format\r
60//\r
61typedef struct {\r
62 UINT8 ErrorCode;\r
63 CHAR8 ErrorString[127];\r
64} EFI_PXE_BASE_CODE_TFTP_ERROR;\r
65\r
66//\r
67// IP Receive Filter definitions\r
68//\r
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
83//\r
84// ARP Cache definitions\r
85//\r
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
139//\r
140// Discover() server list structure.\r
141//\r
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
149//\r
150// Discover() information override structure.\r
151//\r
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
162//\r
163// Mtftp() definitions\r
164//\r
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
185//\r
186// PXE Base Code Mode structure\r
187//\r
188#define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8\r
189#define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8\r
190\r
191typedef struct {\r
192 BOOLEAN Started;\r
193 BOOLEAN Ipv6Available;\r
194 BOOLEAN Ipv6Supported;\r
195 BOOLEAN UsingIpv6;\r
196 BOOLEAN BisSupported;\r
197 BOOLEAN BisDetected;\r
198 BOOLEAN AutoArp;\r
199 BOOLEAN SendGUID;\r
200 BOOLEAN DhcpDiscoverValid;\r
201 BOOLEAN DhcpAckReceived;\r
202 BOOLEAN ProxyOfferReceived;\r
203 BOOLEAN PxeDiscoverValid;\r
204 BOOLEAN PxeReplyReceived;\r
205 BOOLEAN PxeBisReplyReceived;\r
206 BOOLEAN IcmpErrorReceived;\r
207 BOOLEAN TftpErrorReceived;\r
208 BOOLEAN MakeCallbacks;\r
209 UINT8 TTL;\r
210 UINT8 ToS;\r
211 EFI_IP_ADDRESS StationIp;\r
212 EFI_IP_ADDRESS SubnetMask;\r
213 EFI_PXE_BASE_CODE_PACKET DhcpDiscover;\r
214 EFI_PXE_BASE_CODE_PACKET DhcpAck;\r
215 EFI_PXE_BASE_CODE_PACKET ProxyOffer;\r
216 EFI_PXE_BASE_CODE_PACKET PxeDiscover;\r
217 EFI_PXE_BASE_CODE_PACKET PxeReply;\r
218 EFI_PXE_BASE_CODE_PACKET PxeBisReply;\r
219 EFI_PXE_BASE_CODE_IP_FILTER IpFilter;\r
220 UINT32 ArpCacheEntries;\r
221 EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];\r
222 UINT32 RouteTableEntries;\r
223 EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];\r
224 EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError;\r
225 EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;\r
226} EFI_PXE_BASE_CODE_MODE;\r
227\r
228//\r
229// PXE Base Code Interface Function definitions\r
230//\r
231\r
232/** \r
233 Enables the use of the PXE Base Code Protocol functions.\r
234 \r
235 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
236 @param UseIpv6 Specifies the type of IP addresses that are to be used during the session\r
237 that is being started. Set to TRUE for IPv6 addresses, and FALSE for \r
238 IPv4 addresses. \r
239 \r
240 @retval EFI_SUCCESS The PXE Base Code Protocol was started.\r
241 @retval EFI_DEVICE_ERROR The network device encountered an error during this oper \r
242 @retval EFI_UNSUPPORTED UseIpv6 is TRUE, but the Ipv6Supported field of the\r
243 EFI_PXE_BASE_CODE_MODE structure is FALSE. \r
244 @retval EFI_ALREADY_STARTED The PXE Base Code Protocol is already in the started state. \r
245 @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
246 EFI_PXE_BASE_CODE_PROTOCOL structure. \r
247 @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory or other resources to start the \r
248 PXE Base Code Protocol. \r
249 \r
250**/\r
251typedef\r
252EFI_STATUS\r
8b13229b 253(EFIAPI *EFI_PXE_BASE_CODE_START)(\r
d1f95000 254 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
255 IN BOOLEAN UseIpv6\r
256 );\r
257\r
258/** \r
259 Disables the use of the PXE Base Code Protocol functions.\r
260 \r
261 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
262 \r
263 @retval EFI_SUCCESS The PXE Base Code Protocol was stopped.\r
264 @retval EFI_NOT_STARTED The PXE Base Code Protocol is already in the stopped state. \r
265 @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
266 EFI_PXE_BASE_CODE_PROTOCOL structure. \r
267 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
268 \r
269**/\r
270typedef\r
271EFI_STATUS\r
8b13229b 272(EFIAPI *EFI_PXE_BASE_CODE_STOP)(\r
d1f95000 273 IN EFI_PXE_BASE_CODE_PROTOCOL *This\r
274 );\r
275\r
276/** \r
277 Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6\r
278 S.A.R.R (solicit / advertise / request / reply) sequence.\r
279 \r
280 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
281 @param SortOffers TRUE if the offers received should be sorted. Set to FALSE to try the\r
282 offers in the order that they are received. \r
283 \r
284 @retval EFI_SUCCESS Valid DHCP has completed.\r
285 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
286 @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
287 EFI_PXE_BASE_CODE_PROTOCOL structure. \r
288 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
289 @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete the DHCP Protocol.\r
290 @retval EFI_ABORTED The callback function aborted the DHCP Protocol.\r
291 @retval EFI_TIMEOUT The DHCP Protocol timed out.\r
292 @retval EFI_ICMP_ERROR An ICMP error packet was received during the DHCP session.\r
293 @retval EFI_NO_RESPONSE Valid PXE offer was not received.\r
294 \r
295**/\r
296typedef\r
297EFI_STATUS\r
8b13229b 298(EFIAPI *EFI_PXE_BASE_CODE_DHCP)(\r
d1f95000 299 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
300 IN BOOLEAN SortOffers\r
301 );\r
302\r
303/** \r
304 Attempts to complete the PXE Boot Server and/or boot image discovery sequence.\r
305 \r
306 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
307 @param Type The type of bootstrap to perform.\r
308 @param Layer Pointer to the boot server layer number to discover, which must be\r
309 PXE_BOOT_LAYER_INITIAL when a new server type is being \r
310 discovered. \r
311 @param UseBis TRUE if Boot Integrity Services are to be used. FALSE otherwise. \r
312 @param Info Pointer to a data structure that contains additional information on the\r
313 type of discovery operation that is to be performed. \r
314 \r
315 @retval EFI_SUCCESS The Discovery sequence has been completed.\r
316 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
317 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
318 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
319 @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete Discovery.\r
320 @retval EFI_ABORTED The callback function aborted the Discovery sequence.\r
321 @retval EFI_TIMEOUT The Discovery sequence timed out.\r
322 @retval EFI_ICMP_ERROR An ICMP error packet was received during the PXE discovery\r
323 session. \r
324 \r
325**/\r
326typedef\r
327EFI_STATUS\r
8b13229b 328(EFIAPI *EFI_PXE_BASE_CODE_DISCOVER)(\r
d1f95000 329 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
330 IN UINT16 Type,\r
331 IN UINT16 *Layer,\r
332 IN BOOLEAN UseBis,\r
333 IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL\r
334 );\r
335\r
336/** \r
337 Used to perform TFTP and MTFTP services.\r
338 \r
339 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
340 @param Operation The type of operation to perform.\r
341 @param BufferPtr A pointer to the data buffer. \r
342 @param Overwrite Only used on write file operations. TRUE if a file on a remote server can\r
343 be overwritten. \r
344 @param BufferSize For get-file-size operations, *BufferSize returns the size of the\r
345 requested file. \r
346 @param BlockSize The requested block size to be used during a TFTP transfer.\r
347 @param ServerIp The TFTP / MTFTP server IP address.\r
348 @param Filename A Null-terminated ASCII string that specifies a directory name or a file\r
349 name. \r
350 @param Info Pointer to the MTFTP information.\r
351 @param DontUseBuffer Set to FALSE for normal TFTP and MTFTP read file operation. \r
352 \r
353 @retval EFI_SUCCESS The TFTP/MTFTP operation was completed.\r
354 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
355 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
356 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. \r
357 @retval EFI_BUFFER_TOO_SMALL The buffer is not large enough to complete the read operation. \r
358 @retval EFI_ABORTED The callback function aborted the TFTP/MTFTP operation.\r
359 @retval EFI_TIMEOUT The TFTP/MTFTP operation timed out.\r
360 @retval EFI_ICMP_ERROR An ICMP error packet was received during the MTFTP session.\r
361 @retval EFI_TFTP_ERROR A TFTP error packet was received during the MTFTP session.\r
362 \r
363**/\r
364typedef\r
365EFI_STATUS\r
8b13229b 366(EFIAPI *EFI_PXE_BASE_CODE_MTFTP)(\r
d1f95000 367 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
368 IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,\r
369 IN OUT VOID *BufferPtr OPTIONAL,\r
370 IN BOOLEAN Overwrite,\r
371 IN OUT UINT64 *BufferSize,\r
372 IN UINTN *BlockSize OPTIONAL,\r
373 IN EFI_IP_ADDRESS *ServerIp,\r
374 IN UINT8 *Filename OPTIONAL,\r
375 IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,\r
376 IN BOOLEAN DontUseBuffer\r
377 );\r
378\r
379/** \r
380 Writes a UDP packet to the network interface.\r
381 \r
382 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
383 @param OpFlags The UDP operation flags. \r
384 @param DestIp The destination IP address.\r
385 @param DestPort The destination UDP port number. \r
386 @param GatewayIp The gateway IP address. \r
387 @param SrcIp The source IP address.\r
388 @param SrcPort The source UDP port number.\r
389 @param HeaderSize An optional field which may be set to the length of a header at\r
390 HeaderPtr to be prefixed to the data at BufferPtr. \r
391 @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
392 data at BufferPtr. \r
393 @param BufferSize A pointer to the size of the data at BufferPtr.\r
394 @param BufferPtr A pointer to the data to be written.\r
395 \r
396 @retval EFI_SUCCESS The UDP Write operation was completed.\r
397 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
398 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
399 @retval EFI_BAD_BUFFER_SIZE The buffer is too long to be transmitted. \r
400 @retval EFI_ABORTED The callback function aborted the UDP Write operation.\r
401 @retval EFI_TIMEOUT The UDP Write operation timed out.\r
402 @retval EFI_ICMP_ERROR An ICMP error packet was received during the UDP write session. \r
403 \r
404**/\r
405typedef\r
406EFI_STATUS\r
8b13229b 407(EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE)(\r
d1f95000 408 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
409 IN UINT16 OpFlags,\r
410 IN EFI_IP_ADDRESS *DestIp,\r
411 IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,\r
412 IN EFI_IP_ADDRESS *GatewayIp, OPTIONAL\r
413 IN EFI_IP_ADDRESS *SrcIp, OPTIONAL\r
414 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL\r
415 IN UINTN *HeaderSize, OPTIONAL\r
416 IN VOID *HeaderPtr, OPTIONAL\r
417 IN UINTN *BufferSize,\r
418 IN VOID *BufferPtr\r
419 );\r
420\r
421/** \r
422 Reads a UDP packet from the network interface.\r
423 \r
424 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
425 @param OpFlags The UDP operation flags. \r
426 @param DestIp The destination IP address.\r
427 @param DestPort The destination UDP port number. \r
428 @param GatewayIp The gateway IP address. \r
429 @param SrcIp The source IP address.\r
430 @param SrcPort The source UDP port number.\r
431 @param HeaderSize An optional field which may be set to the length of a header at\r
432 HeaderPtr to be prefixed to the data at BufferPtr. \r
433 @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
434 data at BufferPtr. \r
435 @param BufferSize A pointer to the size of the data at BufferPtr.\r
436 @param BufferPtr A pointer to the data to be read.\r
437 \r
438 @retval EFI_SUCCESS The UDP Write operation was completed.\r
439 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
440 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
441 @retval EFI_DEVICE_ERROR The network device encountered an error during this operation.\r
442 @retval EFI_BUFFER_TOO_SMALL The packet is larger than Buffer can hold.\r
443 @retval EFI_ABORTED The callback function aborted the UDP Read operation.\r
444 @retval EFI_TIMEOUT The UDP Read operation timed out. \r
445 \r
446**/\r
447typedef\r
448EFI_STATUS\r
8b13229b 449(EFIAPI *EFI_PXE_BASE_CODE_UDP_READ)(\r
d1f95000 450 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
451 IN UINT16 OpFlags,\r
452 IN OUT EFI_IP_ADDRESS *DestIp, OPTIONAL\r
453 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort, OPTIONAL\r
454 IN OUT EFI_IP_ADDRESS *SrcIp, OPTIONAL\r
455 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL\r
456 IN UINTN *HeaderSize, OPTIONAL\r
457 IN VOID *HeaderPtr, OPTIONAL\r
458 IN OUT UINTN *BufferSize,\r
459 IN VOID *BufferPtr\r
460 );\r
461\r
462/** \r
463 Updates the IP receive filters of a network device and enables software filtering.\r
464 \r
465 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
466 @param NewFilter Pointer to the new set of IP receive filters.\r
467 \r
468 @retval EFI_SUCCESS The IP receive filter settings were updated.\r
469 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
470 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
471 \r
472**/\r
473typedef\r
474EFI_STATUS\r
8b13229b 475(EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER)(\r
d1f95000 476 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
477 IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter\r
478 );\r
479\r
480/** \r
481 Uses the ARP protocol to resolve a MAC address.\r
482 \r
483 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
484 @param IpAddr Pointer to the IP address that is used to resolve a MAC address.\r
485 @param MacAddr If not NULL, a pointer to the MAC address that was resolved with the\r
486 ARP protocol. \r
487 \r
488 @retval EFI_SUCCESS The IP or MAC address was resolved.\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_ABORTED The callback function aborted the ARP Protocol.\r
493 @retval EFI_TIMEOUT The ARP Protocol encountered a timeout condition.\r
494 \r
495**/\r
496typedef\r
497EFI_STATUS\r
8b13229b 498(EFIAPI *EFI_PXE_BASE_CODE_ARP)(\r
d1f95000 499 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
500 IN EFI_IP_ADDRESS *IpAddr,\r
501 IN EFI_MAC_ADDRESS *MacAddr OPTIONAL\r
502 );\r
503\r
504/** \r
505 Updates the parameters that affect the operation of the PXE Base Code Protocol.\r
506 \r
507 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
508 @param NewAutoArp If not NULL, a pointer to a value that specifies whether to replace the\r
509 current value of AutoARP. \r
510 @param NewSendGUID If not NULL, a pointer to a value that specifies whether to replace the\r
511 current value of SendGUID. \r
512 @param NewTTL If not NULL, a pointer to be used in place of the current value of TTL,\r
513 the "time to live" field of the IP header. \r
514 @param NewToS If not NULL, a pointer to be used in place of the current value of ToS,\r
515 the "type of service" field of the IP header. \r
516 @param NewMakeCallback If not NULL, a pointer to a value that specifies whether to replace the\r
517 current value of the MakeCallback field of the Mode structure. \r
518 \r
519 @retval EFI_SUCCESS The new parameters values were updated.\r
520 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
521 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
522 \r
523**/\r
524typedef\r
525EFI_STATUS\r
8b13229b 526(EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS)(\r
d1f95000 527 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
528 IN BOOLEAN *NewAutoArp, OPTIONAL\r
529 IN BOOLEAN *NewSendGUID, OPTIONAL\r
530 IN UINT8 *NewTTL, OPTIONAL\r
531 IN UINT8 *NewToS, OPTIONAL\r
532 IN BOOLEAN *NewMakeCallback OPTIONAL\r
533 );\r
534\r
535/** \r
536 Updates the station IP address and/or subnet mask values of a network device.\r
537 \r
538 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
539 @param NewStationIp Pointer to the new IP address to be used by the network device. \r
540 @param NewSubnetMask Pointer to the new subnet mask to be used by the network device. \r
541 \r
542 @retval EFI_SUCCESS The new station IP address and/or subnet mask were updated.\r
543 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
544 @retval EFI_INVALID_PARAMETER One or more parameters are invalid. \r
545 \r
546**/\r
547typedef\r
548EFI_STATUS\r
8b13229b 549(EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP)(\r
d1f95000 550 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
551 IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL\r
552 IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL\r
553 );\r
554\r
555/** \r
556 Updates the contents of the cached DHCP and Discover packets.\r
557 \r
558 @param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
559 @param NewDhcpDiscoverValid Pointer to a value that will replace the current\r
560 DhcpDiscoverValid field. \r
561 @param NewDhcpAckReceived Pointer to a value that will replace the current\r
562 DhcpAckReceived field. \r
563 @param NewProxyOfferReceived Pointer to a value that will replace the current\r
564 ProxyOfferReceived field. \r
565 @param NewPxeDiscoverValid Pointer to a value that will replace the current \r
566 ProxyOfferReceived field. \r
567 @param NewPxeReplyReceived Pointer to a value that will replace the current\r
568 PxeReplyReceived field. \r
569 @param NewPxeBisReplyReceived Pointer to a value that will replace the current\r
570 PxeBisReplyReceived field. \r
571 @param NewDhcpDiscover Pointer to the new cached DHCP Discover packet contents. \r
572 @param NewDhcpAck Pointer to the new cached DHCP Ack packet contents.\r
573 @param NewProxyOffer Pointer to the new cached Proxy Offer packet contents.\r
574 @param NewPxeDiscover Pointer to the new cached PXE Discover packet contents.\r
575 @param NewPxeReply Pointer to the new cached PXE Reply packet contents.\r
576 @param NewPxeBisReply Pointer to the new cached PXE BIS Reply packet contents.\r
577 \r
578 @retval EFI_SUCCESS The cached packet contents were updated.\r
579 @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.\r
580 @retval EFI_INVALID_PARAMETER This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.\r
581 \r
582**/\r
583typedef\r
584EFI_STATUS\r
8b13229b 585(EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS)(\r
d1f95000 586 IN EFI_PXE_BASE_CODE_PROTOCOL *This,\r
587 BOOLEAN *NewDhcpDiscoverValid, OPTIONAL\r
588 BOOLEAN *NewDhcpAckReceived, OPTIONAL\r
589 BOOLEAN *NewProxyOfferReceived, OPTIONAL\r
590 BOOLEAN *NewPxeDiscoverValid, OPTIONAL\r
591 BOOLEAN *NewPxeReplyReceived, OPTIONAL\r
592 BOOLEAN *NewPxeBisReplyReceived, OPTIONAL\r
593 IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover, OPTIONAL\r
594 IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck, OPTIONAL\r
595 IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer, OPTIONAL\r
596 IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover, OPTIONAL\r
597 IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply, OPTIONAL\r
598 IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL\r
599 );\r
600\r
601//\r
602// PXE Base Code Protocol structure\r
603//\r
a6508c05 604#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION 0x00010000\r
605\r
606//\r
607// Revision defined in EFI1.1\r
608// \r
609#define EFI_PXE_BASE_CODE_INTERFACE_REVISION EFI_PXE_BASE_CODE_PROTOCOL_REVISION\r
d1f95000 610\r
4ca9b6c4
LG
611/** \r
612 @par Protocol Description:\r
613 The EFI_PXE_BASE_CODE_PROTOCOL is used to control PXE-compatible devices.\r
614 An EFI_PXE_BASE_CODE_PROTOCOL will be layered on top of an\r
615 EFI_MANAGED_NETWORK_PROTOCOL protocol in order to perform packet level transactions.\r
616 The EFI_PXE_BASE_CODE_PROTOCOL handle also supports the\r
617 EFI_LOAD_FILE_PROTOCOL protocol. This provides a clean way to obtain control from the\r
618 boot manager if the boot path is from the remote device.\r
619\r
620 @param Revision\r
621 The revision of the EFI_PXE_BASE_CODE_PROTOCOL. All future revisions must \r
622 be backwards compatible. If a future version is not backwards compatible \r
623 it is not the same GUID.\r
624\r
625 @param Start\r
626 Starts the PXE Base Code Protocol. Mode structure information is not valid and \r
627 no other Base Code Protocol functions will operate until the Base Code is started. \r
628\r
629 @param Stop\r
630 Stops the PXE Base Code Protocol. Mode structure information is unchanged by this function. \r
631 No Base Code Protocol functions will operate until the Base Code is restarted. \r
632\r
633 @param Dhcp\r
634 Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) \r
635 or DHCPv6 S.A.R.R (solicit / advertise / request / reply) sequence. \r
636\r
637 @param Discover\r
638 Attempts to complete the PXE Boot Server and/or boot image discovery sequence. \r
639\r
640 @param Mtftp\r
641 Performs TFTP and MTFTP services. \r
642\r
643 @param UdpWrite\r
644 Writes a UDP packet to the network interface. \r
645\r
646 @param UdpRead\r
647 Reads a UDP packet from the network interface. \r
648\r
649 @param SetIpFilter\r
650 Updates the IP receive filters of the network device. \r
651\r
652 @param Arp\r
653 Uses the ARP protocol to resolve a MAC address. \r
654\r
655 @param SetParameters\r
656 Updates the parameters that affect the operation of the PXE Base Code Protocol. \r
657\r
658 @param SetStationIp\r
659 Updates the station IP address and subnet mask values. \r
660\r
661 @param SetPackets\r
662 Updates the contents of the cached DHCP and Discover packets. \r
663\r
664 @param Mode\r
665 Pointer to the EFI_PXE_BASE_CODE_MODE data for this device. \r
666\r
667**/\r
d1f95000 668struct _EFI_PXE_BASE_CODE_PROTOCOL {\r
669 UINT64 Revision;\r
670 EFI_PXE_BASE_CODE_START Start;\r
671 EFI_PXE_BASE_CODE_STOP Stop;\r
672 EFI_PXE_BASE_CODE_DHCP Dhcp;\r
673 EFI_PXE_BASE_CODE_DISCOVER Discover;\r
674 EFI_PXE_BASE_CODE_MTFTP Mtftp;\r
675 EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite;\r
676 EFI_PXE_BASE_CODE_UDP_READ UdpRead;\r
677 EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter;\r
678 EFI_PXE_BASE_CODE_ARP Arp;\r
679 EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters;\r
680 EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp;\r
681 EFI_PXE_BASE_CODE_SET_PACKETS SetPackets;\r
682 EFI_PXE_BASE_CODE_MODE *Mode;\r
683};\r
684\r
685extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;\r
686\r
687#endif \r