]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Ip6Config.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[mirror_edk2.git] / MdePkg / Include / Protocol / Ip6Config.h
CommitLineData
bdb140d7 1/** @file\r
2 This file provides a definition of the EFI IPv6 Configuration\r
3 Protocol.\r
4\r
1499e1ae 5Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>\r
9df063a0 6This program and the accompanying materials\r
bdb140d7 7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at<BR>\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT 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
25typedef struct _EFI_IP6_CONFIG_PROTOCOL EFI_IP6_CONFIG_PROTOCOL;\r
26\r
27///\r
28/// EFI_IP6_CONFIG_DATA_TYPE\r
29///\r
30typedef 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
1499e1ae
JW
69 /// pointer to an array of EFI_IPv6_ADDRESS instances. When \r
70 /// DataSize is 0 and Data is NULL, the existing configuration \r
71 /// is cleared from the EFI IPv6 Configuration Protocol instance.\r
bdb140d7 72 /// \r
73 Ip6ConfigDataTypeManualAddress,\r
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
80 /// Data is a pointer to an array of EFI_IPv6_ADDRESS instances.\r
1499e1ae
JW
81 /// When DataSize is 0 and Data is NULL, the existing configuration \r
82 /// is cleared from the EFI IPv6 Configuration Protocol instance.\r
bdb140d7 83 /// \r
84 Ip6ConfigDataTypeGateway,\r
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
91 /// Data is a pointer to an array of EFI_IPv6_ADDRESS instances.\r
1499e1ae
JW
92 /// When DataSize is 0 and Data is NULL, the existing configuration \r
93 /// is cleared from the EFI IPv6 Configuration Protocol instance.\r
bdb140d7 94 /// \r
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
104/// describes the operational state of the interface this \r
105/// EFI IPv6 Configuration Protocol instance manages.\r
106///\r
107typedef 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
112 /// \r
113 /// The interface type of the network interface.\r
114 /// \r
115 UINT8 IfType;\r
116 /// \r
117 /// The size, in bytes, of the network interface's hardware address.\r
118 /// \r
119 UINT32 HwAddressSize;\r
120 /// \r
121 /// The hardware address for the network interface.\r
122 /// \r
123 EFI_MAC_ADDRESS HwAddress;\r
124 /// \r
125 /// Number of EFI_IP6_ADDRESS_INFO structures pointed to by AddressInfo.\r
126 /// \r
127 UINT32 AddressInfoCount;\r
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
132 /// is zero.\r
133 /// \r
134 EFI_IP6_ADDRESS_INFO *AddressInfo;\r
135 /// \r
136 /// Number of route table entries in the following RouteTable.\r
137 /// \r
138 UINT32 RouteCount;\r
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
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
150typedef struct {\r
151 UINT8 Id[8];\r
152} EFI_IP6_CONFIG_INTERFACE_ID;\r
153\r
154///\r
155/// EFI_IP6_CONFIG_POLICY\r
156/// defines the general configuration policy the EFI IPv6 \r
157/// Configuration Protocol supports.\r
158///\r
159typedef enum {\r
160 ///\r
161 /// Under this policy, the IpI6ConfigDataTypeManualAddress, \r
162 /// Ip6ConfigDataTypeGateway and Ip6ConfigDataTypeDnsServer\r
163 /// configuration data are required to be set manually. \r
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
168 Ip6ConfigPolicyManual, \r
169 /// \r
170 /// Under this policy, the IpI6ConfigDataTypeManualAddress, \r
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
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
178 /// get address and other configuration information\r
179 /// \r
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
186/// while performing Duplicate Address Detection on a tentative address. \r
187/// The default value for a newly detected communication device is 1.\r
188///\r
189typedef struct {\r
190 UINT32 DupAddrDetectTransmits; ///< The number of consecutive Neighbor Solicitation messages sent.\r
191} EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS; \r
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
198typedef 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
208 \r
209 This function is used to set the configuration data of type DataType for the EFI \r
210 IPv6 network stack running on the communication device this EFI IPv6 Configuration\r
211 Protocol instance manages.\r
212\r
213 The DataSize is used to calculate the count of structure instances in the Data for \r
214 some DataType that multiple structure instances are allowed.\r
215 \r
216 This function is always non-blocking. When setting some type of configuration data,\r
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
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
222 event on the specified configuration data. Once the event is signaled, the caller \r
223 can call GetData() to get back the configuration data in order to know the result.\r
224 For other types of configuration data that do not require an asynchronous configuration \r
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
228 @param[in] DataType The type of data to set. \r
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
232 \r
233 @retval EFI_SUCCESS The specified configuration data for the EFI IPv6 \r
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
1499e1ae
JW
237 - One or more fields in Data and DataSize do not match the \r
238 requirement of the data type indicated by DataType. \r
ea6898b9 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
241 @retval EFI_ACCESS_DENIED Another set operation on the specified configuration \r
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
245 @retval EFI_BAD_BUFFER_SIZE The DataSize does not match the size of the type \r
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
250 \r
251**/\r
252typedef\r
253EFI_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
264 \r
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
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
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
276 process is finished, the event will be signaled and a subsequent GetData() call will return \r
277 the specified configuration data.\r
278\r
279 @param[in] This Pointer to the EFI_IP6_CONFIG_PROTOCOL instance.\r
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
282 size of buffer required to store the specified configuration data.\r
283 @param[in] Data The data buffer in which the configuration data is returned. The \r
284 type of the data buffer is associated with the DataType.\r
285 \r
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
ea6898b9 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
293 @retval EFI_NOT_READY The specified configuration data is not ready due to an already in \r
294 progress asynchronous configuration process.\r
295 @retval EFI_NOT_FOUND The specified configuration data is not found.\r
296 \r
297**/\r
298typedef\r
299EFI_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
310 \r
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
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
321 registered.\r
322 @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.\r
ea6898b9 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
327 \r
328**/\r
329typedef\r
330EFI_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
339 \r
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
343 @param[in] DataType The type of data to remove the previously registered event for. \r
344 @param[in] Event The event to unregister.\r
345 \r
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
ea6898b9 348 @retval EFI_NOT_FOUND The Event has not been registered for the specified \r
bdb140d7 349 DataType.\r
350 \r
351**/\r
352typedef\r
353EFI_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 364struct _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
371extern EFI_GUID gEfiIp6ConfigProtocolGuid;\r
372\r
373#endif\r
374\r