]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/Ip4Config2.h
MdePkg: Add header files for DNS/HTTP/IP4Config2.
[mirror_edk2.git] / MdePkg / Include / Protocol / Ip4Config2.h
diff --git a/MdePkg/Include/Protocol/Ip4Config2.h b/MdePkg/Include/Protocol/Ip4Config2.h
new file mode 100644 (file)
index 0000000..383da8a
--- /dev/null
@@ -0,0 +1,313 @@
+/** @file\r
+  This file provides a definition of the EFI IPv4 Configuration II\r
+  Protocol.\r
+\r
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at<BR>\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+@par Revision Reference:\r
+This Protocol is introduced in UEFI Specification 2.5\r
+\r
+**/\r
+#ifndef __EFI_IP4CONFIG2_PROTOCOL_H__\r
+#define __EFI_IP4CONFIG2_PROTOCOL_H__\r
+\r
+#include <Protocol/Ip4.h>\r
+\r
+#define EFI_IP4_CONFIG2_PROTOCOL_GUID \\r
+  { \\r
+    0x5b446ed1, 0xe30b, 0x4faa, {0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 } \\r
+  }\r
+\r
+typedef struct _EFI_IP4_CONFIG2_PROTOCOL EFI_IP4_CONFIG2_PROTOCOL;\r
+\r
+\r
+///\r
+/// EFI_IP4_CONFIG2_DATA_TYPE\r
+///\r
+typedef enum {\r
+  ///\r
+  /// The interface information of the communication device this EFI \r
+  /// IPv4 Configuration II Protocol instance manages. This type of \r
+  /// data is read only. The corresponding Data is of type \r
+  /// EFI_IP4_CONFIG2_INTERFACE_INFO.\r
+  ///\r
+  Ip4Config2DataTypeInterfaceInfo,\r
+  ///\r
+  /// The general configuration policy for the EFI IPv4 network stack \r
+  /// running on the communication device this EFI IPv4 \r
+  /// Configuration II Protocol instance manages. The policy will \r
+  /// affect other configuration settings. The corresponding Data is of \r
+  /// type EFI_IP4_CONFIG2_POLICY.\r
+  ///\r
+  Ip4Config2DataTypePolicy,\r
+  ///\r
+  /// The station addresses set manually for the EFI IPv4 network \r
+  /// stack. It is only configurable when the policy is \r
+  /// Ip4Config2PolicyStatic. The corresponding Data is of \r
+  /// type EFI_IP4_CONFIG2_MANUAL_ADDRESS.\r
+  ///\r
+  Ip4Config2DataTypeManualAddress,\r
+  ///\r
+  /// The gateway addresses set manually for the EFI IPv4 network \r
+  /// stack running on the communication device this EFI IPv4 \r
+  /// Configuration II Protocol manages. It is not configurable when \r
+  /// the policy is Ip4Config2PolicyDhcp. The gateway \r
+  /// addresses must be unicast IPv4 addresses. The corresponding \r
+  /// Data is a pointer to an array of EFI_IPv4_ADDRESS instances.\r
+  ///\r
+  Ip4Config2DataTypeGateway,\r
+  ///\r
+  /// The DNS server list for the EFI IPv4 network stack running on \r
+  /// the communication device this EFI IPv4 Configuration II \r
+  /// Protocol manages. It is not configurable when the policy is \r
+  /// Ip4Config2PolicyDhcp. The DNS server addresses must be \r
+  /// unicast IPv4 addresses. The corresponding Data is a pointer to \r
+  /// an array of EFI_IPv4_ADDRESS instances.\r
+  ///\r
+  Ip4Config2DataTypeDnsServer,\r
+  Ip4Config2DataTypeMaximum\r
+} EFI_IP4_CONFIG2_DATA_TYPE;\r
+\r
+///\r
+/// EFI_IP4_CONFIG2_INTERFACE_INFO\r
+///\r
+typedef struct {\r
+  ///\r
+  /// The name of the interface. It is a NULL-terminated Unicode string.\r
+  ///\r
+  CHAR16                Name[32];\r
+  ///\r
+  /// The interface type of the network interface. See RFC 1700, \r
+  /// section "Number Hardware Type".\r
+  ///\r
+  UINT8                 IfType;\r
+  ///\r
+  /// The size, in bytes, of the network interface's hardware address.\r
+  ///\r
+  UINT32                HwAddressSize;\r
+  ///\r
+  /// The hardware address for the network interface.\r
+  ///\r
+  EFI_MAC_ADDRESS       HwAddress;\r
+  ///\r
+  /// The station IPv4 address of this EFI IPv4 network stack.\r
+  ///\r
+  EFI_IPv4_ADDRESS      StationAddress;\r
+  ///\r
+  /// The subnet address mask that is associated with the station address.\r
+  ///\r
+  EFI_IPv4_ADDRESS      SubnetMask;\r
+  ///\r
+  /// Size of the following RouteTable, in bytes. May be zero.\r
+  ///\r
+  UINT32                RouteTableSize;\r
+  ///\r
+  /// The route table of the IPv4 network stack runs on this interface. \r
+  /// Set to NULL if RouteTableSize is zero. Type EFI_IP4_ROUTE_TABLE is defined in \r
+  /// EFI_IP4_PROTOCOL.GetModeData().\r
+  ///\r
+  EFI_IP4_ROUTE_TABLE   *RouteTable     OPTIONAL;\r
+} EFI_IP4_CONFIG2_INTERFACE_INFO;\r
+\r
+///\r
+/// EFI_IP4_CONFIG2_POLICY\r
+///\r
+typedef enum {\r
+  ///\r
+  /// Under this policy, the Ip4Config2DataTypeManualAddress, \r
+  /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration \r
+  /// data are required to be set manually. The EFI IPv4 Protocol will get all \r
+  /// required configuration such as IPv4 address, subnet mask and \r
+  /// gateway settings from the EFI IPv4 Configuration II protocol.\r
+  ///\r
+  Ip4Config2PolicyStatic,\r
+  ///\r
+  /// Under this policy, the Ip4Config2DataTypeManualAddress, \r
+  /// Ip4Config2DataTypeGateway and Ip4Config2DataTypeDnsServer configuration data are \r
+  /// not allowed to set via SetData(). All of these configurations are retrieved from DHCP \r
+  /// server or other auto-configuration mechanism.\r
+  ///\r
+  Ip4Config2PolicyDhcp,\r
+  Ip4Config2PolicyMax\r
+} EFI_IP4_CONFIG2_POLICY;\r
+\r
+///\r
+/// EFI_IP4_CONFIG2_MANUAL_ADDRESS\r
+///\r
+typedef struct {\r
+  ///  \r
+  /// The IPv4 unicast address.\r
+  ///\r
+  EFI_IPv4_ADDRESS        Address;\r
+  ///\r
+  /// The subnet mask. \r
+  ///\r
+  EFI_IPv4_ADDRESS        SubnetMask;\r
+} EFI_IP4_CONFIG2_MANUAL_ADDRESS;\r
+\r
+/**\r
+  Set the configuration for the EFI IPv4 network stack running on the communication device this EFI \r
+  IPv4 Configuration II Protocol instance manages.\r
+\r
+  This function is used to set the configuration data of type DataType for the EFI IPv4 network stack \r
+  running on the communication device this EFI IPv4 Configuration II Protocol instance manages.\r
+  The successfully configured data is valid after system reset or power-off.\r
+  The DataSize is used to calculate the count of structure instances in the Data for some \r
+  DataType that multiple structure instances are allowed.\r
+  This function is always non-blocking. When setting some typeof configuration data, an \r
+  asynchronous process is invoked to check the correctness of the data, such as doing address conflict \r
+  detection on the manually set local IPv4 address. EFI_NOT_READY is returned immediately to \r
+  indicate that such an asynchronous process is invoked and the process is not finished yet. The caller \r
+  willing to get the result of the asynchronous process is required to call RegisterDataNotify()\r
+  to register an event on the specified configuration data. Once the event is signaled, the caller can call \r
+  GetData()to get back the configuration data in order to know the result. For other types of \r
+  configuration data that do not require an asynchronous configuration process, the result of the \r
+  operation is immediately returned. \r
+\r
+  @param[in]   This               Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.       \r
+  @param[in]   DataType           The type of data to set.\r
+  @param[in]   DataSize           Size of the buffer pointed to by Data in bytes.\r
+  @param[in]   Data               The data buffer to set. The type ofthe data buffer is associated \r
+                                  with the DataType. \r
+\r
+  @retval EFI_SUCCESS             The specified configuration data for the EFI IPv4 network stack is set \r
+                                  successfully.\r
+  @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:\r
+                                  This is NULL.\r
+                                  Data is NULL.\r
+                                  One or more fields in Data do not match the requirement of the data type \r
+                                  indicated by DataType.\r
+  @retval EFI_WRITE_PROTECTED     The specified configuration data is read-only or the specified configuration \r
+                                  data can not be set under the current policy.\r
+  @retval EFI_ACCESS_DENIED       Another set operation on the specified configuration data is already in process.\r
+  @retval EFI_NOT_READY           An asynchronous process is invoked to set the specified configuration data and \r
+                                  the process is not finished yet.\r
+  @retval EFI_BAD_BUFFER_SIZE     The DataSize does not match the size of the type indicated by DataType.                                 \r
+  @retval EFI_UNSUPPORTED         This DataType is not supported.\r
+  @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.\r
+  @retval EFI_DEVICE_ERROR        An unexpected system error or network error occurred.\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG2_SET_DATA) (\r
+  IN EFI_IP4_CONFIG2_PROTOCOL   *This,\r
+  IN EFI_IP4_CONFIG2_DATA_TYPE  DataType,\r
+  IN UINTN                      DataSize,\r
+  IN VOID                       *Data\r
+  );\r
+\r
+/**\r
+  Get the configuration data for the EFI IPv4 network stack running on the communication device this \r
+  EFI IPv4 Configuration II Protocol instance manages.\r
+\r
+  This function returns the configuration data of type DataType for the EFI IPv4 network stack \r
+  running on the communication device this EFI IPv4 Configuration II Protocol instance manages.\r
+  The caller is responsible for allocating the buffer usedto return the specified configuration data and \r
+  the required size will be returned to the caller if the size of the buffer is too small.\r
+  EFI_NOT_READY is returned if the specified configuration data is not ready due to an already in \r
+  progress asynchronous configuration process. The caller can call RegisterDataNotify() to \r
+  register an event on the specified configuration data. Once the asynchronous configuration process is \r
+  finished, the event will be signaled and a subsequent GetData() call will return the specified \r
+  configuration data.\r
+\r
+  @param[in]   This               Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.       \r
+  @param[in]   DataType           The type of data to get.\r
+  @param[out]  DataSize           On input, in bytes, the size of Data. On output, in bytes, the size \r
+                                  of buffer required to store the specified configuration data. \r
+  @param[in]   Data               The data buffer in which the configuration data is returned. The \r
+                                  type of the data buffer is associated with the DataType. Ignored \r
+                                  if DataSize is 0.  \r
+\r
+  @retval EFI_SUCCESS             The specified configuration data is got successfully.\r
+  @retval EFI_INVALID_PARAMETER   One or more of the followings are TRUE:\r
+                                  This is NULL.\r
+                                  DataSize is NULL.\r
+                                  Data is NULL if *DataSizeis not zero.\r
+  @retval EFI_BUFFER_TOO_SMALL    The size of Data is too small for the specified configuration data \r
+                                  and the required size is returned in DataSize.\r
+  @retval EFI_NOT_READY           The specified configuration data is not ready due to an already in \r
+                                  progress asynchronous configuration process.\r
+  @retval EFI_NOT_FOUND           The specified configuration data is not found.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG2_GET_DATA) (\r
+  IN EFI_IP4_CONFIG2_PROTOCOL     *This,\r
+  IN EFI_IP4_CONFIG2_DATA_TYPE    DataType,\r
+  IN OUT UINTN                    *DataSize,\r
+  IN VOID                         *Data        OPTIONAL\r
+  );\r
+\r
+/**\r
+  Register an event that is to be signaled whenever a configuration process on the specified \r
+  configuration data is done.\r
+\r
+  This function registers an event that is to be signaled whenever a configuration process on the \r
+  specified configuration data is done. An event can be registered for different DataType\r
+  simultaneously and the caller is responsible for determining which type of configuration data causes \r
+  the signaling of the event in such case.\r
+\r
+  @param[in]   This               Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.       \r
+  @param[in]   DataType           The type of data to unregister the event for.\r
+  @param[in]   Event              The event to register.\r
+\r
+  @retval EFI_SUCCESS             The notification event for the specified configuration data is \r
+                                  registered.\r
+  @retval EFI_INVALID_PARAMETER   This is NULL or Event is NULL.\r
+  @retval EFI_UNSUPPORTED         The configuration data type specified by DataType is not supported.\r
+  @retval EFI_OUT_OF_RESOURCES    Required system resources could not be allocated.\r
+  @retval EFI_ACCESS_DENIED       The Event is already registered for the DataType.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG2_REGISTER_NOTIFY) (\r
+  IN EFI_IP4_CONFIG2_PROTOCOL     *This,\r
+  IN EFI_IP4_CONFIG2_DATA_TYPE    DataType,\r
+  IN EFI_EVENT                    Event\r
+  );\r
+\r
+/**\r
+  Remove a previously registered event for the specified configuration data.\r
+\r
+  This function removes a previously registeredevent for the specified configuration data.\r
+\r
+  @param[in]   This               Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.       \r
+  @param[in]   DataType           The type of data to remove the previously registered event for.\r
+  @param[in]   Event              The event to unregister.\r
+\r
+  @retval EFI_SUCCESS             The event registered for the specified configuration data is removed.\r
+  @retval EFI_INVALID_PARAMETER   This is NULL or Event is NULL.\r
+  @retval EFI_NOT_FOUND           The Eventhas not been registered for the specified DataType.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG2_UNREGISTER_NOTIFY) (\r
+  IN EFI_IP4_CONFIG2_PROTOCOL     *This,\r
+  IN EFI_IP4_CONFIG2_DATA_TYPE    DataType,\r
+  IN EFI_EVENT                    Event\r
+  );\r
+\r
+///\r
+/// The EFI_IP4_CONFIG2_PROTOCOL is designed to be the central repository for the common \r
+/// configurations and the administrator configurable settings for the EFI IPv4 network stack.\r
+/// An EFI IPv4 Configuration II Protocol instance will be installed on each communication device that \r
+/// the EFI IPv4 network stack runs on.\r
+///\r
+struct _EFI_IP4_CONFIG2_PROTOCOL {\r
+  EFI_IP4_CONFIG2_SET_DATA           SetData;\r
+  EFI_IP4_CONFIG2_GET_DATA           GetData;\r
+  EFI_IP4_CONFIG2_REGISTER_NOTIFY    RegisterDataNotify;\r
+  EFI_IP4_CONFIG2_UNREGISTER_NOTIFY  UnregisterDataNotify;\r
+};\r
+\r
+extern EFI_GUID gEfiIp4Config2ProtocolGuid;\r
+\r
+#endif\r
+\r