X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FIp4Dxe%2FIp4Config2Impl.h;h=1716dde399ab59ce0aecbeeb455b4be861bef081;hp=e74b9ae407440e35739ae90ab8e78c7cbef19fdb;hb=c0fd7f734e2d33e22215899b40a47b843129541d;hpb=3d0a49ad47619c30c84bbee8a33f54b64dddbcec
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h
index e74b9ae407..1716dde399 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h
@@ -1,15 +1,10 @@
/** @file
Definitions for EFI IPv4 Configuration II Protocol implementation.
- Copyright (c) 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+ (C) Copyright 2015 Hewlett Packard Enterprise Development LP
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -24,13 +19,9 @@
#define DATA_ATTRIB_SIZE_FIXED 0x1
#define DATA_ATTRIB_VOLATILE 0x2
-#define DHCP_TAG_PARA_LIST 55
-#define DHCP_TAG_NETMASK 1
-#define DHCP_TAG_ROUTER 3
-
-
#define DATA_ATTRIB_SET(Attrib, Bits) (BOOLEAN)((Attrib) & (Bits))
#define SET_DATA_ATTRIB(Attrib, Bits) ((Attrib) |= (Bits))
+#define REMOVE_DATA_ATTRIB(Attrib, Bits) ((Attrib) &= (~Bits))
typedef struct _IP4_CONFIG2_INSTANCE IP4_CONFIG2_INSTANCE;
@@ -73,7 +64,7 @@ typedef struct _IP4_CONFIG2_INSTANCE IP4_CONFIG2_INSTANCE;
8 bytes.
@retval EFI_SUCCESS The specified configuration data for the EFI IPv4
network stack was set successfully.
-
+
**/
typedef
EFI_STATUS
@@ -90,14 +81,14 @@ EFI_STATUS
@param[in, out] DataSize On input, in bytes, the size of Data. On output, in
bytes, the size of buffer required to store the specified
configuration data.
- @param[in] Data The data buffer in which the configuration data is returned.
+ @param[in] Data The data buffer in which the configuration data is returned.
Ignored if DataSize is ZERO.
@retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified
- configuration data, and the required size is
+ configuration data, and the required size is
returned in DataSize.
- @retval EFI_SUCCESS The specified configuration data was obtained successfully.
-
+ @retval EFI_SUCCESS The specified configuration data was obtained successfully.
+
**/
typedef
EFI_STATUS
@@ -154,7 +145,7 @@ typedef struct {
#pragma pack()
typedef struct {
- EFI_IP4_CONFIG2_POLICY Policy; ///< manual or automatic
+ EFI_IP4_CONFIG2_POLICY Policy; ///< manual or automatic
EFI_IP4_CONFIG2_MANUAL_ADDRESS *ManualAddress; ///< IP addresses
UINT32 ManualAddressCount; ///< IP addresses count
EFI_IPv4_ADDRESS *GatewayAddress; ///< Gateway address
@@ -180,7 +171,7 @@ struct _IP4_CONFIG2_INSTANCE {
EFI_IP4_CONFIG2_PROTOCOL Ip4Config2;
EFI_IP4_CONFIG2_INTERFACE_INFO InterfaceInfo;
- EFI_IP4_CONFIG2_POLICY Policy;
+ EFI_IP4_CONFIG2_POLICY Policy;
IP4_CONFIG2_DATA_ITEM DataItem[Ip4Config2DataTypeMaximum];
EFI_EVENT Dhcp4SbNotifyEvent;
@@ -193,7 +184,7 @@ struct _IP4_CONFIG2_INSTANCE {
UINT32 FailedIaAddressCount;
EFI_IPv4_ADDRESS *DeclineAddress;
UINT32 DeclineAddressCount;
-
+
IP4_FORM_CALLBACK_INFO CallbackInfo;
IP4_CONFIG2_NVDATA Ip4NvData;
@@ -201,15 +192,36 @@ struct _IP4_CONFIG2_INSTANCE {
//
// Configure the DHCP to request the routers and netmask
-// from server. The DHCP_TAG_NETMASK is included in Head.
+// from server. The DHCP4_TAG_NETMASK is included in Head.
//
#pragma pack(1)
typedef struct {
EFI_DHCP4_PACKET_OPTION Head;
UINT8 Route;
+ UINT8 Dns;
} IP4_CONFIG2_DHCP4_OPTION;
#pragma pack()
+/**
+ Read the configuration data from variable storage according to the VarName and
+ gEfiIp4Config2ProtocolGuid. It checks the integrity of variable data. If the
+ data is corrupted, it clears the variable data to ZERO. Othewise, it outputs the
+ configuration data to IP4_CONFIG2_INSTANCE.
+
+ @param[in] VarName The pointer to the variable name
+ @param[in, out] Instance The pointer to the IP4 config2 instance data.
+
+ @retval EFI_NOT_FOUND The variable can not be found or already corrupted.
+ @retval EFI_OUT_OF_RESOURCES Fail to allocate resource to complete the operation.
+ @retval EFI_SUCCESS The configuration data was retrieved successfully.
+
+**/
+EFI_STATUS
+Ip4Config2ReadConfigData (
+ IN CHAR16 *VarName,
+ IN OUT IP4_CONFIG2_INSTANCE *Instance
+ );
+
/**
Start the DHCP configuration for this IP service instance.
It will locates the EFI_IP4_CONFIG2_PROTOCOL, then start the
@@ -217,7 +229,7 @@ typedef struct {
@param[in] Instance The IP4 config2 instance to configure.
- @retval EFI_SUCCESS The auto configuration is successfull started.
+ @retval EFI_SUCCESS The auto configuration is successfully started.
@retval Others Failed to start auto configuration.
**/
@@ -251,6 +263,20 @@ Ip4Config2CleanInstance (
IN OUT IP4_CONFIG2_INSTANCE *Instance
);
+/**
+ Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK.
+
+ @param Event The event that is signalled.
+ @param Context The IP4 service binding instance.
+
+**/
+VOID
+EFIAPI
+Ip4AutoReconfigCallBack (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ );
+
/**
Destroy the Dhcp4 child in IP4_CONFIG2_INSTANCE and release the resources.