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