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