2 Functions declaration related with DHCPv6 for HTTP boot driver.
4 Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __EFI_HTTP_BOOT_DHCP6_H__
17 #define __EFI_HTTP_BOOT_DHCP6_H__
19 #define HTTP_BOOT_OFFER_MAX_NUM 16
20 #define HTTP_BOOT_DHCP6_OPTION_MAX_NUM 16
21 #define HTTP_BOOT_DHCP6_OPTION_MAX_SIZE 312
22 #define HTTP_BOOT_DHCP6_PACKET_MAX_SIZE 1472
23 #define HTTP_BOOT_IP6_ROUTE_TABLE_TIMEOUT 10
24 #define HTTP_BOOT_DEFAULT_HOPLIMIT 64
25 #define HTTP_BOOT_DEFAULT_LIFETIME 50000
27 #define HTTP_BOOT_DHCP6_ENTERPRISE_NUM 343 // TODO: IANA TBD: temporarily using Intel's
28 #define HTTP_BOOT_DHCP6_MAX_BOOT_FILE_SIZE 65535 // It's a limitation of bit length, 65535*512 bytes.
30 #define HTTP_BOOT_DHCP6_IDX_IA_NA 0
31 #define HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL 1
32 #define HTTP_BOOT_DHCP6_IDX_BOOT_FILE_PARAM 2
33 #define HTTP_BOOT_DHCP6_IDX_VENDOR_CLASS 3
34 #define HTTP_BOOT_DHCP6_IDX_DNS_SERVER 4
35 #define HTTP_BOOT_DHCP6_IDX_MAX 5
40 } HTTP_BOOT_DHCP6_OPTION_ORO
;
46 } HTTP_BOOT_DHCP6_OPTION_UNDI
;
50 } HTTP_BOOT_DHCP6_OPTION_ARCH
;
53 UINT8 ClassIdentifier
[11];
54 UINT8 ArchitecturePrefix
[5];
55 UINT8 ArchitectureType
[5];
57 UINT8 InterfaceName
[4];
66 HTTP_BOOT_CLASS_ID ClassId
;
67 } HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS
;
72 HTTP_BOOT_DHCP6_OPTION_ORO
*Oro
;
73 HTTP_BOOT_DHCP6_OPTION_UNDI
*Undi
;
74 HTTP_BOOT_DHCP6_OPTION_ARCH
*Arch
;
75 HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS
*VendorClass
;
76 } HTTP_BOOT_DHCP6_OPTION_ENTRY
;
78 #define HTTP_CACHED_DHCP6_PACKET_MAX_SIZE (OFFSET_OF (EFI_DHCP6_PACKET, Dhcp6) + HTTP_BOOT_DHCP6_PACKET_MAX_SIZE)
81 EFI_DHCP6_PACKET Offer
;
83 UINT8 Buffer
[HTTP_CACHED_DHCP6_PACKET_MAX_SIZE
];
84 } HTTP_BOOT_DHCP6_PACKET
;
87 HTTP_BOOT_DHCP6_PACKET Packet
;
88 HTTP_BOOT_OFFER_TYPE OfferType
;
89 EFI_DHCP6_PACKET_OPTION
*OptList
[HTTP_BOOT_DHCP6_IDX_MAX
];
91 } HTTP_BOOT_DHCP6_PACKET_CACHE
;
93 #define GET_NEXT_DHCP6_OPTION(Opt) \
94 (EFI_DHCP6_PACKET_OPTION *) ((UINT8 *) (Opt) + \
95 sizeof (EFI_DHCP6_PACKET_OPTION) + (NTOHS ((Opt)->OpLen)) - 1)
97 #define GET_DHCP6_OPTION_SIZE(Pkt) \
98 ((Pkt)->Length - sizeof (EFI_DHCP6_HEADER))
101 Start the S.A.R.R DHCPv6 process to acquire the IPv6 address and other Http boot information.
103 @param[in] Private Pointer to HTTP_BOOT private data.
105 @retval EFI_SUCCESS The S.A.R.R process successfully finished.
106 @retval Others Failed to finish the S.A.R.R process.
111 IN HTTP_BOOT_PRIVATE_DATA
*Private
115 Set the IP6 policy to Automatic.
117 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
119 @retval EFI_SUCCESS Switch the IP policy succesfully.
120 @retval Others Unexpect error happened.
124 HttpBootSetIp6Policy (
125 IN HTTP_BOOT_PRIVATE_DATA
*Private
129 This function will register the default DNS addresses to the network device.
131 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
132 @param[in] DataLength Size of the buffer pointed to by DnsServerData in bytes.
133 @param[in] DnsServerData Point a list of DNS server address in an array
134 of EFI_IPv6_ADDRESS instances.
136 @retval EFI_SUCCESS The DNS configuration has been configured successfully.
137 @retval Others Failed to configure the address.
142 IN HTTP_BOOT_PRIVATE_DATA
*Private
,
144 IN VOID
*DnsServerData
148 This function will register the IPv6 gateway address to the network device.
150 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
152 @retval EFI_SUCCESS The new IP configuration has been configured successfully.
153 @retval Others Failed to configure the address.
157 HttpBootSetIp6Gateway (
158 IN HTTP_BOOT_PRIVATE_DATA
*Private
162 This function will register the station IP address.
164 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
166 @retval EFI_SUCCESS The new IP address has been configured successfully.
167 @retval Others Failed to configure the address.
171 HttpBootSetIp6Address (
172 IN HTTP_BOOT_PRIVATE_DATA
*Private