]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h
MdeModulePkg/Ip4Dxe: Refine the IPv4 configuration help info
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Config2Impl.h
index e74b9ae407440e35739ae90ab8e78c7cbef19fdb..a431f6f732cdc6f0ae1dfc17761e29609041d278 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   Definitions for EFI IPv4 Configuration II Protocol implementation.\r
 \r
 /** @file\r
   Definitions for EFI IPv4 Configuration II Protocol implementation.\r
 \r
-  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<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
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 #define DATA_ATTRIB_SIZE_FIXED              0x1\r
 #define DATA_ATTRIB_VOLATILE                0x2\r
 \r
 #define DATA_ATTRIB_SIZE_FIXED              0x1\r
 #define DATA_ATTRIB_VOLATILE                0x2\r
 \r
-#define DHCP_TAG_PARA_LIST             55\r
-#define DHCP_TAG_NETMASK               1\r
-#define DHCP_TAG_ROUTER                3\r
-\r
-\r
 #define DATA_ATTRIB_SET(Attrib, Bits)       (BOOLEAN)((Attrib) & (Bits))\r
 #define SET_DATA_ATTRIB(Attrib, Bits)       ((Attrib) |= (Bits))\r
 #define DATA_ATTRIB_SET(Attrib, Bits)       (BOOLEAN)((Attrib) & (Bits))\r
 #define SET_DATA_ATTRIB(Attrib, Bits)       ((Attrib) |= (Bits))\r
+#define REMOVE_DATA_ATTRIB(Attrib, Bits)    ((Attrib) &= (~Bits))\r
 \r
 typedef struct _IP4_CONFIG2_INSTANCE IP4_CONFIG2_INSTANCE;\r
 \r
 \r
 typedef struct _IP4_CONFIG2_INSTANCE IP4_CONFIG2_INSTANCE;\r
 \r
@@ -201,15 +198,36 @@ struct _IP4_CONFIG2_INSTANCE {
 \r
 //\r
 // Configure the DHCP to request the routers and netmask\r
 \r
 //\r
 // Configure the DHCP to request the routers and netmask\r
-// from server. The DHCP_TAG_NETMASK is included in Head.\r
+// from server. The DHCP4_TAG_NETMASK is included in Head.\r
 //\r
 #pragma pack(1)\r
 typedef struct {\r
   EFI_DHCP4_PACKET_OPTION Head;\r
   UINT8                   Route;\r
 //\r
 #pragma pack(1)\r
 typedef struct {\r
   EFI_DHCP4_PACKET_OPTION Head;\r
   UINT8                   Route;\r
+  UINT8                   Dns;\r
 } IP4_CONFIG2_DHCP4_OPTION;\r
 #pragma pack()\r
 \r
 } IP4_CONFIG2_DHCP4_OPTION;\r
 #pragma pack()\r
 \r
+/**\r
+  Read the configuration data from variable storage according to the VarName and\r
+  gEfiIp4Config2ProtocolGuid. 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 IP4_CONFIG2_INSTANCE.\r
+\r
+  @param[in]      VarName       The pointer to the variable name\r
+  @param[in, out] Instance      The pointer to the IP4 config2 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
+Ip4Config2ReadConfigData (\r
+  IN     CHAR16               *VarName,\r
+  IN OUT IP4_CONFIG2_INSTANCE *Instance\r
+  );\r
+\r
 /**\r
   Start the DHCP configuration for this IP service instance.\r
   It will locates the EFI_IP4_CONFIG2_PROTOCOL, then start the\r
 /**\r
   Start the DHCP configuration for this IP service instance.\r
   It will locates the EFI_IP4_CONFIG2_PROTOCOL, then start the\r
@@ -217,7 +235,7 @@ typedef struct {
 \r
   @param[in]  Instance           The IP4 config2 instance to configure.\r
 \r
 \r
   @param[in]  Instance           The IP4 config2 instance to configure.\r
 \r
-  @retval EFI_SUCCESS            The auto configuration is successfull started.\r
+  @retval EFI_SUCCESS            The auto configuration is successfully started.\r
   @retval Others                 Failed to start auto configuration.\r
 \r
 **/\r
   @retval Others                 Failed to start auto configuration.\r
 \r
 **/\r
@@ -251,6 +269,20 @@ Ip4Config2CleanInstance (
   IN OUT IP4_CONFIG2_INSTANCE  *Instance\r
   );\r
 \r
   IN OUT IP4_CONFIG2_INSTANCE  *Instance\r
   );\r
 \r
+/**\r
+  Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK.\r
+\r
+  @param Event     The event that is signalled.\r
+  @param Context   The IP4 service binding instance.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+Ip4AutoReconfigCallBack (\r
+  IN EFI_EVENT              Event,\r
+  IN VOID                   *Context\r
+  );\r
+\r
 /**\r
   Destroy the Dhcp4 child in IP4_CONFIG2_INSTANCE and release the resources.\r
 \r
 /**\r
   Destroy the Dhcp4 child in IP4_CONFIG2_INSTANCE and release the resources.\r
 \r