]>
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 | |
9095d37b | 5 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
9095d37b LG |
7 | \r |
8 | @par Revision Reference:\r | |
af2dc6a7 | 9 | This Protocol is introduced in UEFI Specification 2.0.\r |
d1f95000 | 10 | \r |
d1f95000 | 11 | **/\r |
d1f95000 | 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 | |
d120b462 | 25 | (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)\r |
d1f95000 | 26 | \r |
402fa70f | 27 | ///\r |
9095d37b LG |
28 | /// EFI_IP4_IPCONFIG_DATA contains the minimum IPv4 configuration data\r |
29 | /// that is needed to start basic network communication. The StationAddress\r | |
402fa70f | 30 | /// and SubnetMask must be a valid unicast IP address and subnet mask.\r |
9095d37b LG |
31 | /// If RouteTableSize is not zero, then RouteTable contains a properly\r |
32 | /// formatted routing table for the StationAddress/SubnetMask, with the\r | |
402fa70f | 33 | /// last entry in the table being the default route.\r |
34 | ///\r | |
d1f95000 | 35 | typedef struct {\r |
992f22b9 LG |
36 | ///\r |
37 | /// Default station IP address, stored in network byte order.\r | |
38 | ///\r | |
d1f95000 | 39 | EFI_IPv4_ADDRESS StationAddress;\r |
992f22b9 LG |
40 | ///\r |
41 | /// Default subnet mask, stored in network byte order.\r | |
42 | ///\r | |
d1f95000 | 43 | EFI_IPv4_ADDRESS SubnetMask;\r |
992f22b9 LG |
44 | ///\r |
45 | /// Number of entries in the following RouteTable. May be zero.\r | |
46 | ///\r | |
d1f95000 | 47 | UINT32 RouteTableSize;\r |
992f22b9 LG |
48 | ///\r |
49 | /// Default routing table data (stored in network byte order).\r | |
402fa70f | 50 | /// Ignored if RouteTableSize is zero.\r |
992f22b9 LG |
51 | ///\r |
52 | EFI_IP4_ROUTE_TABLE *RouteTable;\r | |
d1f95000 | 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 | |
9095d37b LG |
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 | |
402fa70f | 64 | checking permissions with a site policy server.\r |
9095d37b LG |
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 | |
402fa70f | 70 | determine if the configuration succeeded or failed.\r |
9095d37b | 71 | Until the configuration completes successfully, EFI IPv4 Protocol driver instances\r |
402fa70f | 72 | that are attempting to use default configurations must return EFI_NO_MAPPING.\r |
9095d37b LG |
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 | |
402fa70f | 78 | been rerun.\r |
79 | \r | |
af2dc6a7 | 80 | @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r |
9095d37b LG |
81 | @param DoneEvent Event that will be signaled when the EFI IPv4\r |
82 | Protocol driver configuration policy completes\r | |
402fa70f | 83 | execution. This event must be of type EVT_NOTIFY_SIGNAL.\r |
9095d37b LG |
84 | @param ReconfigEvent Event that will be signaled when the EFI IPv4\r |
85 | Protocol driver configuration needs to be updated.\r | |
402fa70f | 86 | This event must be of type EVT_NOTIFY_SIGNAL.\r |
9095d37b LG |
87 | \r |
88 | @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol\r | |
402fa70f | 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 | |
9095d37b | 95 | @retval EFI_ALREADY_STARTED The configuration policy for the EFI IPv4 Protocol\r |
402fa70f | 96 | driver was already started.\r |
97 | @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.\r | |
9095d37b | 98 | @retval EFI_UNSUPPORTED This interface does not support the EFI IPv4 Protocol\r |
402fa70f | 99 | driver configuration.\r |
d1f95000 | 100 | \r |
101 | **/\r | |
102 | typedef\r | |
103 | EFI_STATUS\r | |
8b13229b | 104 | (EFIAPI *EFI_IP4_CONFIG_START)(\r |
d1f95000 | 105 | IN EFI_IP4_CONFIG_PROTOCOL *This,\r |
106 | IN EFI_EVENT DoneEvent,\r | |
305a1279 | 107 | IN EFI_EVENT ReconfigEvent\r |
ed66e1bc | 108 | );\r |
d1f95000 | 109 | \r |
110 | /**\r | |
111 | Stops running the configuration policy for the EFI IPv4 Protocol driver.\r | |
9095d37b LG |
112 | \r |
113 | The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.\r | |
402fa70f | 114 | All configuration data will be lost after calling Stop().\r |
115 | \r | |
af2dc6a7 | 116 | @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r |
402fa70f | 117 | \r |
9095d37b | 118 | @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol\r |
402fa70f | 119 | driver has been stopped.\r |
120 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
9095d37b | 121 | @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol\r |
402fa70f | 122 | driver was not started.\r |
9095d37b | 123 | \r |
d1f95000 | 124 | **/\r |
125 | typedef\r | |
126 | EFI_STATUS\r | |
8b13229b | 127 | (EFIAPI *EFI_IP4_CONFIG_STOP)(\r |
305a1279 | 128 | IN EFI_IP4_CONFIG_PROTOCOL *This\r |
ed66e1bc | 129 | );\r |
d1f95000 | 130 | \r |
131 | /**\r | |
132 | Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.\r | |
133 | \r | |
9095d37b | 134 | The GetData() function returns the current configuration data for the EFI IPv4\r |
402fa70f | 135 | Protocol driver after the configuration policy has completed.\r |
9095d37b | 136 | \r |
af2dc6a7 | 137 | @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r |
9095d37b LG |
138 | @param IpConfigDataSize On input, the size of the IpConfigData buffer.\r |
139 | On output, the count of bytes that were written\r | |
402fa70f | 140 | into the IpConfigData buffer.\r |
9095d37b LG |
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 | |
402fa70f | 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 | |
9095d37b | 148 | @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol\r |
402fa70f | 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 | |
9095d37b | 152 | @retval EFI_BUFFER_TOO_SMALL *IpConfigDataSize is smaller than the configuration\r |
402fa70f | 153 | data buffer or IpConfigData is NULL.\r |
d1f95000 | 154 | \r |
155 | **/\r | |
156 | typedef\r | |
157 | EFI_STATUS\r | |
8b13229b | 158 | (EFIAPI *EFI_IP4_CONFIG_GET_DATA)(\r |
d1f95000 | 159 | IN EFI_IP4_CONFIG_PROTOCOL *This,\r |
160 | IN OUT UINTN *IpConfigDataSize,\r | |
305a1279 | 161 | OUT EFI_IP4_IPCONFIG_DATA *IpConfigData OPTIONAL\r |
ed66e1bc | 162 | );\r |
d1f95000 | 163 | \r |
44717a39 | 164 | ///\r |
9095d37b LG |
165 | /// The EFI_IP4_CONFIG_PROTOCOL driver performs platform-dependent and policy-dependent\r |
166 | /// configurations for the EFI IPv4 Protocol driver.\r | |
44717a39 | 167 | ///\r |
d1f95000 | 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 |