iPXE
Ip4Config2.h
Go to the documentation of this file.
1 /** @file
2  This file provides a definition of the EFI IPv4 Configuration II
3  Protocol.
4 
5 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8 @par Revision Reference:
9 This Protocol is introduced in UEFI Specification 2.5
10 
11 **/
12 
13 #ifndef __EFI_IP4CONFIG2_PROTOCOL_H__
14 #define __EFI_IP4CONFIG2_PROTOCOL_H__
15 
16 FILE_LICENCE ( BSD2_PATENT );
17 
18 #include <ipxe/efi/Protocol/Ip4.h>
19 
20 #define EFI_IP4_CONFIG2_PROTOCOL_GUID \
21  { \
22  0x5b446ed1, 0xe30b, 0x4faa, {0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 } \
23  }
24 
26 
27 ///
28 /// EFI_IP4_CONFIG2_DATA_TYPE
29 ///
30 typedef enum {
31  ///
32  /// The interface information of the communication device this EFI
33  /// IPv4 Configuration II Protocol instance manages. This type of
34  /// data is read only. The corresponding Data is of type
35  /// EFI_IP4_CONFIG2_INTERFACE_INFO.
36  ///
38  ///
39  /// The general configuration policy for the EFI IPv4 network stack
40  /// running on the communication device this EFI IPv4
41  /// Configuration II Protocol instance manages. The policy will
42  /// affect other configuration settings. The corresponding Data is of
43  /// type EFI_IP4_CONFIG2_POLICY.
44  ///
46  ///
47  /// The station addresses set manually for the EFI IPv4 network
48  /// stack. It is only configurable when the policy is
49  /// Ip4Config2PolicyStatic. The corresponding Data is of
50  /// type EFI_IP4_CONFIG2_MANUAL_ADDRESS. When DataSize
51  /// is 0 and Data is NULL, the existing configuration is cleared
52  /// from the EFI IPv4 Configuration II Protocol instance.
53  ///
55  ///
56  /// The gateway addresses set manually for the EFI IPv4 network
57  /// stack running on the communication device this EFI IPv4
58  /// Configuration II Protocol manages. It is not configurable when
59  /// the policy is Ip4Config2PolicyDhcp. The gateway
60  /// addresses must be unicast IPv4 addresses. The corresponding
61  /// Data is a pointer to an array of EFI_IPv4_ADDRESS instances.
62  /// When DataSize is 0 and Data is NULL, the existing configuration
63  /// is cleared from the EFI IPv4 Configuration II Protocol instance.
64  ///
66  ///
67  /// The DNS server list for the EFI IPv4 network stack running on
68  /// the communication device this EFI IPv4 Configuration II
69  /// Protocol manages. It is not configurable when the policy is
70  /// Ip4Config2PolicyDhcp. The DNS server addresses must be
71  /// unicast IPv4 addresses. The corresponding Data is a pointer to
72  /// an array of EFI_IPv4_ADDRESS instances. When DataSize
73  /// is 0 and Data is NULL, the existing configuration is cleared
74  /// from the EFI IPv4 Configuration II Protocol instance.
75  ///
79 
80 ///
81 /// EFI_IP4_CONFIG2_INTERFACE_INFO related definitions
82 ///
83 #define EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE 32
84 
85 ///
86 /// EFI_IP4_CONFIG2_INTERFACE_INFO
87 ///
88 typedef struct {
89  ///
90  /// The name of the interface. It is a NULL-terminated Unicode string.
91  ///
93  ///
94  /// The interface type of the network interface. See RFC 1700,
95  /// section "Number Hardware Type".
96  ///
98  ///
99  /// The size, in bytes, of the network interface's hardware address.
100  ///
102  ///
103  /// The hardware address for the network interface.
104  ///
106  ///
107  /// The station IPv4 address of this EFI IPv4 network stack.
108  ///
110  ///
111  /// The subnet address mask that is associated with the station address.
112  ///
114  ///
115  /// Size of the following RouteTable, in bytes. May be zero.
116  ///
118  ///
119  /// The route table of the IPv4 network stack runs on this interface.
120  /// Set to NULL if RouteTableSize is zero. Type EFI_IP4_ROUTE_TABLE is defined in
121  /// EFI_IP4_PROTOCOL.GetModeData().
122  ///
125 
126 ///
127 /// EFI_IP4_CONFIG2_POLICY
128 ///
129 typedef enum {
130  ///
131  /// Under this policy, the Ip4Config2DataTypeManualAddress,
132  /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration
133  /// data are required to be set manually. The EFI IPv4 Protocol will get all
134  /// required configuration such as IPv4 address, subnet mask and
135  /// gateway settings from the EFI IPv4 Configuration II protocol.
136  ///
138  ///
139  /// Under this policy, the Ip4Config2DataTypeManualAddress,
140  /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration data are
141  /// not allowed to set via SetData(). All of these configurations are retrieved from DHCP
142  /// server or other auto-configuration mechanism.
143  ///
147 
148 ///
149 /// EFI_IP4_CONFIG2_MANUAL_ADDRESS
150 ///
151 typedef struct {
152  ///
153  /// The IPv4 unicast address.
154  ///
156  ///
157  /// The subnet mask.
158  ///
161 
162 /**
163  Set the configuration for the EFI IPv4 network stack running on the communication device this EFI
164  IPv4 Configuration II Protocol instance manages.
165 
166  This function is used to set the configuration data of type DataType for the EFI IPv4 network stack
167  running on the communication device this EFI IPv4 Configuration II Protocol instance manages.
168  The successfully configured data is valid after system reset or power-off.
169  The DataSize is used to calculate the count of structure instances in the Data for some
170  DataType that multiple structure instances are allowed.
171  This function is always non-blocking. When setting some typeof configuration data, an
172  asynchronous process is invoked to check the correctness of the data, such as doing address conflict
173  detection on the manually set local IPv4 address. EFI_NOT_READY is returned immediately to
174  indicate that such an asynchronous process is invoked and the process is not finished yet. The caller
175  willing to get the result of the asynchronous process is required to call RegisterDataNotify()
176  to register an event on the specified configuration data. Once the event is signaled, the caller can call
177  GetData()to get back the configuration data in order to know the result. For other types of
178  configuration data that do not require an asynchronous configuration process, the result of the
179  operation is immediately returned.
180 
181  @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
182  @param[in] DataType The type of data to set.
183  @param[in] DataSize Size of the buffer pointed to by Data in bytes.
184  @param[in] Data The data buffer to set. The type ofthe data buffer is associated
185  with the DataType.
186 
187  @retval EFI_SUCCESS The specified configuration data for the EFI IPv4 network stack is set
188  successfully.
189  @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
190  This is NULL.
191  One or more fields in Data and DataSize do not match the
192  requirement of the data type indicated by DataType.
193  @retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified configuration
194  data can not be set under the current policy.
195  @retval EFI_ACCESS_DENIED Another set operation on the specified configuration data is already in process.
196  @retval EFI_NOT_READY An asynchronous process is invoked to set the specified configuration data and
197  the process is not finished yet.
198  @retval EFI_BAD_BUFFER_SIZE The DataSize does not match the size of the type indicated by DataType.
199  @retval EFI_UNSUPPORTED This DataType is not supported.
200  @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
201  @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.
202 **/
203 typedef
207  IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
208  IN UINTN DataSize,
209  IN VOID *Data
210  );
211 
212 /**
213  Get the configuration data for the EFI IPv4 network stack running on the communication device this
214  EFI IPv4 Configuration II Protocol instance manages.
215 
216  This function returns the configuration data of type DataType for the EFI IPv4 network stack
217  running on the communication device this EFI IPv4 Configuration II Protocol instance manages.
218  The caller is responsible for allocating the buffer usedto return the specified configuration data and
219  the required size will be returned to the caller if the size of the buffer is too small.
220  EFI_NOT_READY is returned if the specified configuration data is not ready due to an already in
221  progress asynchronous configuration process. The caller can call RegisterDataNotify() to
222  register an event on the specified configuration data. Once the asynchronous configuration process is
223  finished, the event will be signaled and a subsequent GetData() call will return the specified
224  configuration data.
225 
226  @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
227  @param[in] DataType The type of data to get.
228  @param[out] DataSize On input, in bytes, the size of Data. On output, in bytes, the size
229  of buffer required to store the specified configuration data.
230  @param[in] Data The data buffer in which the configuration data is returned. The
231  type of the data buffer is associated with the DataType. Ignored
232  if DataSize is 0.
233 
234  @retval EFI_SUCCESS The specified configuration data is got successfully.
235  @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
236  This is NULL.
237  DataSize is NULL.
238  Data is NULL if *DataSizeis not zero.
239  @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified configuration data
240  and the required size is returned in DataSize.
241  @retval EFI_NOT_READY The specified configuration data is not ready due to an already in
242  progress asynchronous configuration process.
243  @retval EFI_NOT_FOUND The specified configuration data is not found.
244 **/
245 typedef
249  IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
250  IN OUT UINTN *DataSize,
251  IN VOID *Data OPTIONAL
252  );
253 
254 /**
255  Register an event that is to be signaled whenever a configuration process on the specified
256  configuration data is done.
257 
258  This function registers an event that is to be signaled whenever a configuration process on the
259  specified configuration data is done. An event can be registered for different DataType
260  simultaneously and the caller is responsible for determining which type of configuration data causes
261  the signaling of the event in such case.
262 
263  @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
264  @param[in] DataType The type of data to unregister the event for.
265  @param[in] Event The event to register.
266 
267  @retval EFI_SUCCESS The notification event for the specified configuration data is
268  registered.
269  @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
270  @retval EFI_UNSUPPORTED The configuration data type specified by DataType is not supported.
271  @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
272  @retval EFI_ACCESS_DENIED The Event is already registered for the DataType.
273 **/
274 typedef
278  IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
279  IN EFI_EVENT Event
280  );
281 
282 /**
283  Remove a previously registered event for the specified configuration data.
284 
285  This function removes a previously registeredevent for the specified configuration data.
286 
287  @param[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
288  @param[in] DataType The type of data to remove the previously registered event for.
289  @param[in] Event The event to unregister.
290 
291  @retval EFI_SUCCESS The event registered for the specified configuration data is removed.
292  @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
293  @retval EFI_NOT_FOUND The Eventhas not been registered for the specified DataType.
294 **/
295 typedef
299  IN EFI_IP4_CONFIG2_DATA_TYPE DataType,
300  IN EFI_EVENT Event
301  );
302 
303 ///
304 /// The EFI_IP4_CONFIG2_PROTOCOL is designed to be the central repository for the common
305 /// configurations and the administrator configurable settings for the EFI IPv4 network stack.
306 /// An EFI IPv4 Configuration II Protocol instance will be installed on each communication device that
307 /// the EFI IPv4 network stack runs on.
308 ///
314 };
315 
317 
318 #endif
EFI_IPv4_ADDRESS Address
The IPv4 unicast address.
Definition: Ip4Config2.h:155
#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
EFI_IPv4_ADDRESS StationAddress
The station IPv4 address of this EFI IPv4 network stack.
Definition: Ip4Config2.h:109
EFI_IP4_CONFIG2_SET_DATA SetData
Definition: Ip4Config2.h:310
EFI_IP4_CONFIG2_INTERFACE_INFO.
Definition: Ip4Config2.h:88
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
EFI_IPv4_ADDRESS SubnetMask
The subnet address mask that is associated with the station address.
Definition: Ip4Config2.h:113
32-byte buffer containing a network Media Access Control address.
Definition: UefiBaseType.h:97
EFI_STATUS(EFIAPI * EFI_IP4_CONFIG2_REGISTER_NOTIFY)(IN EFI_IP4_CONFIG2_PROTOCOL *This, IN EFI_IP4_CONFIG2_DATA_TYPE DataType, IN EFI_EVENT Event)
Register an event that is to be signaled whenever a configuration process on the specified configurat...
Definition: Ip4Config2.h:276
VOID * EFI_EVENT
Handle to an event structure.
Definition: UefiBaseType.h:39
The DNS server list for the EFI IPv4 network stack running on the communication device this EFI IPv4 ...
Definition: Ip4Config2.h:76
The interface information of the communication device this EFI IPv4 Configuration II Protocol instanc...
Definition: Ip4Config2.h:37
unsigned int UINT32
Definition: ProcessorBind.h:98
EFI_MAC_ADDRESS HwAddress
The hardware address for the network interface.
Definition: Ip4Config2.h:105
unsigned short CHAR16
#define EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE
EFI_IP4_CONFIG2_INTERFACE_INFO related definitions.
Definition: Ip4Config2.h:83
Under this policy, the Ip4Config2DataTypeManualAddress, Ip4Config2DataTypeGateway and Ip4Config2DataT...
Definition: Ip4Config2.h:144
The EFI_IP4_CONFIG2_PROTOCOL is designed to be the central repository for the common configurations a...
Definition: Ip4Config2.h:309
unsigned char UINT8
EFI_STATUS(EFIAPI * EFI_IP4_CONFIG2_GET_DATA)(IN EFI_IP4_CONFIG2_PROTOCOL *This, IN EFI_IP4_CONFIG2_DATA_TYPE DataType, IN OUT UINTN *DataSize, IN VOID *Data OPTIONAL)
Get the configuration data for the EFI IPv4 network stack running on the communication device this EF...
Definition: Ip4Config2.h:247
UINT8 IfType
The interface type of the network interface.
Definition: Ip4Config2.h:97
EFI_GUID gEfiIp4Config2ProtocolGuid
EFI_IP4_CONFIG2_REGISTER_NOTIFY RegisterDataNotify
Definition: Ip4Config2.h:312
UINT32 HwAddressSize
The size, in bytes, of the network interface's hardware address.
Definition: Ip4Config2.h:101
EFI_STATUS(EFIAPI * EFI_IP4_CONFIG2_SET_DATA)(IN EFI_IP4_CONFIG2_PROTOCOL *This, IN EFI_IP4_CONFIG2_DATA_TYPE DataType, IN UINTN DataSize, IN VOID *Data)
Set the configuration for the EFI IPv4 network stack running on the communication device this EFI IPv...
Definition: Ip4Config2.h:205
UINT8 Name
Definition: Acpi10.h:135
#define OUT
Definition: mlx_utils.h:29
The general configuration policy for the EFI IPv4 network stack running on the communication device t...
Definition: Ip4Config2.h:45
This file defines the EFI IPv4 (Internet Protocol version 4) Protocol interface.
4-byte buffer.
Definition: Base.h:225
UINT32 RouteTableSize
Size of the following RouteTable, in bytes.
Definition: Ip4Config2.h:117
EFI_IP4_CONFIG2_MANUAL_ADDRESS.
Definition: Ip4Config2.h:151
EFI_IP4_CONFIG2_POLICY
EFI_IP4_CONFIG2_POLICY.
Definition: Ip4Config2.h:129
#define EFIAPI
The station addresses set manually for the EFI IPv4 network stack.
Definition: Ip4Config2.h:54
UINT64 UINTN
Unsigned value of native width.
#define VOID
Undeclared type.
Definition: Base.h:271
#define IN
Definition: mlx_utils.h:28
FILE_LICENCE(BSD2_PATENT)
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_STATUS(EFIAPI * EFI_IP4_CONFIG2_UNREGISTER_NOTIFY)(IN EFI_IP4_CONFIG2_PROTOCOL *This, IN EFI_IP4_CONFIG2_DATA_TYPE DataType, IN EFI_EVENT Event)
Remove a previously registered event for the specified configuration data.
Definition: Ip4Config2.h:297
Under this policy, the Ip4Config2DataTypeManualAddress, Ip4Config2DataTypeGateway and Ip4Config2DataT...
Definition: Ip4Config2.h:137
EFI_IP4_CONFIG2_GET_DATA GetData
Definition: Ip4Config2.h:311
EFI_IP4_CONFIG2_UNREGISTER_NOTIFY UnregisterDataNotify
Definition: Ip4Config2.h:313
EFI_IP4_ROUTE_TABLE *RouteTable OPTIONAL
The route table of the IPv4 network stack runs on this interface.
Definition: Ip4Config2.h:123
EFI_IP4_CONFIG2_DATA_TYPE
EFI_IP4_CONFIG2_DATA_TYPE.
Definition: Ip4Config2.h:30
The gateway addresses set manually for the EFI IPv4 network stack running on the communication device...
Definition: Ip4Config2.h:65
EFI_IPv4_ADDRESS SubnetMask
The subnet mask.
Definition: Ip4Config2.h:159