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