]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Ip4Config.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Protocol / Ip4Config.h
CommitLineData
d1f95000 1/** @file\r
c311f86b 2 This file provides a definition of the EFI IPv4 Configuration\r
3 Protocol.\r
4\r
9095d37b 5Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 6SPDX-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
2f88bd3a 12\r
d1f95000 13#ifndef __EFI_IP4CONFIG_PROTOCOL_H__\r
14#define __EFI_IP4CONFIG_PROTOCOL_H__\r
15\r
16#include <Protocol/Ip4.h>\r
17\r
18#define EFI_IP4_CONFIG_PROTOCOL_GUID \\r
19 { \\r
20 0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } \\r
21 }\r
22\r
23typedef struct _EFI_IP4_CONFIG_PROTOCOL EFI_IP4_CONFIG_PROTOCOL;\r
24\r
25#define IP4_CONFIG_VARIABLE_ATTRIBUTES \\r
d120b462 26 (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)\r
d1f95000 27\r
402fa70f 28///\r
9095d37b
LG
29/// EFI_IP4_IPCONFIG_DATA contains the minimum IPv4 configuration data\r
30/// that is needed to start basic network communication. The StationAddress\r
402fa70f 31/// and SubnetMask must be a valid unicast IP address and subnet mask.\r
9095d37b
LG
32/// If RouteTableSize is not zero, then RouteTable contains a properly\r
33/// formatted routing table for the StationAddress/SubnetMask, with the\r
402fa70f 34/// last entry in the table being the default route.\r
35///\r
d1f95000 36typedef struct {\r
992f22b9
LG
37 ///\r
38 /// Default station IP address, stored in network byte order.\r
39 ///\r
2f88bd3a 40 EFI_IPv4_ADDRESS StationAddress;\r
992f22b9
LG
41 ///\r
42 /// Default subnet mask, stored in network byte order.\r
43 ///\r
2f88bd3a 44 EFI_IPv4_ADDRESS SubnetMask;\r
992f22b9
LG
45 ///\r
46 /// Number of entries in the following RouteTable. May be zero.\r
47 ///\r
2f88bd3a 48 UINT32 RouteTableSize;\r
992f22b9
LG
49 ///\r
50 /// Default routing table data (stored in network byte order).\r
402fa70f 51 /// Ignored if RouteTableSize is zero.\r
992f22b9 52 ///\r
2f88bd3a 53 EFI_IP4_ROUTE_TABLE *RouteTable;\r
d1f95000 54} EFI_IP4_IPCONFIG_DATA;\r
55\r
d1f95000 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
102typedef\r
103EFI_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
125typedef\r
126EFI_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
156typedef\r
157EFI_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 168struct _EFI_IP4_CONFIG_PROTOCOL {\r
2f88bd3a
MK
169 EFI_IP4_CONFIG_START Start;\r
170 EFI_IP4_CONFIG_STOP Stop;\r
171 EFI_IP4_CONFIG_GET_DATA GetData;\r
d1f95000 172};\r
173\r
2f88bd3a 174extern EFI_GUID gEfiIp4ConfigProtocolGuid;\r
d1f95000 175\r
176#endif\r