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