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