TianoCore EDK2 master
Loading...
Searching...
No Matches
PxeBcDhcp6.h
Go to the documentation of this file.
1
10#ifndef __EFI_PXEBC_DHCP6_H__
11#define __EFI_PXEBC_DHCP6_H__
12
13#define PXEBC_DHCP6_OPTION_MAX_NUM 16
14#define PXEBC_DHCP6_OPTION_MAX_SIZE 312
15#define PXEBC_DHCP6_PACKET_MAX_SIZE (sizeof (EFI_PXE_BASE_CODE_PACKET))
16#define PXEBC_IP6_POLICY_MAX 0xff
17#define PXEBC_IP6_ROUTE_TABLE_TIMEOUT 10
18
19#define PXEBC_DHCP6_S_PORT 547
20#define PXEBC_DHCP6_C_PORT 546
21
22#define PXEBC_DHCP6_ENTERPRISE_NUM 343 // TODO: IANA TBD: temporarily using Intel's
23#define PXEBC_DHCP6_MAX_BOOT_FILE_SIZE 65535 // It's a limitation of bit length, 65535*512 bytes.
24
25#define PXEBC_DHCP6_IDX_IA_NA 0
26#define PXEBC_DHCP6_IDX_BOOT_FILE_URL 1
27#define PXEBC_DHCP6_IDX_BOOT_FILE_PARAM 2
28#define PXEBC_DHCP6_IDX_VENDOR_CLASS 3
29#define PXEBC_DHCP6_IDX_DNS_SERVER 4
30#define PXEBC_DHCP6_IDX_MAX 5
31
32#define PXEBC_DHCP6_BOOT_FILE_URL_PREFIX "tftp://"
33#define PXEBC_TFTP_URL_SEPARATOR '/'
34#define PXEBC_ADDR_START_DELIMITER '['
35#define PXEBC_ADDR_END_DELIMITER ']'
36
37//
38// A DUID consists of a 2-octet type code represented in network byte
39// order, followed by a variable number of octets that make up the
40// actual identifier. The length of the DUID (not including the type
41// code) is at least 1 octet and at most 128 octets.
42//
43#define PXEBC_MIN_SIZE_OF_DUID (sizeof(UINT16) + 1)
44#define PXEBC_MAX_SIZE_OF_DUID (sizeof(UINT16) + 128)
45
46//
47// This define represents the combineds code and length field from
48// https://datatracker.ietf.org/doc/html/rfc3315#section-22.1
49//
50#define PXEBC_COMBINED_SIZE_OF_OPT_CODE_AND_LEN \
51 (sizeof (((EFI_DHCP6_PACKET_OPTION *)0)->OpCode) + \
52 sizeof (((EFI_DHCP6_PACKET_OPTION *)0)->OpLen))
53
54#define GET_NEXT_DHCP6_OPTION(Opt) \
55 (EFI_DHCP6_PACKET_OPTION *) ((UINT8 *) (Opt) + \
56 sizeof (EFI_DHCP6_PACKET_OPTION) + (NTOHS ((Opt)->OpLen)) - 1)
57
58#define GET_DHCP6_OPTION_SIZE(Pkt) \
59 ((Pkt)->Length - sizeof (EFI_DHCP6_HEADER))
60
61#define IS_PROXY_OFFER(Type) \
62 ((Type) == PxeOfferTypeProxyBinl || \
63 (Type) == PxeOfferTypeProxyPxe10 || \
64 (Type) == PxeOfferTypeProxyWfm11a)
65
66#pragma pack(1)
67typedef struct {
68 UINT16 OpCode[256];
70
71typedef struct {
72 UINT8 Type;
73 UINT8 MajorVer;
74 UINT8 MinorVer;
76
77typedef struct {
78 UINT16 Type;
80
81typedef struct {
82 UINT8 ClassIdentifier[10];
83 UINT8 ArchitecturePrefix[5];
84 UINT8 ArchitectureType[5];
85 UINT8 Lit3[1];
86 UINT8 InterfaceName[4];
87 UINT8 Lit4[1];
88 UINT8 UndiMajor[3];
89 UINT8 UndiMinor[3];
91
92typedef struct {
93 UINT32 Vendor;
94 UINT16 ClassLen;
95 PXEBC_CLASS_ID ClassId;
97
98#pragma pack()
99
100typedef union {
106
107typedef struct {
108 LIST_ENTRY Link;
110 UINT8 Precedence;
112
113#define PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE (OFFSET_OF (EFI_DHCP6_PACKET, Dhcp6) + PXEBC_DHCP6_PACKET_MAX_SIZE)
114
115typedef union {
116 EFI_DHCP6_PACKET Offer;
118 UINT8 Buffer[PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE];
120
121typedef struct {
122 PXEBC_DHCP6_PACKET Packet;
123 PXEBC_OFFER_TYPE OfferType;
124 EFI_DHCP6_PACKET_OPTION *OptList[PXEBC_DHCP6_IDX_MAX];
126
143 IN PXEBC_PRIVATE_DATA *Private,
144 OUT UINT8 **FileName,
145 IN OUT EFI_IPv6_ADDRESS *SrvAddr,
146 IN CHAR8 *BootFile,
147 IN UINT16 Length
148 );
149
162 IN CHAR8 *BootFilePara,
163 OUT UINT16 *BootFileSize
164 );
165
178 );
179
192 IN PXEBC_PRIVATE_DATA *Private,
193 IN EFI_IPv6_ADDRESS *Address
194 );
195
202VOID
204 IN PXEBC_PRIVATE_DATA *Private
205 );
206
224 IN PXEBC_PRIVATE_DATA *Private,
225 IN UINT16 Type,
226 IN UINT16 *Layer,
227 IN BOOLEAN UseBis,
228 IN EFI_IP_ADDRESS *DestIp
229 );
230
242 IN PXEBC_PRIVATE_DATA *Private
243 );
244
256 IN PXEBC_PRIVATE_DATA *Private
257 );
258
271 IN PXEBC_PRIVATE_DATA *Private,
273 );
274
275#endif
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS PxeBcRegisterIp6Address(IN PXEBC_PRIVATE_DATA *Private, IN EFI_IPv6_ADDRESS *Address)
Definition: PxeBcDhcp6.c:1696
EFI_STATUS PxeBcSetIp6Address(IN PXEBC_PRIVATE_DATA *Private)
Definition: PxeBcDhcp6.c:1935
VOID PxeBcUnregisterIp6Address(IN PXEBC_PRIVATE_DATA *Private)
Definition: PxeBcDhcp6.c:1547
EFI_STATUS PxeBcSetIp6Policy(IN PXEBC_PRIVATE_DATA *Private)
Definition: PxeBcDhcp6.c:1881
EFI_STATUS PxeBcParseDhcp6Packet(IN PXEBC_DHCP6_PACKET_CACHE *Cache6)
Definition: PxeBcDhcp6.c:632
EFI_STATUS PxeBcExtractBootFileUrl(IN PXEBC_PRIVATE_DATA *Private, OUT UINT8 **FileName, IN OUT EFI_IPv6_ADDRESS *SrvAddr, IN CHAR8 *BootFile, IN UINT16 Length)
Definition: PxeBcDhcp6.c:380
EFI_STATUS PxeBcDhcp6Sarr(IN PXEBC_PRIVATE_DATA *Private, IN EFI_DHCP6_PROTOCOL *Dhcp6)
Definition: PxeBcDhcp6.c:2335
EFI_STATUS PxeBcExtractBootFileParam(IN CHAR8 *BootFilePara, OUT UINT16 *BootFileSize)
Definition: PxeBcDhcp6.c:580
EFI_STATUS PxeBcDhcp6Discover(IN PXEBC_PRIVATE_DATA *Private, IN UINT16 Type, IN UINT16 *Layer, IN BOOLEAN UseBis, IN EFI_IP_ADDRESS *DestIp)
Definition: PxeBcDhcp6.c:2161
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29