2 Functions declaration related with DHCPv6 for HTTP boot driver.
4 Copyright (c) 2015, 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
28 #define HTTP_BOOT_DHCP6_OPT_CLIENT_ID 1
29 #define HTTP_BOOT_DHCP6_OPT_SERVER_ID 2
30 #define HTTP_BOOT_DHCP6_OPT_IA_NA 3
31 #define HTTP_BOOT_DHCP6_OPT_IA_TA 4
32 #define HTTP_BOOT_DHCP6_OPT_IAADDR 5
33 #define HTTP_BOOT_DHCP6_OPT_ORO 6
34 #define HTTP_BOOT_DHCP6_OPT_PREFERENCE 7
35 #define HTTP_BOOT_DHCP6_OPT_ELAPSED_TIME 8
36 #define HTTP_BOOT_DHCP6_OPT_REPLAY_MSG 9
37 #define HTTP_BOOT_DHCP6_OPT_AUTH 11
38 #define HTTP_BOOT_DHCP6_OPT_UNICAST 12
39 #define HTTP_BOOT_DHCP6_OPT_STATUS_CODE 13
40 #define HTTP_BOOT_DHCP6_OPT_RAPID_COMMIT 14
41 #define HTTP_BOOT_DHCP6_OPT_USER_CLASS 15
42 #define HTTP_BOOT_DHCP6_OPT_VENDOR_CLASS 16
43 #define HTTP_BOOT_DHCP6_OPT_VENDOR_OPTS 17
44 #define HTTP_BOOT_DHCP6_OPT_INTERFACE_ID 18
45 #define HTTP_BOOT_DHCP6_OPT_RECONFIG_MSG 19
46 #define HTTP_BOOT_DHCP6_OPT_RECONFIG_ACCEPT 20
47 #define HTTP_BOOT_DHCP6_OPT_DNS_SERVERS 23
48 #define HTTP_BOOT_DHCP6_OPT_BOOT_FILE_URL 59 // Assigned by IANA, RFC 5970
49 #define HTTP_BOOT_DHCP6_OPT_BOOT_FILE_PARAM 60 // Assigned by IANA, RFC 5970
50 #define HTTP_BOOT_DHCP6_OPT_ARCH 61 // Assigned by IANA, RFC 5970
51 #define HTTP_BOOT_DHCP6_OPT_UNDI 62 // Assigned by IANA, RFC 5970
52 #define HTTP_BOOT_DHCP6_ENTERPRISE_NUM 343 // TODO: IANA TBD: temporarily using Intel's
53 #define HTTP_BOOT_DHCP6_MAX_BOOT_FILE_SIZE 65535 // It's a limitation of bit length, 65535*512 bytes.
55 #define HTTP_BOOT_DHCP6_IDX_IA_NA 0
56 #define HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL 1
57 #define HTTP_BOOT_DHCP6_IDX_BOOT_FILE_PARAM 2
58 #define HTTP_BOOT_DHCP6_IDX_VENDOR_CLASS 3
59 #define HTTP_BOOT_DHCP6_IDX_DNS_SERVER 4
60 #define HTTP_BOOT_DHCP6_IDX_MAX 5
65 } HTTP_BOOT_DHCP6_OPTION_ORO
;
71 } HTTP_BOOT_DHCP6_OPTION_UNDI
;
75 } HTTP_BOOT_DHCP6_OPTION_ARCH
;
78 UINT8 ClassIdentifier
[10];
79 UINT8 ArchitecturePrefix
[5];
80 UINT8 ArchitectureType
[5];
82 UINT8 InterfaceName
[4];
91 HTTP_BOOT_CLASS_ID ClassId
;
92 } HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS
;
97 HTTP_BOOT_DHCP6_OPTION_ORO
*Oro
;
98 HTTP_BOOT_DHCP6_OPTION_UNDI
*Undi
;
99 HTTP_BOOT_DHCP6_OPTION_ARCH
*Arch
;
100 HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS
*VendorClass
;
101 } HTTP_BOOT_DHCP6_OPTION_ENTRY
;
104 EFI_DHCP6_PACKET Offer
;
105 EFI_DHCP6_PACKET Ack
;
106 UINT8 Buffer
[HTTP_BOOT_DHCP6_PACKET_MAX_SIZE
];
107 } HTTP_BOOT_DHCP6_PACKET
;
110 HTTP_BOOT_DHCP6_PACKET Packet
;
111 HTTP_BOOT_OFFER_TYPE OfferType
;
112 EFI_DHCP6_PACKET_OPTION
*OptList
[HTTP_BOOT_DHCP6_IDX_MAX
];
114 } HTTP_BOOT_DHCP6_PACKET_CACHE
;
116 #define GET_NEXT_DHCP6_OPTION(Opt) \
117 (EFI_DHCP6_PACKET_OPTION *) ((UINT8 *) (Opt) + \
118 sizeof (EFI_DHCP6_PACKET_OPTION) + (NTOHS ((Opt)->OpLen)) - 1)
120 #define GET_DHCP6_OPTION_SIZE(Pkt) \
121 ((Pkt)->Length - sizeof (EFI_DHCP6_HEADER))
124 Start the S.A.R.R DHCPv6 process to acquire the IPv6 address and other Http boot information.
126 @param[in] Private Pointer to HTTP_BOOT private data.
128 @retval EFI_SUCCESS The S.A.R.R process successfully finished.
129 @retval Others Failed to finish the S.A.R.R process.
134 IN HTTP_BOOT_PRIVATE_DATA
*Private
138 Set the IP6 policy to Automatic.
140 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
142 @retval EFI_SUCCESS Switch the IP policy succesfully.
143 @retval Others Unexpect error happened.
147 HttpBootSetIp6Policy (
148 IN HTTP_BOOT_PRIVATE_DATA
*Private
152 This function will register the default DNS addresses to the network device.
154 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
155 @param[in] DataLength Size of the buffer pointed to by DnsServerData in bytes.
156 @param[in] DnsServerData Point a list of DNS server address in an array
157 of EFI_IPv6_ADDRESS instances.
159 @retval EFI_SUCCESS The DNS configuration has been configured successfully.
160 @retval Others Failed to configure the address.
165 IN HTTP_BOOT_PRIVATE_DATA
*Private
,
167 IN VOID
*DnsServerData
171 This function will register the IPv6 gateway address to the network device.
173 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
175 @retval EFI_SUCCESS The new IP configuration has been configured successfully.
176 @retval Others Failed to configure the address.
180 HttpBootSetIp6Gateway (
181 IN HTTP_BOOT_PRIVATE_DATA
*Private
185 This function will register the station IP address.
187 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
189 @retval EFI_SUCCESS The new IP address has been configured successfully.
190 @retval Others Failed to configure the address.
194 HttpBootSetIp6Address (
195 IN HTTP_BOOT_PRIVATE_DATA
*Private