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