]>
Commit | Line | Data |
---|---|---|
bdb140d7 | 1 | /** @file\r |
2 | This file provides a definition of the EFI IPv6 Configuration\r | |
3 | Protocol.\r | |
4 | \r | |
9095d37b | 5 | Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
bdb140d7 | 7 | \r |
8 | **/\r | |
2f88bd3a | 9 | \r |
bdb140d7 | 10 | #ifndef __EFI_IP6CONFIG_PROTOCOL_H__\r |
11 | #define __EFI_IP6CONFIG_PROTOCOL_H__\r | |
12 | \r | |
13 | #include <Protocol/Ip6.h>\r | |
14 | \r | |
15 | #define EFI_IP6_CONFIG_PROTOCOL_GUID \\r | |
16 | { \\r | |
17 | 0x937fe521, 0x95ae, 0x4d1a, {0x89, 0x29, 0x48, 0xbc, 0xd9, 0x0a, 0xd3, 0x1a } \\r | |
18 | }\r | |
19 | \r | |
20 | typedef struct _EFI_IP6_CONFIG_PROTOCOL EFI_IP6_CONFIG_PROTOCOL;\r | |
21 | \r | |
22 | ///\r | |
23 | /// EFI_IP6_CONFIG_DATA_TYPE\r | |
24 | ///\r | |
9095d37b LG |
25 | typedef enum {\r |
26 | ///\r | |
27 | /// The interface information of the communication\r | |
28 | /// device this EFI IPv6 Configuration Protocol instance manages.\r | |
29 | /// This type of data is read only.The corresponding Data is of type\r | |
bdb140d7 | 30 | /// EFI_IP6_CONFIG_INTERFACE_INFO.\r |
9095d37b | 31 | ///\r |
bdb140d7 | 32 | Ip6ConfigDataTypeInterfaceInfo,\r |
9095d37b LG |
33 | ///\r |
34 | /// The alternative interface ID for the\r | |
35 | /// communication device this EFI IPv6 Configuration Protocol\r | |
36 | /// instance manages if the link local IPv6 address generated from\r | |
37 | /// the interfaced ID based on the default source the EFI IPv6\r | |
38 | /// Protocol uses is a duplicate address. The length of the interface\r | |
39 | /// ID is 64 bit. The corresponding Data is of type\r | |
bdb140d7 | 40 | /// EFI_IP6_CONFIG_INTERFACE_ID.\r |
9095d37b | 41 | ///\r |
bdb140d7 | 42 | Ip6ConfigDataTypeAltInterfaceId,\r |
9095d37b LG |
43 | ///\r |
44 | /// The general configuration policy for the EFI IPv6 network\r | |
45 | /// stack running on the communication device this EFI IPv6\r | |
46 | /// Configuration Protocol instance manages. The policy will affect\r | |
47 | /// other configuration settings. The corresponding Data is of type\r | |
bdb140d7 | 48 | /// EFI_IP6_CONFIG_POLICY.\r |
49 | ///\r | |
50 | Ip6ConfigDataTypePolicy,\r | |
9095d37b LG |
51 | ///\r |
52 | /// The number of consecutive\r | |
53 | /// Neighbor Solicitation messages sent while performing Duplicate\r | |
54 | /// Address Detection on a tentative address. A value of zero\r | |
55 | /// indicates that Duplicate Address Detection will not be performed\r | |
56 | /// on tentative addresses. The corresponding Data is of type\r | |
bdb140d7 | 57 | /// EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS.\r |
9095d37b | 58 | ///\r |
bdb140d7 | 59 | Ip6ConfigDataTypeDupAddrDetectTransmits,\r |
9095d37b LG |
60 | ///\r |
61 | /// The station addresses set manually for the EFI\r | |
62 | /// IPv6 network stack. It is only configurable when the policy is\r | |
63 | /// Ip6ConfigPolicyManual. The corresponding Data is a\r | |
64 | /// pointer to an array of EFI_IPv6_ADDRESS instances. When\r | |
65 | /// DataSize is 0 and Data is NULL, the existing configuration\r | |
1499e1ae | 66 | /// is cleared from the EFI IPv6 Configuration Protocol instance.\r |
9095d37b | 67 | ///\r |
bdb140d7 | 68 | Ip6ConfigDataTypeManualAddress,\r |
9095d37b LG |
69 | ///\r |
70 | /// The gateway addresses set manually for the EFI IPv6\r | |
71 | /// network stack running on the communication device this EFI\r | |
72 | /// IPv6 Configuration Protocol manages. It is not configurable when\r | |
73 | /// the policy is Ip6ConfigPolicyAutomatic. The gateway\r | |
74 | /// addresses must be unicast IPv6 addresses. The corresponding\r | |
bdb140d7 | 75 | /// Data is a pointer to an array of EFI_IPv6_ADDRESS instances.\r |
9095d37b | 76 | /// When DataSize is 0 and Data is NULL, the existing configuration\r |
1499e1ae | 77 | /// is cleared from the EFI IPv6 Configuration Protocol instance.\r |
9095d37b | 78 | ///\r |
bdb140d7 | 79 | Ip6ConfigDataTypeGateway,\r |
9095d37b LG |
80 | ///\r |
81 | /// The DNS server list for the EFI IPv6 network stack\r | |
82 | /// running on the communication device this EFI IPv6\r | |
83 | /// Configuration Protocol manages. It is not configurable when the\r | |
84 | /// policy is Ip6ConfigPolicyAutomatic.The DNS server\r | |
85 | /// addresses must be unicast IPv6 addresses. The corresponding\r | |
bdb140d7 | 86 | /// Data is a pointer to an array of EFI_IPv6_ADDRESS instances.\r |
9095d37b | 87 | /// When DataSize is 0 and Data is NULL, the existing configuration\r |
1499e1ae | 88 | /// is cleared from the EFI IPv6 Configuration Protocol instance.\r |
9095d37b | 89 | ///\r |
bdb140d7 | 90 | Ip6ConfigDataTypeDnsServer,\r |
91 | ///\r | |
92 | /// The number of this enumeration memebers.\r | |
93 | ///\r | |
94 | Ip6ConfigDataTypeMaximum\r | |
95 | } EFI_IP6_CONFIG_DATA_TYPE;\r | |
96 | \r | |
97 | ///\r | |
98 | /// EFI_IP6_CONFIG_INTERFACE_INFO\r | |
9095d37b | 99 | /// describes the operational state of the interface this\r |
bdb140d7 | 100 | /// EFI IPv6 Configuration Protocol instance manages.\r |
101 | ///\r | |
102 | typedef struct {\r | |
103 | ///\r | |
4f077902 | 104 | /// The name of the interface. It is a NULL-terminated string.\r |
bdb140d7 | 105 | ///\r |
2f88bd3a | 106 | CHAR16 Name[32];\r |
9095d37b | 107 | ///\r |
bdb140d7 | 108 | /// The interface type of the network interface.\r |
9095d37b | 109 | ///\r |
2f88bd3a | 110 | UINT8 IfType;\r |
9095d37b | 111 | ///\r |
bdb140d7 | 112 | /// The size, in bytes, of the network interface's hardware address.\r |
9095d37b | 113 | ///\r |
2f88bd3a | 114 | UINT32 HwAddressSize;\r |
9095d37b | 115 | ///\r |
bdb140d7 | 116 | /// The hardware address for the network interface.\r |
9095d37b | 117 | ///\r |
2f88bd3a | 118 | EFI_MAC_ADDRESS HwAddress;\r |
9095d37b | 119 | ///\r |
bdb140d7 | 120 | /// Number of EFI_IP6_ADDRESS_INFO structures pointed to by AddressInfo.\r |
9095d37b | 121 | ///\r |
2f88bd3a | 122 | UINT32 AddressInfoCount;\r |
9095d37b LG |
123 | ///\r |
124 | /// Pointer to an array of EFI_IP6_ADDRESS_INFO instances\r | |
125 | /// which contain the local IPv6 addresses and the corresponding\r | |
126 | /// prefix length information. Set to NULL if AddressInfoCount\r | |
bdb140d7 | 127 | /// is zero.\r |
9095d37b | 128 | ///\r |
2f88bd3a | 129 | EFI_IP6_ADDRESS_INFO *AddressInfo;\r |
9095d37b | 130 | ///\r |
bdb140d7 | 131 | /// Number of route table entries in the following RouteTable.\r |
9095d37b | 132 | ///\r |
2f88bd3a | 133 | UINT32 RouteCount;\r |
9095d37b LG |
134 | ///\r |
135 | /// The route table of the IPv6 network stack runs on this interface.\r | |
136 | /// Set to NULL if RouteCount is zero.\r | |
137 | ///\r | |
2f88bd3a | 138 | EFI_IP6_ROUTE_TABLE *RouteTable;\r |
bdb140d7 | 139 | } EFI_IP6_CONFIG_INTERFACE_INFO;\r |
140 | \r | |
141 | ///\r | |
142 | /// EFI_IP6_CONFIG_INTERFACE_ID\r | |
143 | /// describes the 64-bit interface ID.\r | |
144 | ///\r | |
145 | typedef struct {\r | |
2f88bd3a | 146 | UINT8 Id[8];\r |
bdb140d7 | 147 | } EFI_IP6_CONFIG_INTERFACE_ID;\r |
148 | \r | |
149 | ///\r | |
150 | /// EFI_IP6_CONFIG_POLICY\r | |
9095d37b | 151 | /// defines the general configuration policy the EFI IPv6\r |
bdb140d7 | 152 | /// Configuration Protocol supports.\r |
153 | ///\r | |
154 | typedef enum {\r | |
155 | ///\r | |
9095d37b | 156 | /// Under this policy, the IpI6ConfigDataTypeManualAddress,\r |
bdb140d7 | 157 | /// Ip6ConfigDataTypeGateway and Ip6ConfigDataTypeDnsServer\r |
9095d37b | 158 | /// configuration data are required to be set manually.\r |
bdb140d7 | 159 | /// The EFI IPv6 Protocol will get all required configuration\r |
160 | /// such as address, prefix and gateway settings from the EFI\r | |
161 | /// IPv6 Configuration protocol.\r | |
162 | ///\r | |
9095d37b LG |
163 | Ip6ConfigPolicyManual,\r |
164 | ///\r | |
165 | /// Under this policy, the IpI6ConfigDataTypeManualAddress,\r | |
bdb140d7 | 166 | /// Ip6ConfigDataTypeGateway and Ip6ConfigDataTypeDnsServer\r |
167 | /// configuration data are not allowed to set via SetData().\r | |
168 | /// All of these configurations are retrieved from some auto\r | |
9095d37b LG |
169 | /// configuration mechanism.\r |
170 | /// The EFI IPv6 Protocol will use the IPv6 stateless address\r | |
171 | /// autoconfiguration mechanism and/or the IPv6 stateful address\r | |
172 | /// autoconfiguration mechanism described in the related RFCs to\r | |
bdb140d7 | 173 | /// get address and other configuration information\r |
9095d37b | 174 | ///\r |
bdb140d7 | 175 | Ip6ConfigPolicyAutomatic\r |
176 | } EFI_IP6_CONFIG_POLICY;\r | |
177 | \r | |
178 | ///\r | |
179 | /// EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS\r | |
180 | /// describes the number of consecutive Neighbor Solicitation messages sent\r | |
9095d37b | 181 | /// while performing Duplicate Address Detection on a tentative address.\r |
bdb140d7 | 182 | /// The default value for a newly detected communication device is 1.\r |
183 | ///\r | |
184 | typedef struct {\r | |
185 | UINT32 DupAddrDetectTransmits; ///< The number of consecutive Neighbor Solicitation messages sent.\r | |
9095d37b | 186 | } EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS;\r |
bdb140d7 | 187 | \r |
188 | ///\r | |
189 | /// EFI_IP6_CONFIG_MANUAL_ADDRESS\r | |
190 | /// is used to set the station address information for the EFI IPv6 network\r | |
191 | /// stack manually when the policy is Ip6ConfigPolicyManual.\r | |
192 | ///\r | |
193 | typedef struct {\r | |
2f88bd3a MK |
194 | EFI_IPv6_ADDRESS Address; ///< The IPv6 unicast address.\r |
195 | BOOLEAN IsAnycast; ///< Set to TRUE if Address is anycast.\r | |
196 | UINT8 PrefixLength; ///< The length, in bits, of the prefix associated with this Address.\r | |
bdb140d7 | 197 | } EFI_IP6_CONFIG_MANUAL_ADDRESS;\r |
198 | \r | |
bdb140d7 | 199 | /**\r |
200 | Set the configuration for the EFI IPv6 network stack running on the communication\r | |
201 | device this EFI IPv6 Configuration Protocol instance manages.\r | |
9095d37b LG |
202 | \r |
203 | This function is used to set the configuration data of type DataType for the EFI\r | |
bdb140d7 | 204 | IPv6 network stack running on the communication device this EFI IPv6 Configuration\r |
205 | Protocol instance manages.\r | |
206 | \r | |
9095d37b | 207 | The DataSize is used to calculate the count of structure instances in the Data for\r |
bdb140d7 | 208 | some DataType that multiple structure instances are allowed.\r |
9095d37b | 209 | \r |
bdb140d7 | 210 | This function is always non-blocking. When setting some type of configuration data,\r |
9095d37b LG |
211 | an asynchronous process is invoked to check the correctness of the data, such as\r |
212 | doing Duplicate Address Detection on the manually set local IPv6 addresses.\r | |
bdb140d7 | 213 | EFI_NOT_READY is returned immediately to indicate that such an asynchronous process\r |
214 | is invoked and the process is not finished yet. The caller willing to get the result\r | |
215 | of the asynchronous process is required to call RegisterDataNotify() to register an\r | |
9095d37b | 216 | event on the specified configuration data. Once the event is signaled, the caller\r |
bdb140d7 | 217 | can call GetData() to get back the configuration data in order to know the result.\r |
9095d37b | 218 | For other types of configuration data that do not require an asynchronous configuration\r |
bdb140d7 | 219 | process, the result of the operation is immediately returned.\r |
220 | \r | |
221 | @param[in] This Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.\r | |
9095d37b | 222 | @param[in] DataType The type of data to set.\r |
bdb140d7 | 223 | @param[in] DataSize Size of the buffer pointed to by Data in bytes.\r |
224 | @param[in] Data The data buffer to set. The type of the data buffer is\r | |
225 | associated with the DataType.\r | |
9095d37b LG |
226 | \r |
227 | @retval EFI_SUCCESS The specified configuration data for the EFI IPv6\r | |
bdb140d7 | 228 | network stack is set successfully.\r |
229 | @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r | |
230 | - This is NULL.\r | |
9095d37b LG |
231 | - One or more fields in Data and DataSize do not match the\r |
232 | requirement of the data type indicated by DataType.\r | |
233 | @retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified\r | |
bdb140d7 | 234 | configuration data can not be set under the current policy\r |
9095d37b | 235 | @retval EFI_ACCESS_DENIED Another set operation on the specified configuration\r |
bdb140d7 | 236 | data is already in process.\r |
237 | @retval EFI_NOT_READY An asynchronous process is invoked to set the specified\r | |
238 | configuration data and the process is not finished yet.\r | |
9095d37b | 239 | @retval EFI_BAD_BUFFER_SIZE The DataSize does not match the size of the type\r |
bdb140d7 | 240 | indicated by DataType.\r |
241 | @retval EFI_UNSUPPORTED This DataType is not supported.\r | |
242 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
243 | @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.\r | |
9095d37b | 244 | \r |
bdb140d7 | 245 | **/\r |
246 | typedef\r | |
247 | EFI_STATUS\r | |
5e6f3ee2 | 248 | (EFIAPI *EFI_IP6_CONFIG_SET_DATA)(\r |
bdb140d7 | 249 | IN EFI_IP6_CONFIG_PROTOCOL *This,\r |
250 | IN EFI_IP6_CONFIG_DATA_TYPE DataType,\r | |
251 | IN UINTN DataSize,\r | |
252 | IN VOID *Data\r | |
253 | );\r | |
254 | \r | |
255 | /**\r | |
256 | Get the configuration data for the EFI IPv6 network stack running on the communication\r | |
257 | device this EFI IPv6 Configuration Protocol instance manages.\r | |
9095d37b | 258 | \r |
bdb140d7 | 259 | This function returns the configuration data of type DataType for the EFI IPv6 network\r |
260 | stack running on the communication device this EFI IPv6 Configuration Protocol instance\r | |
261 | manages.\r | |
262 | \r | |
263 | The caller is responsible for allocating the buffer used to return the specified\r | |
264 | configuration data and the required size will be returned to the caller if the size of\r | |
9095d37b LG |
265 | the buffer is too small.\r |
266 | \r | |
267 | EFI_NOT_READY is returned if the specified configuration data is not ready due to an\r | |
bdb140d7 | 268 | already in progress asynchronous configuration process. The caller can call RegisterDataNotify()\r |
269 | to register an event on the specified configuration data. Once the asynchronous configuration\r | |
9095d37b | 270 | process is finished, the event will be signaled and a subsequent GetData() call will return\r |
bdb140d7 | 271 | the specified configuration data.\r |
272 | \r | |
273 | @param[in] This Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.\r | |
9095d37b LG |
274 | @param[in] DataType The type of data to get.\r |
275 | @param[in,out] DataSize On input, in bytes, the size of Data. On output, in bytes, the\r | |
bdb140d7 | 276 | size of buffer required to store the specified configuration data.\r |
9095d37b | 277 | @param[in] Data The data buffer in which the configuration data is returned. The\r |
bdb140d7 | 278 | type of the data buffer is associated with the DataType.\r |
9095d37b | 279 | \r |
bdb140d7 | 280 | @retval EFI_SUCCESS The specified configuration data is got successfully.\r |
281 | @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:\r | |
282 | - This is NULL.\r | |
283 | - DataSize is NULL.\r | |
284 | - Data is NULL if *DataSize is not zero.\r | |
9095d37b | 285 | @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified configuration data\r |
bdb140d7 | 286 | and the required size is returned in DataSize.\r |
9095d37b | 287 | @retval EFI_NOT_READY The specified configuration data is not ready due to an already in\r |
bdb140d7 | 288 | progress asynchronous configuration process.\r |
289 | @retval EFI_NOT_FOUND The specified configuration data is not found.\r | |
9095d37b | 290 | \r |
bdb140d7 | 291 | **/\r |
292 | typedef\r | |
293 | EFI_STATUS\r | |
5e6f3ee2 | 294 | (EFIAPI *EFI_IP6_CONFIG_GET_DATA)(\r |
bdb140d7 | 295 | IN EFI_IP6_CONFIG_PROTOCOL *This,\r |
296 | IN EFI_IP6_CONFIG_DATA_TYPE DataType,\r | |
297 | IN OUT UINTN *DataSize,\r | |
298 | IN VOID *Data OPTIONAL\r | |
299 | );\r | |
300 | \r | |
301 | /**\r | |
302 | Register an event that is to be signaled whenever a configuration process on the specified\r | |
303 | configuration data is done.\r | |
9095d37b | 304 | \r |
bdb140d7 | 305 | This function registers an event that is to be signaled whenever a configuration process\r |
306 | on the specified configuration data is done. An event can be registered for different DataType\r | |
307 | simultaneously and the caller is responsible for determining which type of configuration data\r | |
308 | causes the signaling of the event in such case.\r | |
309 | \r | |
310 | @param[in] This Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.\r | |
9095d37b LG |
311 | @param[in] DataType The type of data to unregister the event for.\r |
312 | @param[in] Event The event to register.\r | |
313 | \r | |
314 | @retval EFI_SUCCESS The notification event for the specified configuration data is\r | |
bdb140d7 | 315 | registered.\r |
316 | @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.\r | |
9095d37b | 317 | @retval EFI_UNSUPPORTED The configuration data type specified by DataType is not\r |
bdb140d7 | 318 | supported.\r |
319 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r | |
320 | @retval EFI_ACCESS_DENIED The Event is already registered for the DataType.\r | |
9095d37b | 321 | \r |
bdb140d7 | 322 | **/\r |
323 | typedef\r | |
324 | EFI_STATUS\r | |
5e6f3ee2 | 325 | (EFIAPI *EFI_IP6_CONFIG_REGISTER_NOTIFY)(\r |
bdb140d7 | 326 | IN EFI_IP6_CONFIG_PROTOCOL *This,\r |
327 | IN EFI_IP6_CONFIG_DATA_TYPE DataType,\r | |
328 | IN EFI_EVENT Event\r | |
329 | );\r | |
330 | \r | |
331 | /**\r | |
332 | Remove a previously registered event for the specified configuration data.\r | |
9095d37b | 333 | \r |
bdb140d7 | 334 | This function removes a previously registered event for the specified configuration data.\r |
335 | \r | |
336 | @param[in] This Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.\r | |
9095d37b | 337 | @param[in] DataType The type of data to remove the previously registered event for.\r |
bdb140d7 | 338 | @param[in] Event The event to unregister.\r |
9095d37b | 339 | \r |
bdb140d7 | 340 | @retval EFI_SUCCESS The event registered for the specified configuration data is removed.\r |
341 | @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.\r | |
9095d37b | 342 | @retval EFI_NOT_FOUND The Event has not been registered for the specified\r |
bdb140d7 | 343 | DataType.\r |
9095d37b | 344 | \r |
bdb140d7 | 345 | **/\r |
346 | typedef\r | |
347 | EFI_STATUS\r | |
5e6f3ee2 | 348 | (EFIAPI *EFI_IP6_CONFIG_UNREGISTER_NOTIFY)(\r |
bdb140d7 | 349 | IN EFI_IP6_CONFIG_PROTOCOL *This,\r |
350 | IN EFI_IP6_CONFIG_DATA_TYPE DataType,\r | |
351 | IN EFI_EVENT Event\r | |
352 | );\r | |
353 | \r | |
354 | ///\r | |
355 | /// The EFI_IP6_CONFIG_PROTOCOL provides the mechanism to set and get various\r | |
356 | /// types of configurations for the EFI IPv6 network stack.\r | |
357 | ///\r | |
5e6f3ee2 | 358 | struct _EFI_IP6_CONFIG_PROTOCOL {\r |
2f88bd3a MK |
359 | EFI_IP6_CONFIG_SET_DATA SetData;\r |
360 | EFI_IP6_CONFIG_GET_DATA GetData;\r | |
361 | EFI_IP6_CONFIG_REGISTER_NOTIFY RegisterDataNotify;\r | |
362 | EFI_IP6_CONFIG_UNREGISTER_NOTIFY UnregisterDataNotify;\r | |
5e6f3ee2 | 363 | };\r |
bdb140d7 | 364 | \r |
2f88bd3a | 365 | extern EFI_GUID gEfiIp6ConfigProtocolGuid;\r |
bdb140d7 | 366 | \r |
367 | #endif\r |