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