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