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