7 Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
8 This software and associated documentation (if any) is furnished
9 under a license and may only be used or copied in accordance
10 with the terms of the license. Except as permitted by such
11 license, no part of this software or documentation may be
12 reproduced, stored in a retrieval system, or transmitted in any
13 form or by any means without the express written consent of
22 EFI PXE Base Code Protocol
31 // PXE Base Code protocol
34 #define EFI_PXE_BASE_CODE_PROTOCOL \
35 { 0x03c4e603, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
37 INTERFACE_DECL(_EFI_PXE_BASE_CODE);
42 // Address definitions
51 typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;
69 UINT8 BootpHwAddr[16];
70 UINT8 BootpSrvName[64];
71 UINT8 BootpBootFile[128];
73 UINT8 DhcpOptions[56];
74 } EFI_PXE_BASE_CODE_DHCPV4_PACKET;
79 //} EFI_PXE_BASE_CODE_DHCPV6_PACKET;
83 EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;
84 // EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6;
85 } EFI_PXE_BASE_CODE_PACKET;
101 } EFI_PXE_BASE_CODE_ICMP_ERROR;
105 CHAR8 ErrorString[127];
106 } EFI_PXE_BASE_CODE_TFTP_ERROR;
109 // IP Receive Filter definitions
111 #define EFI_PXE_BASE_CODE_MAX_IPCNT 8
116 EFI_IP_ADDRESS IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];
117 } EFI_PXE_BASE_CODE_IP_FILTER;
119 #define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001
120 #define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002
121 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004
122 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008
125 // ARP Cache definitions
129 EFI_IP_ADDRESS IpAddr;
130 EFI_MAC_ADDRESS MacAddr;
131 } EFI_PXE_BASE_CODE_ARP_ENTRY;
134 EFI_IP_ADDRESS IpAddr;
135 EFI_IP_ADDRESS SubnetMask;
136 EFI_IP_ADDRESS GwAddr;
137 } EFI_PXE_BASE_CODE_ROUTE_ENTRY;
143 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001
144 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002
145 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004
146 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008
147 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010
148 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020
151 // Discover() definitions
154 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0
155 #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1
156 #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2
157 #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3
158 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4
159 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5
160 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6
161 #define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7
162 #define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8
163 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9
164 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10
165 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11
166 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12
167 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13
168 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14
169 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15
170 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16
172 // 17 through 32767 are reserved
173 // 32768 through 65279 are for vendor use
174 // 65280 through 65534 are reserved
176 #define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535
178 #define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF
179 #define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000
180 #define EFI_PXE_BASE_CODE_BOOT_LAYER_CREDENTIALS 0x8000
185 BOOLEAN AcceptAnyResponse;
187 EFI_IP_ADDRESS IpAddr;
188 } EFI_PXE_BASE_CODE_SRVLIST;
195 EFI_IP_ADDRESS ServerMCastIp;
197 EFI_PXE_BASE_CODE_SRVLIST SrvList[1];
198 } EFI_PXE_BASE_CODE_DISCOVER_INFO;
201 // Mtftp() definitions
205 EFI_PXE_BASE_CODE_TFTP_FIRST,
206 EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,
207 EFI_PXE_BASE_CODE_TFTP_READ_FILE,
208 EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,
209 EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,
210 EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,
211 EFI_PXE_BASE_CODE_MTFTP_READ_FILE,
212 EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,
213 EFI_PXE_BASE_CODE_MTFTP_LAST
214 } EFI_PXE_BASE_CODE_TFTP_OPCODE;
217 EFI_IP_ADDRESS MCastIp;
218 EFI_PXE_BASE_CODE_UDP_PORT CPort;
219 EFI_PXE_BASE_CODE_UDP_PORT SPort;
220 UINT16 ListenTimeout;
221 UINT16 TransmitTimeout;
222 } EFI_PXE_BASE_CODE_MTFTP_INFO;
225 // PXE Base Code Mode structure
228 #define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8
229 #define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8
233 BOOLEAN Ipv6Available;
234 BOOLEAN Ipv6Supported;
236 BOOLEAN BisSupported;
240 BOOLEAN DhcpDiscoverValid;
241 BOOLEAN DhcpAckReceived;
242 BOOLEAN ProxyOfferReceived;
243 BOOLEAN PxeDiscoverValid;
244 BOOLEAN PxeReplyReceived;
245 BOOLEAN PxeBisReplyReceived;
246 BOOLEAN IcmpErrorReceived;
247 BOOLEAN TftpErrorReceived;
248 BOOLEAN MakeCallbacks;
251 EFI_IP_ADDRESS StationIp;
252 EFI_IP_ADDRESS SubnetMask;
253 EFI_PXE_BASE_CODE_PACKET DhcpDiscover;
254 EFI_PXE_BASE_CODE_PACKET DhcpAck;
255 EFI_PXE_BASE_CODE_PACKET ProxyOffer;
256 EFI_PXE_BASE_CODE_PACKET PxeDiscover;
257 EFI_PXE_BASE_CODE_PACKET PxeReply;
258 EFI_PXE_BASE_CODE_PACKET PxeBisReply;
259 EFI_PXE_BASE_CODE_IP_FILTER IpFilter;
260 UINT32 ArpCacheEntries;
261 EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];
262 UINT32 RouteTableEntries;
263 EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];
264 EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError;
265 EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;
266 } EFI_PXE_BASE_CODE_MODE;
269 // PXE Base Code Interface Function definitions
274 (EFIAPI *EFI_PXE_BASE_CODE_START) (
275 IN struct _EFI_PXE_BASE_CODE *This,
281 (EFIAPI *EFI_PXE_BASE_CODE_STOP) (
282 IN struct _EFI_PXE_BASE_CODE *This
287 (EFIAPI *EFI_PXE_BASE_CODE_DHCP) (
288 IN struct _EFI_PXE_BASE_CODE *This,
289 IN BOOLEAN SortOffers
294 (EFIAPI *EFI_PXE_BASE_CODE_DISCOVER) (
295 IN struct _EFI_PXE_BASE_CODE *This,
299 IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL
304 (EFIAPI *EFI_PXE_BASE_CODE_MTFTP) (
305 IN struct _EFI_PXE_BASE_CODE *This,
306 IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,
307 IN OUT VOID *BufferPtr OPTIONAL,
308 IN BOOLEAN Overwrite,
309 IN OUT UINT64 *BufferSize,
310 IN UINTN *BlockSize OPTIONAL,
311 IN EFI_IP_ADDRESS *ServerIp,
313 IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,
314 IN BOOLEAN DontUseBuffer
319 (EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE) (
320 IN struct _EFI_PXE_BASE_CODE *This,
322 IN EFI_IP_ADDRESS *DestIp,
323 IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,
324 IN EFI_IP_ADDRESS *GatewayIp, OPTIONAL
325 IN EFI_IP_ADDRESS *SrcIp, OPTIONAL
326 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL
327 IN UINTN *HeaderSize, OPTIONAL
328 IN VOID *HeaderPtr, OPTIONAL
329 IN UINTN *BufferSize,
335 (EFIAPI *EFI_PXE_BASE_CODE_UDP_READ) (
336 IN struct _EFI_PXE_BASE_CODE *This,
338 IN OUT EFI_IP_ADDRESS *DestIp, OPTIONAL
339 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort, OPTIONAL
340 IN OUT EFI_IP_ADDRESS *SrcIp, OPTIONAL
341 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL
342 IN UINTN *HeaderSize, OPTIONAL
343 IN VOID *HeaderPtr, OPTIONAL
344 IN OUT UINTN *BufferSize,
350 (EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER) (
351 IN struct _EFI_PXE_BASE_CODE *This,
352 IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter
357 (EFIAPI *EFI_PXE_BASE_CODE_ARP) (
358 IN struct _EFI_PXE_BASE_CODE *This,
359 IN EFI_IP_ADDRESS *IpAddr,
360 IN EFI_MAC_ADDRESS *MacAddr OPTIONAL
365 (EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS) (
366 IN struct _EFI_PXE_BASE_CODE *This,
367 IN BOOLEAN *NewAutoArp, OPTIONAL
368 IN BOOLEAN *NewSendGUID, OPTIONAL
369 IN UINT8 *NewTTL, OPTIONAL
370 IN UINT8 *NewToS, OPTIONAL
371 IN BOOLEAN *NewMakeCallback OPTIONAL
376 (EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP) (
377 IN struct _EFI_PXE_BASE_CODE *This,
378 IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL
379 IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL
384 (EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS) (
385 IN struct _EFI_PXE_BASE_CODE *This,
386 BOOLEAN *NewDhcpDiscoverValid, OPTIONAL
387 BOOLEAN *NewDhcpAckReceived, OPTIONAL
388 BOOLEAN *NewProxyOfferReceived, OPTIONAL
389 BOOLEAN *NewPxeDiscoverValid, OPTIONAL
390 BOOLEAN *NewPxeReplyReceived, OPTIONAL
391 BOOLEAN *NewPxeBisReplyReceived,OPTIONAL
392 IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover, OPTIONAL
393 IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck, OPTIONAL
394 IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer, OPTIONAL
395 IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover, OPTIONAL
396 IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply, OPTIONAL
397 IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL
401 // PXE Base Code Protocol structure
404 #define EFI_PXE_BASE_CODE_INTERFACE_REVISION 0x00010000
406 typedef struct _EFI_PXE_BASE_CODE {
408 EFI_PXE_BASE_CODE_START Start;
409 EFI_PXE_BASE_CODE_STOP Stop;
410 EFI_PXE_BASE_CODE_DHCP Dhcp;
411 EFI_PXE_BASE_CODE_DISCOVER Discover;
412 EFI_PXE_BASE_CODE_MTFTP Mtftp;
413 EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite;
414 EFI_PXE_BASE_CODE_UDP_READ UdpRead;
415 EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter;
416 EFI_PXE_BASE_CODE_ARP Arp;
417 EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters;
418 EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp;
419 EFI_PXE_BASE_CODE_SET_PACKETS SetPackets;
420 EFI_PXE_BASE_CODE_MODE *Mode;
424 // Call Back Definitions
427 #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL \
428 { 0x245dca21, 0xfb7b, 0x11d3, 0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
434 #define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION 0x00010000
436 INTERFACE_DECL(_EFI_PXE_BASE_CODE_CALLBACK);
439 EFI_PXE_BASE_CODE_FUNCTION_FIRST,
440 EFI_PXE_BASE_CODE_FUNCTION_DHCP,
441 EFI_PXE_BASE_CODE_FUNCTION_DISCOVER,
442 EFI_PXE_BASE_CODE_FUNCTION_MTFTP,
443 EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE,
444 EFI_PXE_BASE_CODE_FUNCTION_UDP_READ,
445 EFI_PXE_BASE_CODE_FUNCTION_ARP,
446 EFI_PXE_BASE_CODE_FUNCTION_IGMP,
447 EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST
448 } EFI_PXE_BASE_CODE_FUNCTION;
451 EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST,
452 EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
453 EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT,
454 EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST
455 } EFI_PXE_BASE_CODE_CALLBACK_STATUS;
458 EFI_PXE_BASE_CODE_CALLBACK_STATUS
459 (EFIAPI *EFI_PXE_CALLBACK) (
460 IN struct _EFI_PXE_BASE_CODE_CALLBACK *This,
461 IN EFI_PXE_BASE_CODE_FUNCTION Function,
464 IN EFI_PXE_BASE_CODE_PACKET *Packet OPTIONAL
467 typedef struct _EFI_PXE_BASE_CODE_CALLBACK {
469 EFI_PXE_CALLBACK Callback;
470 } EFI_PXE_BASE_CODE_CALLBACK;
472 #endif /* _EFIPXEBC_H */