]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Ip6Dxe/Ip6ConfigImpl.h
BaseTools: Refactor hash tracking after checking for Sources section
[mirror_edk2.git] / NetworkPkg / Ip6Dxe / Ip6ConfigImpl.h
index ccb09ccc77036c8f0c7cc8508cea8320d89a305d..bfe3bbe5387557e3e688c21f0eb5674d37daadd4 100644 (file)
@@ -1,15 +1,9 @@
 /** @file\r
   Definitions for EFI IPv6 Configuartion Protocol implementation.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \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\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
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -21,8 +15,6 @@
 #define IP6_CONFIG_VARIABLE_ATTRIBUTE    (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS)\r
 \r
 #define IP6_CONFIG_DEFAULT_DAD_XMITS        1\r
-#define IP6_CONFIG_DHCP6_OPTION_ORO         6\r
-#define IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS 23\r
 \r
 #define DATA_ATTRIB_SIZE_FIXED              0x1\r
 #define DATA_ATTRIB_VOLATILE                0x2\r
@@ -72,7 +64,7 @@ typedef struct _IP6_CONFIG_INSTANCE IP6_CONFIG_INSTANCE;
                                8 bytes.\r
   @retval EFI_SUCCESS          The specified configuration data for the EFI IPv6\r
                                network stack was set successfully.\r
-  \r
+\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -89,14 +81,14 @@ EFI_STATUS
   @param[in, out] DataSize On input, in bytes, the size of Data. On output, in\r
                            bytes, the size of buffer required to store the specified\r
                            configuration data.\r
-  @param[in]      Data     The data buffer in which the configuration data is returned.  \r
+  @param[in]      Data     The data buffer in which the configuration data is returned.\r
                            Ignored if DataSize is ZERO.\r
 \r
   @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified\r
-                               configuration data, and the required size is \r
+                               configuration data, and the required size is\r
                                returned in DataSize.\r
-  @retval EFI_SUCCESS          The specified configuration data was obtained successfully.                               \r
-  \r
+  @retval EFI_SUCCESS          The specified configuration data was obtained successfully.\r
+\r
 **/\r
 typedef\r
 EFI_STATUS\r
@@ -129,7 +121,7 @@ typedef struct {
 \r
 typedef struct {\r
   UINT16                    Offset;\r
-  UINT                    DataSize;\r
+  UINT32                    DataSize;\r
   EFI_IP6_CONFIG_DATA_TYPE  DataType;\r
 } IP6_CONFIG_DATA_RECORD;\r
 \r
@@ -164,9 +156,9 @@ typedef struct {
 } IP6_ADDRESS_INFO_ENTRY;\r
 \r
 typedef struct {\r
-  EFI_IP6_CONFIG_POLICY                    Policy;              ///< manual or automatic  \r
+  EFI_IP6_CONFIG_POLICY                    Policy;              ///< manual or automatic\r
   EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS DadTransmitCount;    ///< dad transmits count\r
-  EFI_IP6_CONFIG_INTERFACE_ID              InterfaceId;         ///< alternative interface id \r
+  EFI_IP6_CONFIG_INTERFACE_ID              InterfaceId;         ///< alternative interface id\r
   LIST_ENTRY                               ManualAddress;       ///< IP addresses\r
   UINT32                                   ManualAddressCount;  ///< IP addresses count\r
   LIST_ENTRY                               GatewayAddress;      ///< Gateway address\r
@@ -215,16 +207,36 @@ struct _IP6_CONFIG_INSTANCE {
   IP6_CONFIG_NVDATA                         Ip6NvData;\r
 };\r
 \r
+/**\r
+  Read the configuration data from variable storage according to the VarName and\r
+  gEfiIp6ConfigProtocolGuid. It checks the integrity of variable data. If the\r
+  data is corrupted, it clears the variable data to ZERO. Othewise, it outputs the\r
+  configuration data to IP6_CONFIG_INSTANCE.\r
+\r
+  @param[in]      VarName  The pointer to the variable name\r
+  @param[in, out] Instance The pointer to the IP6 config instance data.\r
+\r
+  @retval EFI_NOT_FOUND         The variable can not be found or already corrupted.\r
+  @retval EFI_OUT_OF_RESOURCES  Fail to allocate resource to complete the operation.\r
+  @retval EFI_SUCCESS           The configuration data was retrieved successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+Ip6ConfigReadConfigData (\r
+  IN     CHAR16               *VarName,\r
+  IN OUT IP6_CONFIG_INSTANCE  *Instance\r
+  );\r
+\r
 /**\r
   The event process routine when the DHCPv6 server is answered with a reply packet\r
   for an information request.\r
-  \r
+\r
   @param[in]     This          Points to the EFI_DHCP6_PROTOCOL.\r
   @param[in]     Context       The pointer to the IP6 configuration instance data.\r
   @param[in]     Packet        The DHCPv6 reply packet.\r
 \r
   @retval EFI_SUCCESS      The DNS server address was retrieved from the reply packet.\r
-  @retval EFI_NOT_READY    The reply packet does not contain the DNS server option, or \r
+  @retval EFI_NOT_READY    The reply packet does not contain the DNS server option, or\r
                            the DNS server address is not valid.\r
 \r
 **/\r
@@ -238,7 +250,7 @@ Ip6ConfigOnDhcp6Reply (
 \r
 /**\r
   The work function to trigger the DHCPv6 process to perform a stateful autoconfiguration.\r
-  \r
+\r
   @param[in]     Instance      Pointer to the IP6 config instance data.\r
   @param[in]     OtherInfoOnly If FALSE, get stateful address and other information\r
                                via DHCPv6. Otherwise, only get the other information.\r
@@ -257,10 +269,10 @@ Ip6ConfigStartStatefulAutoConfig (
   Initialize an IP6_CONFIG_INSTANCE.\r
 \r
   @param[out]    Instance       The buffer of IP6_CONFIG_INSTANCE to be initialized.\r
-  \r
+\r
   @retval EFI_OUT_OF_RESOURCES  Failed to allocate resources to complete the operation.\r
   @retval EFI_SUCCESS           The IP6_CONFIG_INSTANCE initialized successfully.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 Ip6ConfigInitInstance (\r
@@ -271,7 +283,7 @@ Ip6ConfigInitInstance (
   Release an IP6_CONFIG_INSTANCE.\r
 \r
   @param[in, out] Instance    The buffer of IP6_CONFIG_INSTANCE to be freed.\r
-  \r
+\r
 **/\r
 VOID\r
 Ip6ConfigCleanInstance (\r
@@ -285,7 +297,7 @@ Ip6ConfigCleanInstance (
 \r
   @retval EFI_SUCCESS         The child was successfully destroyed.\r
   @retval Others              Failed to destroy the child.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 Ip6ConfigDestroyDhcp6 (\r