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