NetworkPkg: Support DNS4/6 GeneralLookUp feature

This patch is used to support DNS4/6 GeneralLookUp feature.

Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19579 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jiaxin Wu
2015-12-30 08:10:55 +00:00
committed by jiaxinwu
parent 38eb83b89a
commit fcae1a9936
3 changed files with 522 additions and 80 deletions

View File

@@ -119,6 +119,7 @@ typedef struct {
UINT32 PacketToLive;
CHAR16 *QueryHostName;
EFI_IPv4_ADDRESS QueryIpAddress;
BOOLEAN GeneralLookUp;
EFI_DNS4_COMPLETION_TOKEN *Token;
} DNS4_TOKEN_ENTRY;
@@ -126,6 +127,7 @@ typedef struct {
UINT32 PacketToLive;
CHAR16 *QueryHostName;
EFI_IPv6_ADDRESS QueryIpAddress;
BOOLEAN GeneralLookUp;
EFI_DNS6_COMPLETION_TOKEN *Token;
} DNS6_TOKEN_ENTRY;
@@ -567,6 +569,24 @@ AddDns6ServerIp (
IN EFI_IPv6_ADDRESS ServerIp
);
/**
Fill QName for IP querying. QName is a domain name represented as
a sequence of labels, where each label consists of a length octet
followed by that number of octets. The domain name terminates with
the zero length octet for the null label of the root.
@param HostName Queried HostName
@retval NULL Failed to fill QName.
@return QName filled successfully.
**/
UINT8 *
EFIAPI
DnsFillinQNameForQueryIp (
IN CHAR16 *HostName
);
/**
Find out whether the response is valid or invalid.
@@ -658,22 +678,24 @@ DoDnsQuery (
);
/**
Construct the Packet to query Ip.
Construct the Packet according query section.
@param Instance The DNS instance
@param HostName Queried HostName
@param Type DNS query Type
@param Packet The packet for querying Ip
@param QueryName Queried Name
@param Type Queried Type
@param Class Queried Class
@param Packet The packet for query
@retval EFI_SUCCESS The packet is constructed.
@retval Others Failed to construct the Packet.
**/
EFI_STATUS
ConstructDNSQueryIp (
ConstructDNSQuery (
IN DNS_INSTANCE *Instance,
IN CHAR16 *HostName,
IN CHAR8 *QueryName,
IN UINT16 Type,
IN UINT16 Class,
OUT NET_BUF **Packet
);