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