summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/DnsDxe
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2016-01-22 01:40:56 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2016-02-18 13:07:59 +0800
commit3700da73846e10853ed95010d7ad2f0b9135439f (patch)
tree1b62f3fc17889fe6128e75171c267b3740d4c2b2 /NetworkPkg/DnsDxe
parentdba6e9a935dc6728f1f29af103dab3dbcb695167 (diff)
downloadedk2-3700da73846e10853ed95010d7ad2f0b9135439f.tar.gz
edk2-3700da73846e10853ed95010d7ad2f0b9135439f.tar.bz2
edk2-3700da73846e10853ed95010d7ad2f0b9135439f.zip
NetworkPkg: Replace the internal function with exposed one
This patch is used to replace the internal function with the exposed one defined in NetLib.h. Cc: Hegde Nagaraj P <nagaraj-p.hegde@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: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Diffstat (limited to 'NetworkPkg/DnsDxe')
-rw-r--r--NetworkPkg/DnsDxe/DnsImpl.c63
-rw-r--r--NetworkPkg/DnsDxe/DnsImpl.h19
-rw-r--r--NetworkPkg/DnsDxe/DnsProtocol.c4
3 files changed, 8 insertions, 78 deletions
diff --git a/NetworkPkg/DnsDxe/DnsImpl.c b/NetworkPkg/DnsDxe/DnsImpl.c
index 617e623286..19184415e5 100644
--- a/NetworkPkg/DnsDxe/DnsImpl.c
+++ b/NetworkPkg/DnsDxe/DnsImpl.c
@@ -1038,61 +1038,6 @@ AddDns6ServerIp (
}
/**
- 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. Caller should
- take responsibility to the buffer in QName.
-
- @param HostName Queried HostName
-
- @retval NULL Failed to fill QName.
- @return QName filled successfully.
-
-**/
-CHAR8 *
-EFIAPI
-DnsFillinQNameForQueryIp (
- IN CHAR16 *HostName
- )
-{
- CHAR8 *QueryName;
- CHAR8 *Header;
- CHAR8 *Tail;
- UINTN Len;
- UINTN Index;
-
- QueryName = NULL;
- Header = NULL;
- Tail = NULL;
-
- QueryName = AllocateZeroPool (DNS_DEFAULT_BLKSIZE);
- if (QueryName == NULL) {
- return NULL;
- }
-
- Header = QueryName;
- Tail = Header + 1;
- Len = 0;
- for (Index = 0; HostName[Index] != 0; Index++) {
- *Tail = (CHAR8) HostName[Index];
- if (*Tail == '.') {
- *Header = (CHAR8) Len;
- Header = Tail;
- Tail ++;
- Len = 0;
- } else {
- Tail++;
- Len++;
- }
- }
- *Header = (CHAR8) Len;
- *Tail = 0;
-
- return QueryName;
-}
-
-/**
Find out whether the response is valid or invalid.
@param TokensMap All DNS transmittal Tokens entry.
@@ -1806,8 +1751,12 @@ ConstructDNSQuery (
NET_FRAGMENT Frag;
DNS_HEADER *DnsHeader;
DNS_QUERY_SECTION *DnsQuery;
-
- Frag.Bulk = AllocatePool (DNS_DEFAULT_BLKSIZE * sizeof (UINT8));
+
+ //
+ // Messages carried by UDP are restricted to 512 bytes (not counting the IP
+ // or UDP headers).
+ //
+ Frag.Bulk = AllocatePool (DNS_MAX_MESSAGE_SIZE * sizeof (UINT8));
if (Frag.Bulk == NULL) {
return EFI_OUT_OF_RESOURCES;
}
diff --git a/NetworkPkg/DnsDxe/DnsImpl.h b/NetworkPkg/DnsDxe/DnsImpl.h
index 8cd73e73a6..0ef8255e05 100644
--- a/NetworkPkg/DnsDxe/DnsImpl.h
+++ b/NetworkPkg/DnsDxe/DnsImpl.h
@@ -87,7 +87,6 @@ extern EFI_DNS6_PROTOCOL mDns6Protocol;
#define DNS_DEFAULT_TIMEOUT 2
#define DNS_DEFAULT_RETRY 3
-#define DNS_DEFAULT_BLKSIZE 512
#define DNS_TIME_TO_GETMAP 5
@@ -557,24 +556,6 @@ AddDns6ServerIp (
);
/**
- 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.
-
-**/
-CHAR8 *
-EFIAPI
-DnsFillinQNameForQueryIp (
- IN CHAR16 *HostName
- );
-
-/**
Find out whether the response is valid or invalid.
@param TokensMap All DNS transmittal Tokens entry.
diff --git a/NetworkPkg/DnsDxe/DnsProtocol.c b/NetworkPkg/DnsDxe/DnsProtocol.c
index f572b8b722..11009fdc0d 100644
--- a/NetworkPkg/DnsDxe/DnsProtocol.c
+++ b/NetworkPkg/DnsDxe/DnsProtocol.c
@@ -454,7 +454,7 @@ Dns4HostNameToIp (
//
// Construct QName.
//
- QueryName = DnsFillinQNameForQueryIp (TokenEntry->QueryHostName);
+ QueryName = NetLibCreateDnsQName (TokenEntry->QueryHostName);
if (QueryName == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
@@ -1264,7 +1264,7 @@ Dns6HostNameToIp (
//
// Construct QName.
//
- QueryName = DnsFillinQNameForQueryIp (TokenEntry->QueryHostName);
+ QueryName = NetLibCreateDnsQName (TokenEntry->QueryHostName);
if (QueryName == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;