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
[10];
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
;
79 EFI_DHCP6_PACKET Offer
;
81 UINT8 Buffer
[HTTP_BOOT_DHCP6_PACKET_MAX_SIZE
];
82 } HTTP_BOOT_DHCP6_PACKET
;
85 HTTP_BOOT_DHCP6_PACKET Packet
;
86 HTTP_BOOT_OFFER_TYPE OfferType
;
87 EFI_DHCP6_PACKET_OPTION
*OptList
[HTTP_BOOT_DHCP6_IDX_MAX
];
89 } HTTP_BOOT_DHCP6_PACKET_CACHE
;
91 #define GET_NEXT_DHCP6_OPTION(Opt) \
92 (EFI_DHCP6_PACKET_OPTION *) ((UINT8 *) (Opt) + \
93 sizeof (EFI_DHCP6_PACKET_OPTION) + (NTOHS ((Opt)->OpLen)) - 1)
95 #define GET_DHCP6_OPTION_SIZE(Pkt) \
96 ((Pkt)->Length - sizeof (EFI_DHCP6_HEADER))
99 Start the S.A.R.R DHCPv6 process to acquire the IPv6 address and other Http boot information.
101 @param[in] Private Pointer to HTTP_BOOT private data.
103 @retval EFI_SUCCESS The S.A.R.R process successfully finished.
104 @retval Others Failed to finish the S.A.R.R process.
109 IN HTTP_BOOT_PRIVATE_DATA
*Private
113 Set the IP6 policy to Automatic.
115 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
117 @retval EFI_SUCCESS Switch the IP policy succesfully.
118 @retval Others Unexpect error happened.
122 HttpBootSetIp6Policy (
123 IN HTTP_BOOT_PRIVATE_DATA
*Private
127 This function will register the default DNS addresses to the network device.
129 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
130 @param[in] DataLength Size of the buffer pointed to by DnsServerData in bytes.
131 @param[in] DnsServerData Point a list of DNS server address in an array
132 of EFI_IPv6_ADDRESS instances.
134 @retval EFI_SUCCESS The DNS configuration has been configured successfully.
135 @retval Others Failed to configure the address.
140 IN HTTP_BOOT_PRIVATE_DATA
*Private
,
142 IN VOID
*DnsServerData
146 This function will register the IPv6 gateway address to the network device.
148 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
150 @retval EFI_SUCCESS The new IP configuration has been configured successfully.
151 @retval Others Failed to configure the address.
155 HttpBootSetIp6Gateway (
156 IN HTTP_BOOT_PRIVATE_DATA
*Private
160 This function will register the station IP address.
162 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
164 @retval EFI_SUCCESS The new IP address has been configured successfully.
165 @retval Others Failed to configure the address.
169 HttpBootSetIp6Address (
170 IN HTTP_BOOT_PRIVATE_DATA
*Private