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