MedmodulePkg: Refine codes related to Dhcpv4 and Dhcpv6 configuration.

Add a new head file Dhcp.h in Mde/Include/IndustryStandard, normalize the
universal option numbers and other network number tags.

Cc: Sriram Subramanian <sriram-s@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
Zhang Lubo
2016-06-22 10:25:00 +08:00
committed by Jiaxin Wu
parent 8d648abc32
commit ac6c3d90ed
13 changed files with 182 additions and 333 deletions

View File

@@ -874,7 +874,7 @@ Ip4Config2OnDhcp4Complete (
//
// Look for DNS Server opcode (6).
//
if (OptionList[Index]->OpCode == DHCP_TAG_DNS_SERVER) {
if (OptionList[Index]->OpCode == DHCP4_TAG_DNS_SERVER) {
if (((OptionList[Index]->Length & 0x3) != 0) || (OptionList[Index]->Length == 0)) {
break;
}
@@ -992,11 +992,11 @@ Ip4StartAutoConfig (
// DHCP configuration to avoid problems if some DHCP client
// yields the control of this DHCP service to us.
//
ParaList.Head.OpCode = DHCP_TAG_PARA_LIST;
ParaList.Head.OpCode = DHCP4_TAG_PARA_LIST;
ParaList.Head.Length = 3;
ParaList.Head.Data[0] = DHCP_TAG_NETMASK;
ParaList.Route = DHCP_TAG_ROUTER;
ParaList.Dns = DHCP_TAG_DNS_SERVER;
ParaList.Head.Data[0] = DHCP4_TAG_NETMASK;
ParaList.Route = DHCP4_TAG_ROUTER;
ParaList.Dns = DHCP4_TAG_DNS_SERVER;
OptionList[0] = &ParaList.Head;
Dhcp4Mode.ConfigData.OptionCount = 1;
Dhcp4Mode.ConfigData.OptionList = OptionList;

View File

@@ -25,11 +25,6 @@
#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 DHCP_TAG_DNS_SERVER 6
#define DATA_ATTRIB_SET(Attrib, Bits) (BOOLEAN)((Attrib) & (Bits))
#define SET_DATA_ATTRIB(Attrib, Bits) ((Attrib) |= (Bits))
@@ -202,7 +197,7 @@ 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 {

View File

@@ -1,7 +1,7 @@
/** @file
Ip4 internal functions and type defintions.
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
@@ -28,6 +28,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/HiiConfigRouting.h>
#include <Protocol/HiiConfigAccess.h>
#include <IndustryStandard/Dhcp.h>
#include <Library/DebugLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>