6 Copyright (c) 1998 Intel Corporation
14 EFI PXE Base Code Protocol
23 // PXE Base Code protocol
26 #define EFI_PXE_BASE_CODE_PROTOCOL \
27 { 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
29 INTERFACE_DECL(_EFI_PXE_BASE_CODE
);
34 // Address definitions
43 typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT
;
61 UINT8 BootpHwAddr
[16];
62 UINT8 BootpSrvName
[64];
63 UINT8 BootpBootFile
[128];
65 UINT8 DhcpOptions
[56];
66 } EFI_PXE_BASE_CODE_DHCPV4_PACKET
;
70 UINT32 TransactionId
:24;
71 UINT8 DhcpOptions
[1024];
72 } EFI_PXE_BASE_CODE_DHCPV6_PACKET
;
76 EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4
;
77 EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6
;
78 } EFI_PXE_BASE_CODE_PACKET
;
94 } EFI_PXE_BASE_CODE_ICMP_ERROR
;
98 CHAR8 ErrorString
[127];
99 } EFI_PXE_BASE_CODE_TFTP_ERROR
;
102 // IP Receive Filter definitions
104 #define EFI_PXE_BASE_CODE_MAX_IPCNT 8
109 EFI_IP_ADDRESS IpList
[EFI_PXE_BASE_CODE_MAX_IPCNT
];
110 } EFI_PXE_BASE_CODE_IP_FILTER
;
112 #define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001
113 #define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002
114 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004
115 #define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008
118 // ARP Cache definitions
122 EFI_IP_ADDRESS IpAddr
;
123 EFI_MAC_ADDRESS MacAddr
;
124 } EFI_PXE_BASE_CODE_ARP_ENTRY
;
127 EFI_IP_ADDRESS IpAddr
;
128 EFI_IP_ADDRESS SubnetMask
;
129 EFI_IP_ADDRESS GwAddr
;
130 } EFI_PXE_BASE_CODE_ROUTE_ENTRY
;
136 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001
137 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002
138 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004
139 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008
140 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010
141 #define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020
144 // Discover() definitions
147 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0
148 #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1
149 #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2
150 #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3
151 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4
152 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5
153 #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6
154 #define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7
155 #define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8
156 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9
157 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10
158 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11
159 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12
160 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13
161 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14
162 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15
163 #define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16
165 // 17 through 32767 are reserved
166 // 32768 through 65279 are for vendor use
167 // 65280 through 65534 are reserved
169 #define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535
171 #define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF
172 #define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000
177 BOOLEAN AcceptAnyResponse
;
179 EFI_IP_ADDRESS IpAddr
;
180 } EFI_PXE_BASE_CODE_SRVLIST
;
187 EFI_IP_ADDRESS ServerMCastIp
;
189 EFI_PXE_BASE_CODE_SRVLIST SrvList
[1];
190 } EFI_PXE_BASE_CODE_DISCOVER_INFO
;
193 // Mtftp() definitions
197 EFI_PXE_BASE_CODE_TFTP_FIRST
,
198 EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE
,
199 EFI_PXE_BASE_CODE_TFTP_READ_FILE
,
200 EFI_PXE_BASE_CODE_TFTP_WRITE_FILE
,
201 EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY
,
202 EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE
,
203 EFI_PXE_BASE_CODE_MTFTP_READ_FILE
,
204 EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY
,
205 EFI_PXE_BASE_CODE_MTFTP_LAST
206 } EFI_PXE_BASE_CODE_TFTP_OPCODE
;
209 EFI_IP_ADDRESS MCastIp
;
210 EFI_PXE_BASE_CODE_UDP_PORT CPort
;
211 EFI_PXE_BASE_CODE_UDP_PORT SPort
;
212 UINT16 ListenTimeout
;
213 UINT16 TransmitTimeout
;
214 } EFI_PXE_BASE_CODE_MTFTP_INFO
;
217 // PXE Base Code Mode structure
220 #define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8
221 #define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8
225 BOOLEAN Ipv6Available
;
226 BOOLEAN Ipv6Supported
;
228 BOOLEAN BisSupported
;
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
;
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
;
261 // PXE Base Code Interface Function definitions
266 (EFIAPI
*EFI_PXE_BASE_CODE_START
) (
267 IN
struct _EFI_PXE_BASE_CODE
*This
,
273 (EFIAPI
*EFI_PXE_BASE_CODE_STOP
) (
274 IN
struct _EFI_PXE_BASE_CODE
*This
279 (EFIAPI
*EFI_PXE_BASE_CODE_DHCP
) (
280 IN
struct _EFI_PXE_BASE_CODE
*This
,
281 IN BOOLEAN SortOffers
286 (EFIAPI
*EFI_PXE_BASE_CODE_DISCOVER
) (
287 IN
struct _EFI_PXE_BASE_CODE
*This
,
291 IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO
*Info OPTIONAL
296 (EFIAPI
*EFI_PXE_BASE_CODE_MTFTP
) (
297 IN
struct _EFI_PXE_BASE_CODE
*This
,
298 IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation
,
299 IN OUT VOID
*BufferPtr OPTIONAL
,
300 IN BOOLEAN Overwrite
,
301 IN OUT UINT64
*BufferSize
,
302 IN UINTN
*BlockSize OPTIONAL
,
303 IN EFI_IP_ADDRESS
*ServerIp
,
305 IN EFI_PXE_BASE_CODE_MTFTP_INFO
*Info OPTIONAL
,
306 IN BOOLEAN DontUseBuffer
311 (EFIAPI
*EFI_PXE_BASE_CODE_UDP_WRITE
) (
312 IN
struct _EFI_PXE_BASE_CODE
*This
,
314 IN EFI_IP_ADDRESS
*DestIp
,
315 IN EFI_PXE_BASE_CODE_UDP_PORT
*DestPort
,
316 IN EFI_IP_ADDRESS
*GatewayIp
, OPTIONAL
317 IN EFI_IP_ADDRESS
*SrcIp
, OPTIONAL
318 IN OUT EFI_PXE_BASE_CODE_UDP_PORT
*SrcPort
, OPTIONAL
319 IN UINTN
*HeaderSize
, OPTIONAL
320 IN VOID
*HeaderPtr
, OPTIONAL
321 IN UINTN
*BufferSize
,
327 (EFIAPI
*EFI_PXE_BASE_CODE_UDP_READ
) (
328 IN
struct _EFI_PXE_BASE_CODE
*This
,
330 IN OUT EFI_IP_ADDRESS
*DestIp
, OPTIONAL
331 IN OUT EFI_PXE_BASE_CODE_UDP_PORT
*DestPort
, OPTIONAL
332 IN OUT EFI_IP_ADDRESS
*SrcIp
, OPTIONAL
333 IN OUT EFI_PXE_BASE_CODE_UDP_PORT
*SrcPort
, OPTIONAL
334 IN UINTN
*HeaderSize
, OPTIONAL
335 IN VOID
*HeaderPtr
, OPTIONAL
336 IN OUT UINTN
*BufferSize
,
342 (EFIAPI
*EFI_PXE_BASE_CODE_SET_IP_FILTER
) (
343 IN
struct _EFI_PXE_BASE_CODE
*This
,
344 IN EFI_PXE_BASE_CODE_IP_FILTER
*NewFilter
349 (EFIAPI
*EFI_PXE_BASE_CODE_ARP
) (
350 IN
struct _EFI_PXE_BASE_CODE
*This
,
351 IN EFI_IP_ADDRESS
*IpAddr
,
352 IN EFI_MAC_ADDRESS
*MacAddr OPTIONAL
357 (EFIAPI
*EFI_PXE_BASE_CODE_SET_PARAMETERS
) (
358 IN
struct _EFI_PXE_BASE_CODE
*This
,
359 IN BOOLEAN
*NewAutoArp
, OPTIONAL
360 IN BOOLEAN
*NewSendGUID
, OPTIONAL
361 IN UINT8
*NewTTL
, OPTIONAL
362 IN UINT8
*NewToS
, OPTIONAL
363 IN BOOLEAN
*NewMakeCallback OPTIONAL
368 (EFIAPI
*EFI_PXE_BASE_CODE_SET_STATION_IP
) (
369 IN
struct _EFI_PXE_BASE_CODE
*This
,
370 IN EFI_IP_ADDRESS
*NewStationIp
, OPTIONAL
371 IN EFI_IP_ADDRESS
*NewSubnetMask OPTIONAL
376 (EFIAPI
*EFI_PXE_BASE_CODE_SET_PACKETS
) (
377 IN
struct _EFI_PXE_BASE_CODE
*This
,
378 BOOLEAN
*NewDhcpDiscoverValid
, OPTIONAL
379 BOOLEAN
*NewDhcpAckReceived
, OPTIONAL
380 BOOLEAN
*NewProxyOfferReceived
, OPTIONAL
381 BOOLEAN
*NewPxeDiscoverValid
, OPTIONAL
382 BOOLEAN
*NewPxeReplyReceived
, OPTIONAL
383 BOOLEAN
*NewPxeBisReplyReceived
,OPTIONAL
384 IN EFI_PXE_BASE_CODE_PACKET
*NewDhcpDiscover
, OPTIONAL
385 IN EFI_PXE_BASE_CODE_PACKET
*NewDhcpAck
, OPTIONAL
386 IN EFI_PXE_BASE_CODE_PACKET
*NewProxyOffer
, OPTIONAL
387 IN EFI_PXE_BASE_CODE_PACKET
*NewPxeDiscover
, OPTIONAL
388 IN EFI_PXE_BASE_CODE_PACKET
*NewPxeReply
, OPTIONAL
389 IN EFI_PXE_BASE_CODE_PACKET
*NewPxeBisReply OPTIONAL
393 // PXE Base Code Protocol structure
396 #define EFI_PXE_BASE_CODE_INTERFACE_REVISION 0x00010000
398 typedef struct _EFI_PXE_BASE_CODE
{
400 EFI_PXE_BASE_CODE_START Start
;
401 EFI_PXE_BASE_CODE_STOP Stop
;
402 EFI_PXE_BASE_CODE_DHCP Dhcp
;
403 EFI_PXE_BASE_CODE_DISCOVER Discover
;
404 EFI_PXE_BASE_CODE_MTFTP Mtftp
;
405 EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite
;
406 EFI_PXE_BASE_CODE_UDP_READ UdpRead
;
407 EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter
;
408 EFI_PXE_BASE_CODE_ARP Arp
;
409 EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters
;
410 EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp
;
411 EFI_PXE_BASE_CODE_SET_PACKETS SetPackets
;
412 EFI_PXE_BASE_CODE_MODE
*Mode
;
416 // Call Back Definitions
419 #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL \
420 { 0x245dca21, 0xfb7b, 0x11d3, {0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
426 #define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION 0x00010000
428 INTERFACE_DECL(_EFI_PXE_BASE_CODE_CALLBACK
);
431 EFI_PXE_BASE_CODE_FUNCTION_FIRST
,
432 EFI_PXE_BASE_CODE_FUNCTION_DHCP
,
433 EFI_PXE_BASE_CODE_FUNCTION_DISCOVER
,
434 EFI_PXE_BASE_CODE_FUNCTION_MTFTP
,
435 EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE
,
436 EFI_PXE_BASE_CODE_FUNCTION_UDP_READ
,
437 EFI_PXE_BASE_CODE_FUNCTION_ARP
,
438 EFI_PXE_BASE_CODE_FUNCTION_IGMP
,
439 EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST
440 } EFI_PXE_BASE_CODE_FUNCTION
;
443 EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST
,
444 EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE
,
445 EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT
,
446 EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST
447 } EFI_PXE_BASE_CODE_CALLBACK_STATUS
;
450 EFI_PXE_BASE_CODE_CALLBACK_STATUS
451 (EFIAPI
*EFI_PXE_CALLBACK
) (
452 IN
struct _EFI_PXE_BASE_CODE_CALLBACK
*This
,
453 IN EFI_PXE_BASE_CODE_FUNCTION Function
,
456 IN EFI_PXE_BASE_CODE_PACKET
*Packet OPTIONAL
459 typedef struct _EFI_PXE_BASE_CODE_CALLBACK
{
461 EFI_PXE_CALLBACK Callback
;
462 } EFI_PXE_BASE_CODE_CALLBACK
;
464 #endif /* _EFIPXEBC_H */