TianoCore EDK2 master
Loading...
Searching...
No Matches
PxeBaseCode.h
Go to the documentation of this file.
1
16#ifndef __PXE_BASE_CODE_PROTOCOL_H__
17#define __PXE_BASE_CODE_PROTOCOL_H__
18
22#define EFI_PXE_BASE_CODE_PROTOCOL_GUID \
23 { \
24 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
25 }
26
28
33
37#define DEFAULT_TTL 16
38#define DEFAULT_ToS 0
39
43typedef 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];
58
62typedef struct {
63 UINT8 ErrorCode;
64 CHAR8 ErrorString[127];
66
70#define EFI_PXE_BASE_CODE_MAX_IPCNT 8
71
75typedef struct {
76 UINT8 Filters;
77 UINT8 IpCnt;
78 UINT16 reserved;
81
82#define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001
83#define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002
84#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004
85#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008
86
90typedef struct {
91 EFI_IP_ADDRESS IpAddr;
92 EFI_MAC_ADDRESS MacAddr;
94
98typedef struct {
99 EFI_IP_ADDRESS IpAddr;
100 EFI_IP_ADDRESS SubnetMask;
101 EFI_IP_ADDRESS GwAddr;
103
104//
105// UDP definitions
106//
107typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;
108
109#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001
110#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002
111#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004
112#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008
113#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010
114#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020
115
116//
117// Discover() definitions
118//
119#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0
120#define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1
121#define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2
122#define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3
123#define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4
124#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5
125#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6
126#define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7
127#define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8
128#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9
129#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10
130#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11
131#define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12
132#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13
133#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14
134#define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15
135#define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16
136//
137// 17 through 32767 are reserved
138// 32768 through 65279 are for vendor use
139// 65280 through 65534 are reserved
140//
141#define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535
142
143#define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF
144#define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000
145
146//
147// PXE Tag definition that identifies the processor
148// and programming environment of the client system.
149// These identifiers are defined by IETF:
150// http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml
151//
152#if defined (MDE_CPU_IA32)
153#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0006
154#elif defined (MDE_CPU_X64)
155#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0007
156#elif defined (MDE_CPU_ARM)
157#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000A
158#elif defined (MDE_CPU_AARCH64)
159#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000B
160#elif defined (MDE_CPU_RISCV64)
161#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x001B
162#elif defined (MDE_CPU_LOONGARCH64)
163#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0027
164#endif
165
169typedef struct {
170 UINT16 Type;
171 BOOLEAN AcceptAnyResponse;
172 UINT8 Reserved;
173 EFI_IP_ADDRESS IpAddr;
175
179typedef struct {
180 BOOLEAN UseMCast;
181 BOOLEAN UseBCast;
182 BOOLEAN UseUCast;
183 BOOLEAN MustUseList;
184 EFI_IP_ADDRESS ServerMCastIp;
185 UINT16 IpCnt;
186 EFI_PXE_BASE_CODE_SRVLIST SrvList[1];
188
192typedef enum {
193 EFI_PXE_BASE_CODE_TFTP_FIRST,
194 EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,
195 EFI_PXE_BASE_CODE_TFTP_READ_FILE,
196 EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,
197 EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,
198 EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,
199 EFI_PXE_BASE_CODE_MTFTP_READ_FILE,
200 EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,
201 EFI_PXE_BASE_CODE_MTFTP_LAST
203
209typedef struct {
210 EFI_IP_ADDRESS MCastIp;
211 EFI_PXE_BASE_CODE_UDP_PORT CPort;
212 EFI_PXE_BASE_CODE_UDP_PORT SPort;
213 UINT16 ListenTimeout;
214 UINT16 TransmitTimeout;
216
220typedef struct {
221 UINT8 BootpOpcode;
222 UINT8 BootpHwType;
223 UINT8 BootpHwAddrLen;
224 UINT8 BootpGateHops;
225 UINT32 BootpIdent;
226 UINT16 BootpSeconds;
227 UINT16 BootpFlags;
228 UINT8 BootpCiAddr[4];
229 UINT8 BootpYiAddr[4];
230 UINT8 BootpSiAddr[4];
231 UINT8 BootpGiAddr[4];
232 UINT8 BootpHwAddr[16];
233 UINT8 BootpSrvName[64];
234 UINT8 BootpBootFile[128];
235 UINT32 DhcpMagik;
236 UINT8 DhcpOptions[56];
238
242typedef struct {
243 UINT32 MessageType : 8;
244 UINT32 TransactionId : 24;
245 UINT8 DhcpOptions[1024];
247
251typedef union {
252 UINT8 Raw[1472];
256
257//
258// PXE Base Code Mode structure
259//
260#define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8
261#define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8
262
269typedef struct {
270 BOOLEAN Started;
271 BOOLEAN Ipv6Available;
272 BOOLEAN Ipv6Supported;
273 BOOLEAN UsingIpv6;
274 BOOLEAN BisSupported;
275 BOOLEAN BisDetected;
276 BOOLEAN AutoArp;
277 BOOLEAN SendGUID;
278 BOOLEAN DhcpDiscoverValid;
279 BOOLEAN DhcpAckReceived;
280 BOOLEAN ProxyOfferReceived;
281 BOOLEAN PxeDiscoverValid;
282 BOOLEAN PxeReplyReceived;
283 BOOLEAN PxeBisReplyReceived;
284 BOOLEAN IcmpErrorReceived;
285 BOOLEAN TftpErrorReceived;
286 BOOLEAN MakeCallbacks;
287 UINT8 TTL;
288 UINT8 ToS;
289 EFI_IP_ADDRESS StationIp;
290 EFI_IP_ADDRESS SubnetMask;
291 EFI_PXE_BASE_CODE_PACKET DhcpDiscover;
293 EFI_PXE_BASE_CODE_PACKET ProxyOffer;
294 EFI_PXE_BASE_CODE_PACKET PxeDiscover;
296 EFI_PXE_BASE_CODE_PACKET PxeBisReply;
298 UINT32 ArpCacheEntries;
299 EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];
300 UINT32 RouteTableEntries;
301 EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];
305
306//
307// PXE Base Code Interface Function definitions
308//
309
374typedef
378 IN BOOLEAN UseIpv6
379 );
380
398typedef
400(EFIAPI *EFI_PXE_BASE_CODE_STOP)(
402 );
403
437typedef
439(EFIAPI *EFI_PXE_BASE_CODE_DHCP)(
441 IN BOOLEAN SortOffers
442 );
443
487typedef
491 IN UINT16 Type,
492 IN UINT16 *Layer,
493 IN BOOLEAN UseBis,
495 );
496
568typedef
573 IN OUT VOID *BufferPtr OPTIONAL,
574 IN BOOLEAN Overwrite,
575 IN OUT UINT64 *BufferSize,
576 IN UINTN *BlockSize OPTIONAL,
577 IN EFI_IP_ADDRESS *ServerIp,
578 IN UINT8 *Filename OPTIONAL,
580 IN BOOLEAN DontUseBuffer
581 );
582
620typedef
624 IN UINT16 OpFlags,
625 IN EFI_IP_ADDRESS *DestIp,
626 IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,
627 IN EFI_IP_ADDRESS *GatewayIp OPTIONAL,
629 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL,
630 IN UINTN *HeaderSize OPTIONAL,
631 IN VOID *HeaderPtr OPTIONAL,
632 IN UINTN *BufferSize,
633 IN VOID *BufferPtr
634 );
635
674typedef
678 IN UINT16 OpFlags,
680 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL,
682 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL,
683 IN UINTN *HeaderSize OPTIONAL,
684 IN VOID *HeaderPtr OPTIONAL,
685 IN OUT UINTN *BufferSize,
686 IN VOID *BufferPtr
687 );
688
721typedef
726 );
727
757typedef
759(EFIAPI *EFI_PXE_BASE_CODE_ARP)(
761 IN EFI_IP_ADDRESS *IpAddr,
763 );
764
797typedef
801 IN BOOLEAN *NewAutoArp OPTIONAL,
802 IN BOOLEAN *NewSendGUID OPTIONAL,
803 IN UINT8 *NewTTL OPTIONAL,
804 IN UINT8 *NewToS OPTIONAL,
805 IN BOOLEAN *NewMakeCallback OPTIONAL
806 );
807
831typedef
835 IN EFI_IP_ADDRESS *NewStationIp OPTIONAL,
836 IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL
837 );
838
870typedef
874 BOOLEAN *NewDhcpDiscoverValid OPTIONAL,
875 BOOLEAN *NewDhcpAckReceived OPTIONAL,
876 BOOLEAN *NewProxyOfferReceived OPTIONAL,
877 BOOLEAN *NewPxeDiscoverValid OPTIONAL,
878 BOOLEAN *NewPxeReplyReceived OPTIONAL,
879 BOOLEAN *NewPxeBisReplyReceived OPTIONAL,
880 IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover OPTIONAL,
882 IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer OPTIONAL,
883 IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover OPTIONAL,
885 IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL
886 );
887
888//
889// PXE Base Code Protocol structure
890//
891#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION 0x00010000
892
893//
894// Revision defined in EFI1.1
895//
896#define EFI_PXE_BASE_CODE_INTERFACE_REVISION EFI_PXE_BASE_CODE_PROTOCOL_REVISION
897
912 UINT64 Revision;
929};
930
931extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;
932
933#endif
UINT64 UINTN
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_START)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN UseIpv6)
Definition: PxeBaseCode.h:376
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_MTFTP)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation, IN OUT VOID *BufferPtr OPTIONAL, IN BOOLEAN Overwrite, IN OUT UINT64 *BufferSize, IN UINTN *BlockSize OPTIONAL, IN EFI_IP_ADDRESS *ServerIp, IN UINT8 *Filename OPTIONAL, IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL, IN BOOLEAN DontUseBuffer)
Definition: PxeBaseCode.h:570
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_UDP_WRITE)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN UINT16 OpFlags, IN EFI_IP_ADDRESS *DestIp, IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort, IN EFI_IP_ADDRESS *GatewayIp OPTIONAL, IN EFI_IP_ADDRESS *SrcIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL, IN UINTN *HeaderSize OPTIONAL, IN VOID *HeaderPtr OPTIONAL, IN UINTN *BufferSize, IN VOID *BufferPtr)
Definition: PxeBaseCode.h:622
EFI_PXE_BASE_CODE_TFTP_OPCODE
Definition: PxeBaseCode.h:192
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_ARP)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_IP_ADDRESS *IpAddr, IN EFI_MAC_ADDRESS *MacAddr OPTIONAL)
Definition: PxeBaseCode.h:759
#define EFI_PXE_BASE_CODE_MAX_IPCNT
Definition: PxeBaseCode.h:70
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_SET_PARAMETERS)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN *NewAutoArp OPTIONAL, IN BOOLEAN *NewSendGUID OPTIONAL, IN UINT8 *NewTTL OPTIONAL, IN UINT8 *NewToS OPTIONAL, IN BOOLEAN *NewMakeCallback OPTIONAL)
Definition: PxeBaseCode.h:799
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_SET_PACKETS)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, BOOLEAN *NewDhcpDiscoverValid OPTIONAL, BOOLEAN *NewDhcpAckReceived OPTIONAL, BOOLEAN *NewProxyOfferReceived OPTIONAL, BOOLEAN *NewPxeDiscoverValid OPTIONAL, BOOLEAN *NewPxeReplyReceived OPTIONAL, BOOLEAN *NewPxeBisReplyReceived OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL)
Definition: PxeBaseCode.h:872
EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE
Definition: PxeBaseCode.h:32
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_STOP)(IN EFI_PXE_BASE_CODE_PROTOCOL *This)
Definition: PxeBaseCode.h:400
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_SET_IP_FILTER)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter)
Definition: PxeBaseCode.h:723
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_UDP_READ)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN UINT16 OpFlags, IN OUT EFI_IP_ADDRESS *DestIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL, IN OUT EFI_IP_ADDRESS *SrcIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL, IN UINTN *HeaderSize OPTIONAL, IN VOID *HeaderPtr OPTIONAL, IN OUT UINTN *BufferSize, IN VOID *BufferPtr)
Definition: PxeBaseCode.h:676
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_DISCOVER)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN UINT16 Type, IN UINT16 *Layer, IN BOOLEAN UseBis, IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL)
Definition: PxeBaseCode.h:489
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_DHCP)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN SortOffers)
Definition: PxeBaseCode.h:439
EFI_STATUS(EFIAPI * EFI_PXE_BASE_CODE_SET_STATION_IP)(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_IP_ADDRESS *NewStationIp OPTIONAL, IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL)
Definition: PxeBaseCode.h:833
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_PXE_BASE_CODE_MODE * Mode
Definition: PxeBaseCode.h:928
Definition: Base.h:213