VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/HttpBootDxe/HttpBootDhcp6.h@ 106411

最後變更 在這個檔案從106411是 99404,由 vboxsync 提交於 22 月 前

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 4.9 KB
 
1/** @file
2 Functions declaration related with DHCPv6 for HTTP boot driver.
3
4Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
5SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef __EFI_HTTP_BOOT_DHCP6_H__
10#define __EFI_HTTP_BOOT_DHCP6_H__
11
12#define HTTP_BOOT_OFFER_MAX_NUM 16
13#define HTTP_BOOT_DHCP6_OPTION_MAX_NUM 16
14#define HTTP_BOOT_DHCP6_OPTION_MAX_SIZE 312
15#define HTTP_BOOT_DHCP6_PACKET_MAX_SIZE 1472
16#define HTTP_BOOT_IP6_ROUTE_TABLE_TIMEOUT 10
17#define HTTP_BOOT_DEFAULT_HOPLIMIT 64
18#define HTTP_BOOT_DEFAULT_LIFETIME 50000
19
20#define HTTP_BOOT_DHCP6_ENTERPRISE_NUM 343 // TODO: IANA TBD: temporarily using Intel's
21#define HTTP_BOOT_DHCP6_MAX_BOOT_FILE_SIZE 65535 // It's a limitation of bit length, 65535*512 bytes.
22
23#define HTTP_BOOT_DHCP6_IDX_IA_NA 0
24#define HTTP_BOOT_DHCP6_IDX_BOOT_FILE_URL 1
25#define HTTP_BOOT_DHCP6_IDX_BOOT_FILE_PARAM 2
26#define HTTP_BOOT_DHCP6_IDX_VENDOR_CLASS 3
27#define HTTP_BOOT_DHCP6_IDX_DNS_SERVER 4
28#define HTTP_BOOT_DHCP6_IDX_MAX 5
29
30#pragma pack(1)
31typedef struct {
32 UINT16 OpCode[256];
33} HTTP_BOOT_DHCP6_OPTION_ORO;
34
35typedef struct {
36 UINT8 Type;
37 UINT8 MajorVer;
38 UINT8 MinorVer;
39} HTTP_BOOT_DHCP6_OPTION_UNDI;
40
41typedef struct {
42 UINT16 Type;
43} HTTP_BOOT_DHCP6_OPTION_ARCH;
44
45typedef struct {
46 UINT8 ClassIdentifier[11];
47 UINT8 ArchitecturePrefix[5];
48 UINT8 ArchitectureType[5];
49 UINT8 Lit3[1];
50 UINT8 InterfaceName[4];
51 UINT8 Lit4[1];
52 UINT8 UndiMajor[3];
53 UINT8 UndiMinor[3];
54} HTTP_BOOT_CLASS_ID;
55
56typedef struct {
57 UINT32 Vendor;
58 UINT16 ClassLen;
59 HTTP_BOOT_CLASS_ID ClassId;
60} HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS;
61
62#pragma pack()
63
64typedef union {
65 HTTP_BOOT_DHCP6_OPTION_ORO *Oro;
66 HTTP_BOOT_DHCP6_OPTION_UNDI *Undi;
67 HTTP_BOOT_DHCP6_OPTION_ARCH *Arch;
68 HTTP_BOOT_DHCP6_OPTION_VENDOR_CLASS *VendorClass;
69} HTTP_BOOT_DHCP6_OPTION_ENTRY;
70
71#define HTTP_CACHED_DHCP6_PACKET_MAX_SIZE (OFFSET_OF (EFI_DHCP6_PACKET, Dhcp6) + HTTP_BOOT_DHCP6_PACKET_MAX_SIZE)
72
73typedef union {
74 EFI_DHCP6_PACKET Offer;
75 EFI_DHCP6_PACKET Ack;
76 UINT8 Buffer[HTTP_CACHED_DHCP6_PACKET_MAX_SIZE];
77} HTTP_BOOT_DHCP6_PACKET;
78
79typedef struct {
80 HTTP_BOOT_DHCP6_PACKET Packet;
81 HTTP_BOOT_OFFER_TYPE OfferType;
82 EFI_DHCP6_PACKET_OPTION *OptList[HTTP_BOOT_DHCP6_IDX_MAX];
83 VOID *UriParser;
84} HTTP_BOOT_DHCP6_PACKET_CACHE;
85
86#define GET_NEXT_DHCP6_OPTION(Opt) \
87 (EFI_DHCP6_PACKET_OPTION *) ((UINT8 *) (Opt) + \
88 sizeof (EFI_DHCP6_PACKET_OPTION) + (NTOHS ((Opt)->OpLen)) - 1)
89
90#define GET_DHCP6_OPTION_SIZE(Pkt) \
91 ((Pkt)->Length - sizeof (EFI_DHCP6_HEADER))
92
93/**
94 Start the S.A.R.R DHCPv6 process to acquire the IPv6 address and other Http boot information.
95
96 @param[in] Private Pointer to HTTP_BOOT private data.
97
98 @retval EFI_SUCCESS The S.A.R.R process successfully finished.
99 @retval Others Failed to finish the S.A.R.R process.
100
101**/
102EFI_STATUS
103HttpBootDhcp6Sarr (
104 IN HTTP_BOOT_PRIVATE_DATA *Private
105 );
106
107/**
108 Set the IP6 policy to Automatic.
109
110 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
111
112 @retval EFI_SUCCESS Switch the IP policy successfully.
113 @retval Others Unexpected error happened.
114
115**/
116EFI_STATUS
117HttpBootSetIp6Policy (
118 IN HTTP_BOOT_PRIVATE_DATA *Private
119 );
120
121/**
122 This function will register the default DNS addresses to the network device.
123
124 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
125 @param[in] DataLength Size of the buffer pointed to by DnsServerData in bytes.
126 @param[in] DnsServerData Point a list of DNS server address in an array
127 of EFI_IPv6_ADDRESS instances.
128
129 @retval EFI_SUCCESS The DNS configuration has been configured successfully.
130 @retval Others Failed to configure the address.
131
132**/
133EFI_STATUS
134HttpBootSetIp6Dns (
135 IN HTTP_BOOT_PRIVATE_DATA *Private,
136 IN UINTN DataLength,
137 IN VOID *DnsServerData
138 );
139
140/**
141 This function will register the IPv6 gateway address to the network device.
142
143 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
144
145 @retval EFI_SUCCESS The new IP configuration has been configured successfully.
146 @retval Others Failed to configure the address.
147
148**/
149EFI_STATUS
150HttpBootSetIp6Gateway (
151 IN HTTP_BOOT_PRIVATE_DATA *Private
152 );
153
154/**
155 This function will register the station IP address.
156
157 @param[in] Private The pointer to HTTP_BOOT_PRIVATE_DATA.
158
159 @retval EFI_SUCCESS The new IP address has been configured successfully.
160 @retval Others Failed to configure the address.
161
162**/
163EFI_STATUS
164HttpBootSetIp6Address (
165 IN HTTP_BOOT_PRIVATE_DATA *Private
166 );
167
168#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette