1 | /** @file
|
---|
2 | This file provides a definition of the EFI IPv4 Configuration
|
---|
3 | Protocol.
|
---|
4 |
|
---|
5 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
---|
6 | This program and the accompanying materials are licensed and made available under
|
---|
7 | the terms and conditions of the BSD License that accompanies this distribution.
|
---|
8 | The full text of the license may be found at
|
---|
9 | http://opensource.org/licenses/bsd-license.php.
|
---|
10 |
|
---|
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
---|
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
---|
13 |
|
---|
14 | @par Revision Reference:
|
---|
15 | This Protocol is introduced in UEFI Specification 2.0.
|
---|
16 |
|
---|
17 | **/
|
---|
18 | #ifndef __EFI_IP4CONFIG_PROTOCOL_H__
|
---|
19 | #define __EFI_IP4CONFIG_PROTOCOL_H__
|
---|
20 |
|
---|
21 | #include <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 |
|
---|
28 | typedef struct _EFI_IP4_CONFIG_PROTOCOL EFI_IP4_CONFIG_PROTOCOL;
|
---|
29 |
|
---|
30 | #define IP4_CONFIG_VARIABLE_ATTRIBUTES \
|
---|
31 | (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | \
|
---|
32 | EFI_VARIABLE_RUNTIME_ACCESS)
|
---|
33 |
|
---|
34 | ///
|
---|
35 | /// EFI_IP4_IPCONFIG_DATA contains the minimum IPv4 configuration data
|
---|
36 | /// that is needed to start basic network communication. The StationAddress
|
---|
37 | /// and SubnetMask must be a valid unicast IP address and subnet mask.
|
---|
38 | /// If RouteTableSize is not zero, then RouteTable contains a properly
|
---|
39 | /// formatted routing table for the StationAddress/SubnetMask, with the
|
---|
40 | /// last entry in the table being the default route.
|
---|
41 | ///
|
---|
42 | typedef struct {
|
---|
43 | ///
|
---|
44 | /// Default station IP address, stored in network byte order.
|
---|
45 | ///
|
---|
46 | EFI_IPv4_ADDRESS StationAddress;
|
---|
47 | ///
|
---|
48 | /// Default subnet mask, stored in network byte order.
|
---|
49 | ///
|
---|
50 | EFI_IPv4_ADDRESS SubnetMask;
|
---|
51 | ///
|
---|
52 | /// Number of entries in the following RouteTable. May be zero.
|
---|
53 | ///
|
---|
54 | UINT32 RouteTableSize;
|
---|
55 | ///
|
---|
56 | /// Default routing table data (stored in network byte order).
|
---|
57 | /// Ignored if RouteTableSize is zero.
|
---|
58 | ///
|
---|
59 | EFI_IP4_ROUTE_TABLE *RouteTable;
|
---|
60 | } EFI_IP4_IPCONFIG_DATA;
|
---|
61 |
|
---|
62 |
|
---|
63 | /**
|
---|
64 | Starts running the configuration policy for the EFI IPv4 Protocol driver.
|
---|
65 |
|
---|
66 | The Start() function is called to determine and to begin the platform
|
---|
67 | configuration policy by the EFI IPv4 Protocol driver. This determination may
|
---|
68 | be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol
|
---|
69 | driver configuration policy. It may be as involved as loading some defaults
|
---|
70 | from nonvolatile storage, downloading dynamic data from a DHCP server, and
|
---|
71 | checking permissions with a site policy server.
|
---|
72 | Starting the configuration policy is just the beginning. It may finish almost
|
---|
73 | instantly or it may take several minutes before it fails to retrieve configuration
|
---|
74 | information from one or more servers. Once the policy is started, drivers
|
---|
75 | should use the DoneEvent parameter to determine when the configuration policy
|
---|
76 | has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to
|
---|
77 | determine if the configuration succeeded or failed.
|
---|
78 | Until the configuration completes successfully, EFI IPv4 Protocol driver instances
|
---|
79 | that are attempting to use default configurations must return EFI_NO_MAPPING.
|
---|
80 | Once the configuration is complete, the EFI IPv4 Configuration Protocol driver
|
---|
81 | signals DoneEvent. The configuration may need to be updated in the future.
|
---|
82 | Note that in this case the EFI IPv4 Configuration Protocol driver must signal
|
---|
83 | ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default
|
---|
84 | configurations must return EFI_NO_MAPPING until the configuration policy has
|
---|
85 | been rerun.
|
---|
86 |
|
---|
87 | @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
|
---|
88 | @param DoneEvent Event that will be signaled when the EFI IPv4
|
---|
89 | Protocol driver configuration policy completes
|
---|
90 | execution. This event must be of type EVT_NOTIFY_SIGNAL.
|
---|
91 | @param ReconfigEvent Event that will be signaled when the EFI IPv4
|
---|
92 | Protocol driver configuration needs to be updated.
|
---|
93 | This event must be of type EVT_NOTIFY_SIGNAL.
|
---|
94 |
|
---|
95 | @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
|
---|
96 | driver is now running.
|
---|
97 | @retval EFI_INVALID_PARAMETER One or more of the following parameters is NULL:
|
---|
98 | This
|
---|
99 | DoneEvent
|
---|
100 | ReconfigEvent
|
---|
101 | @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
|
---|
102 | @retval EFI_ALREADY_STARTED The configuration policy for the EFI IPv4 Protocol
|
---|
103 | driver was already started.
|
---|
104 | @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.
|
---|
105 | @retval EFI_UNSUPPORTED This interface does not support the EFI IPv4 Protocol
|
---|
106 | driver configuration.
|
---|
107 |
|
---|
108 | **/
|
---|
109 | typedef
|
---|
110 | EFI_STATUS
|
---|
111 | (EFIAPI *EFI_IP4_CONFIG_START)(
|
---|
112 | IN EFI_IP4_CONFIG_PROTOCOL *This,
|
---|
113 | IN EFI_EVENT DoneEvent,
|
---|
114 | IN EFI_EVENT ReconfigEvent
|
---|
115 | );
|
---|
116 |
|
---|
117 | /**
|
---|
118 | Stops running the configuration policy for the EFI IPv4 Protocol driver.
|
---|
119 |
|
---|
120 | The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.
|
---|
121 | All configuration data will be lost after calling Stop().
|
---|
122 |
|
---|
123 | @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
|
---|
124 |
|
---|
125 | @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol
|
---|
126 | driver has been stopped.
|
---|
127 | @retval EFI_INVALID_PARAMETER This is NULL.
|
---|
128 | @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
|
---|
129 | driver was not started.
|
---|
130 |
|
---|
131 | **/
|
---|
132 | typedef
|
---|
133 | EFI_STATUS
|
---|
134 | (EFIAPI *EFI_IP4_CONFIG_STOP)(
|
---|
135 | IN EFI_IP4_CONFIG_PROTOCOL *This
|
---|
136 | );
|
---|
137 |
|
---|
138 | /**
|
---|
139 | Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.
|
---|
140 |
|
---|
141 | The GetData() function returns the current configuration data for the EFI IPv4
|
---|
142 | Protocol driver after the configuration policy has completed.
|
---|
143 |
|
---|
144 | @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
|
---|
145 | @param IpConfigDataSize On input, the size of the IpConfigData buffer.
|
---|
146 | On output, the count of bytes that were written
|
---|
147 | into the IpConfigData buffer.
|
---|
148 | @param IpConfigData The pointer to the EFI IPv4 Configuration Protocol
|
---|
149 | driver configuration data structure.
|
---|
150 | Type EFI_IP4_IPCONFIG_DATA is defined in
|
---|
151 | "Related Definitions" below.
|
---|
152 |
|
---|
153 | @retval EFI_SUCCESS The EFI IPv4 Protocol driver configuration has been returned.
|
---|
154 | @retval EFI_INVALID_PARAMETER This is NULL.
|
---|
155 | @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol
|
---|
156 | driver is not running.
|
---|
157 | @retval EFI_NOT_READY EFI IPv4 Protocol driver configuration is still running.
|
---|
158 | @retval EFI_ABORTED EFI IPv4 Protocol driver configuration could not complete.
|
---|
159 | @retval EFI_BUFFER_TOO_SMALL *IpConfigDataSize is smaller than the configuration
|
---|
160 | data buffer or IpConfigData is NULL.
|
---|
161 |
|
---|
162 | **/
|
---|
163 | typedef
|
---|
164 | EFI_STATUS
|
---|
165 | (EFIAPI *EFI_IP4_CONFIG_GET_DATA)(
|
---|
166 | IN EFI_IP4_CONFIG_PROTOCOL *This,
|
---|
167 | IN OUT UINTN *IpConfigDataSize,
|
---|
168 | OUT EFI_IP4_IPCONFIG_DATA *IpConfigData OPTIONAL
|
---|
169 | );
|
---|
170 |
|
---|
171 | ///
|
---|
172 | /// The EFI_IP4_CONFIG_PROTOCOL driver performs platform-dependent and policy-dependent
|
---|
173 | /// configurations for the EFI IPv4 Protocol driver.
|
---|
174 | ///
|
---|
175 | struct _EFI_IP4_CONFIG_PROTOCOL {
|
---|
176 | EFI_IP4_CONFIG_START Start;
|
---|
177 | EFI_IP4_CONFIG_STOP Stop;
|
---|
178 | EFI_IP4_CONFIG_GET_DATA GetData;
|
---|
179 | };
|
---|
180 |
|
---|
181 | extern EFI_GUID gEfiIp4ConfigProtocolGuid;
|
---|
182 |
|
---|
183 | #endif
|
---|