2 Functions declaration related with DHCPv6 for HTTP boot driver.
4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __EFI_HTTP_BOOT_DHCP6_H__
11 #define __EFI_HTTP_BOOT_DHCP6_H__
13 #define HTTP_BOOT_OFFER_MAX_NUM 16
14 #define HTTP_BOOT_DHCP6_OPTION_MAX_NUM 16
15 #define HTTP_BOOT_DHCP6_OPTION_MAX_SIZE 312
16 #define HTTP_BOOT_DHCP6_PACKET_MAX_SIZE 1472
17 #define HTTP_BOOT_IP6_ROUTE_TABLE_TIMEOUT 10
18 #define HTTP_BOOT_DEFAULT_HOPLIMIT 64
19 #define HTTP_BOOT_DEFAULT_LIFETIME 50000
21 #define HTTP_BOOT_DHCP6_ENTERPRISE_NUM 343 // TODO: IANA TBD: temporarily using Intel's
22 #define HTTP_BOOT_DHCP6_MAX_BOOT_FILE_SIZE 65535 // It's a limitation of bit length, 65535*512 bytes.
24 #define HTTP_BOOT_DHCP6_IDX_IA_NA 0
25 #define HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL 1
26 #define HTTP_BOOT_DHCP6_IDX_BOOT_FILE_PARAM 2
27 #define HTTP_BOOT_DHCP6_IDX_VENDOR_CLASS 3
28 #define HTTP_BOOT_DHCP6_IDX_DNS_SERVER 4
29 #define HTTP_BOOT_DHCP6_IDX_MAX 5
34 } HTTP_BOOT_DHCP6_OPTION_ORO
;
40 } HTTP_BOOT_DHCP6_OPTION_UNDI
;
44 } HTTP_BOOT_DHCP6_OPTION_ARCH
;
47 UINT8 ClassIdentifier
[11];
48 UINT8 ArchitecturePrefix
[5];
49 UINT8 ArchitectureType
[5];
51 UINT8 InterfaceName
[4];
60 HTTP_BOOT_CLASS_ID ClassId
;
61 } HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS
;
66 HTTP_BOOT_DHCP6_OPTION_ORO
*Oro
;
67 HTTP_BOOT_DHCP6_OPTION_UNDI
*Undi
;
68 HTTP_BOOT_DHCP6_OPTION_ARCH
*Arch
;
69 HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS
*VendorClass
;
70 } HTTP_BOOT_DHCP6_OPTION_ENTRY
;
72 #define HTTP_CACHED_DHCP6_PACKET_MAX_SIZE (OFFSET_OF (EFI_DHCP6_PACKET, Dhcp6) + HTTP_BOOT_DHCP6_PACKET_MAX_SIZE)
75 EFI_DHCP6_PACKET Offer
;
77 UINT8 Buffer
[HTTP_CACHED_DHCP6_PACKET_MAX_SIZE
];
78 } HTTP_BOOT_DHCP6_PACKET
;
81 HTTP_BOOT_DHCP6_PACKET Packet
;
82 HTTP_BOOT_OFFER_TYPE OfferType
;
83 EFI_DHCP6_PACKET_OPTION
*OptList
[HTTP_BOOT_DHCP6_IDX_MAX
];
85 } HTTP_BOOT_DHCP6_PACKET_CACHE
;
87 #define GET_NEXT_DHCP6_OPTION(Opt) \
88 (EFI_DHCP6_PACKET_OPTION *) ((UINT8 *) (Opt) + \
89 sizeof (EFI_DHCP6_PACKET_OPTION) + (NTOHS ((Opt)->OpLen)) - 1)
91 #define GET_DHCP6_OPTION_SIZE(Pkt) \
92 ((Pkt)->Length - sizeof (EFI_DHCP6_HEADER))
95 Start the S.A.R.R DHCPv6 process to acquire the IPv6 address and other Http boot information.
97 @param[in] Private Pointer to HTTP_BOOT private data.
99 @retval EFI_SUCCESS The S.A.R.R process successfully finished.
100 @retval Others Failed to finish the S.A.R.R process.
105 IN HTTP_BOOT_PRIVATE_DATA
*Private
109 Set the IP6 policy to Automatic.
111 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
113 @retval EFI_SUCCESS Switch the IP policy succesfully.
114 @retval Others Unexpect error happened.
118 HttpBootSetIp6Policy (
119 IN HTTP_BOOT_PRIVATE_DATA
*Private
123 This function will register the default DNS addresses to the network device.
125 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
126 @param[in] DataLength Size of the buffer pointed to by DnsServerData in bytes.
127 @param[in] DnsServerData Point a list of DNS server address in an array
128 of EFI_IPv6_ADDRESS instances.
130 @retval EFI_SUCCESS The DNS configuration has been configured successfully.
131 @retval Others Failed to configure the address.
136 IN HTTP_BOOT_PRIVATE_DATA
*Private
,
138 IN VOID
*DnsServerData
142 This function will register the IPv6 gateway address to the network device.
144 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
146 @retval EFI_SUCCESS The new IP configuration has been configured successfully.
147 @retval Others Failed to configure the address.
151 HttpBootSetIp6Gateway (
152 IN HTTP_BOOT_PRIVATE_DATA
*Private
156 This function will register the station IP address.
158 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
160 @retval EFI_SUCCESS The new IP address has been configured successfully.
161 @retval Others Failed to configure the address.
165 HttpBootSetIp6Address (
166 IN HTTP_BOOT_PRIVATE_DATA
*Private