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