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