iPXE
Ip4Config.h
Go to the documentation of this file.
1 #ifndef _IPXE_EFI_IP4CONFIG_H
2 #define _IPXE_EFI_IP4CONFIG_H
3 
4 /** @file
5  This file provides a definition of the EFI IPv4 Configuration
6  Protocol.
7 
8 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10 
11  @par Revision Reference:
12  This Protocol is introduced in UEFI Specification 2.0.
13 
14 **/
15 
16 #ifndef __EFI_IP4CONFIG_PROTOCOL_H__
17 #define __EFI_IP4CONFIG_PROTOCOL_H__
18 
19 FILE_LICENCE ( BSD2_PATENT );
20 
21 #include <ipxe/efi/Protocol/Ip4.h>
22 
23 #define EFI_IP4_CONFIG_PROTOCOL_GUID \
24  { \
25  0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } \
26  }
27 
29 
30 #define IP4_CONFIG_VARIABLE_ATTRIBUTES \
31  (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)
32 
33 ///
34 /// EFI_IP4_IPCONFIG_DATA contains the minimum IPv4 configuration data
35 /// that is needed to start basic network communication. The StationAddress
36 /// and SubnetMask must be a valid unicast IP address and subnet mask.
37 /// If RouteTableSize is not zero, then RouteTable contains a properly
38 /// formatted routing table for the StationAddress/SubnetMask, with the
39 /// last entry in the table being the default route.
40 ///
41 typedef struct {
42  ///
43  /// Default station IP address, stored in network byte order.
44  ///
46  ///
47  /// Default subnet mask, stored in network byte order.
48  ///
50  ///
51  /// Number of entries in the following RouteTable. May be zero.
52  ///
54  ///
55  /// Default routing table data (stored in network byte order).
56  /// Ignored if RouteTableSize is zero.
57  ///
60 
61 /**
62  Starts running the configuration policy for the EFI IPv4 Protocol driver.
63 
64  The Start() function is called to determine and to begin the platform
65  configuration policy by the EFI IPv4 Protocol driver. This determination may
66  be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol
67  driver configuration policy. It may be as involved as loading some defaults
68  from nonvolatile storage, downloading dynamic data from a DHCP server, and
69  checking permissions with a site policy server.
70  Starting the configuration policy is just the beginning. It may finish almost
71  instantly or it may take several minutes before it fails to retrieve configuration
72  information from one or more servers. Once the policy is started, drivers
73  should use the DoneEvent parameter to determine when the configuration policy
74  has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to
75  determine if the configuration succeeded or failed.
76  Until the configuration completes successfully, EFI IPv4 Protocol driver instances
77  that are attempting to use default configurations must return EFI_NO_MAPPING.
78  Once the configuration is complete, the EFI IPv4 Configuration Protocol driver
79  signals DoneEvent. The configuration may need to be updated in the future.
80  Note that in this case the EFI IPv4 Configuration Protocol driver must signal
81  ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default
82  configurations must return EFI_NO_MAPPING until the configuration policy has
83  been rerun.
84 
85  @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
86  @param DoneEvent Event that will be signaled when the EFI IPv4
87  Protocol driver configuration policy completes
88  execution. This event must be of type EVT_NOTIFY_SIGNAL.
89  @param ReconfigEvent Event that will be signaled when the EFI IPv4
90  Protocol driver configuration needs to be updated.
91  This event must be of type EVT_NOTIFY_SIGNAL.
92 
93  @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
94  driver is now running.
95  @retval EFI_INVALID_PARAMETER One or more of the following parameters is NULL:
96  This
97  DoneEvent
98  ReconfigEvent
99  @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
100  @retval EFI_ALREADY_STARTED The configuration policy for the EFI IPv4 Protocol
101  driver was already started.
102  @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.
103  @retval EFI_UNSUPPORTED This interface does not support the EFI IPv4 Protocol
104  driver configuration.
105 
106 **/
107 typedef
111  IN EFI_EVENT DoneEvent,
112  IN EFI_EVENT ReconfigEvent
113  );
114 
115 /**
116  Stops running the configuration policy for the EFI IPv4 Protocol driver.
117 
118  The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.
119  All configuration data will be lost after calling Stop().
120 
121  @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
122 
123  @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
124  driver has been stopped.
125  @retval EFI_INVALID_PARAMETER This is NULL.
126  @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
127  driver was not started.
128 
129 **/
130 typedef
134  );
135 
136 /**
137  Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.
138 
139  The GetData() function returns the current configuration data for the EFI IPv4
140  Protocol driver after the configuration policy has completed.
141 
142  @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
143  @param IpConfigDataSize On input, the size of the IpConfigData buffer.
144  On output, the count of bytes that were written
145  into the IpConfigData buffer.
146  @param IpConfigData The pointer to the EFI IPv4 Configuration Protocol
147  driver configuration data structure.
148  Type EFI_IP4_IPCONFIG_DATA is defined in
149  "Related Definitions" below.
150 
151  @retval EFI_SUCCESS The EFI IPv4 Protocol driver configuration has been returned.
152  @retval EFI_INVALID_PARAMETER This is NULL.
153  @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
154  driver is not running.
155  @retval EFI_NOT_READY EFI IPv4 Protocol driver configuration is still running.
156  @retval EFI_ABORTED EFI IPv4 Protocol driver configuration could not complete.
157  @retval EFI_BUFFER_TOO_SMALL *IpConfigDataSize is smaller than the configuration
158  data buffer or IpConfigData is NULL.
159 
160 **/
161 typedef
165  IN OUT UINTN *IpConfigDataSize,
166  OUT EFI_IP4_IPCONFIG_DATA *IpConfigData OPTIONAL
167  );
168 
169 ///
170 /// The EFI_IP4_CONFIG_PROTOCOL driver performs platform-dependent and policy-dependent
171 /// configurations for the EFI IPv4 Protocol driver.
172 ///
177 };
178 
180 
181 #endif
182 
183 #endif /* _IPXE_EFI_IP4CONFIG_H */
#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
FILE_LICENCE(BSD2_PATENT)
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
Definition: efi.h:62
EFI_STATUS(EFIAPI * EFI_IP4_CONFIG_START)(IN EFI_IP4_CONFIG_PROTOCOL *This, IN EFI_EVENT DoneEvent, IN EFI_EVENT ReconfigEvent)
Starts running the configuration policy for the EFI IPv4 Protocol driver.
Definition: Ip4Config.h:109
The EFI_IP4_CONFIG_PROTOCOL driver performs platform-dependent and policy-dependent configurations fo...
Definition: Ip4Config.h:173
unsigned int UINT32
Definition: ProcessorBind.h:98
EFI_IP4_ROUTE_TABLE * RouteTable
Default routing table data (stored in network byte order).
Definition: Ip4Config.h:58
EFI_STATUS(EFIAPI * EFI_IP4_CONFIG_STOP)(IN EFI_IP4_CONFIG_PROTOCOL *This)
Stops running the configuration policy for the EFI IPv4 Protocol driver.
Definition: Ip4Config.h:132
#define OUT
Definition: mlx_utils.h:29
This file defines the EFI IPv4 (Internet Protocol version 4) Protocol interface.
EFI_GUID gEfiIp4ConfigProtocolGuid
4-byte buffer.
Definition: Base.h:225
EFI_IP4_CONFIG_GET_DATA GetData
Definition: Ip4Config.h:176
#define EFIAPI
EFI_IP4_CONFIG_STOP Stop
Definition: Ip4Config.h:175
UINT64 UINTN
Unsigned value of native width.
EFI_IPv4_ADDRESS StationAddress
Default station IP address, stored in network byte order.
Definition: Ip4Config.h:45
#define IN
Definition: mlx_utils.h:28
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_IP4_CONFIG_START Start
Definition: Ip4Config.h:174
EFI_STATUS(EFIAPI * EFI_IP4_CONFIG_GET_DATA)(IN EFI_IP4_CONFIG_PROTOCOL *This, IN OUT UINTN *IpConfigDataSize, OUT EFI_IP4_IPCONFIG_DATA *IpConfigData OPTIONAL)
Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.
Definition: Ip4Config.h:163
EFI_IP4_IPCONFIG_DATA contains the minimum IPv4 configuration data that is needed to start basic netw...
Definition: Ip4Config.h:41
EFI_IPv4_ADDRESS SubnetMask
Default subnet mask, stored in network byte order.
Definition: Ip4Config.h:49
UINT32 RouteTableSize
Number of entries in the following RouteTable.
Definition: Ip4Config.h:53