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