X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=NetworkPkg%2FDnsDxe%2FDnsProtocol.c;h=b8d074998242c82f6e9fc1ce03aedb85a155aac7;hp=1fcaabdf95e570cab7b46ac56d1fdc950c3281fe;hb=f75a7f568e6d0944327970b3f3f2dafd9bba76b1;hpb=9095d37b8fe5bfc3d02adad6ba7fd7359ebc0107 diff --git a/NetworkPkg/DnsDxe/DnsProtocol.c b/NetworkPkg/DnsDxe/DnsProtocol.c index 1fcaabdf95..b8d0749982 100644 --- a/NetworkPkg/DnsDxe/DnsProtocol.c +++ b/NetworkPkg/DnsDxe/DnsProtocol.c @@ -1,7 +1,7 @@ /** @file Implementation of EFI_DNS4_PROTOCOL and EFI_DNS6_PROTOCOL interfaces. -Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
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 @@ -59,14 +59,14 @@ Dns4GetModeData ( ) { DNS_INSTANCE *Instance; - + EFI_TPL OldTpl; UINTN Index; - + LIST_ENTRY *Entry; LIST_ENTRY *Next; - + DNS4_SERVER_IP *ServerItem; EFI_IPv4_ADDRESS *ServerList; DNS4_CACHE *CacheItem; @@ -78,24 +78,24 @@ Dns4GetModeData ( CacheItem = NULL; CacheList = NULL; Status = EFI_SUCCESS; - - + + if ((This == NULL) || (DnsModeData == NULL)) { return EFI_INVALID_PARAMETER; } OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - + Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This); if (Instance->State == DNS_STATE_UNCONFIGED) { Status = EFI_NOT_STARTED; goto ON_EXIT; } - + ZeroMem (DnsModeData, sizeof (EFI_DNS4_MODE_DATA)); // - // Get the current configuration data of this instance. + // Get the current configuration data of this instance. // Status = Dns4CopyConfigure (&DnsModeData->DnsConfigData, &Instance->Dns4CfgData); if (EFI_ERROR (Status)) { @@ -116,7 +116,7 @@ Dns4GetModeData ( Dns4CleanConfigure (&DnsModeData->DnsConfigData); goto ON_EXIT; } - + Index = 0; NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns4ServerList) { ServerItem = NET_LIST_USER_STRUCT (Entry, DNS4_SERVER_IP, AllServerLink); @@ -140,7 +140,7 @@ Dns4GetModeData ( FreePool (ServerList); goto ON_EXIT; } - + Index =0; NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns4CacheList) { CacheItem = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink); @@ -165,7 +165,7 @@ ON_EXIT: @retval EFI_SUCCESS The operation completed successfully. @retval EFI_UNSUPPORTED The designated protocol is not supported. @retval EFI_INVALID_PARAMTER Thisis NULL. - The StationIp address provided in DnsConfigData is not a + The StationIp address provided in DnsConfigData is not a valid unicast. DnsServerList is NULL while DnsServerListCount is not ZERO. @@ -175,8 +175,8 @@ ON_EXIT: allocated. @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI DNSv4 Protocol instance is not configured. - @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To - reconfigure the instance the caller must call Configure() + @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To + reconfigure the instance the caller must call Configure() with NULL first to return driver to unconfigured state. **/ EFI_STATUS @@ -188,19 +188,19 @@ Dns4Configure ( { EFI_STATUS Status; DNS_INSTANCE *Instance; - + EFI_TPL OldTpl; IP4_ADDR Ip; IP4_ADDR Netmask; UINT32 ServerListCount; - EFI_IPv4_ADDRESS *ServerList; + EFI_IPv4_ADDRESS *ServerList; Status = EFI_SUCCESS; ServerList = NULL; - - if (This == NULL || - (DnsConfigData != NULL && ((DnsConfigData->DnsServerListCount != 0 && DnsConfigData->DnsServerList == NULL) || + + if (This == NULL || + (DnsConfigData != NULL && ((DnsConfigData->DnsServerListCount != 0 && DnsConfigData->DnsServerList == NULL) || (DnsConfigData->DnsServerListCount == 0 && DnsConfigData->DnsServerList != NULL)))) { return EFI_INVALID_PARAMETER; } @@ -215,7 +215,7 @@ Dns4Configure ( if (DnsConfigData == NULL) { ZeroMem (&Instance->SessionDnsServer, sizeof (EFI_IP_ADDRESS)); - + // // Reset the Instance if ConfigData is NULL // @@ -226,12 +226,12 @@ Dns4Configure ( if (Instance->UdpIo != NULL){ UdpIoCleanIo (Instance->UdpIo); } - + if (Instance->Dns4CfgData.DnsServerList != NULL) { FreePool (Instance->Dns4CfgData.DnsServerList); } ZeroMem (&Instance->Dns4CfgData, sizeof (EFI_DNS4_CONFIG_DATA)); - + Instance->State = DNS_STATE_UNCONFIGED; } else { // @@ -255,14 +255,14 @@ Dns4Configure ( } if (DnsConfigData->DnsServerListCount == 0) { - gBS->RestoreTPL (OldTpl); - + gBS->RestoreTPL (OldTpl); + // // The DNS instance will retrieve DNS server from DHCP Server // Status = GetDns4ServerFromDhcp4 ( Instance, - &ServerListCount, + &ServerListCount, &ServerList ); if (EFI_ERROR (Status)) { @@ -270,7 +270,7 @@ Dns4Configure ( } ASSERT(ServerList != NULL); - + OldTpl = gBS->RaiseTPL (TPL_CALLBACK); CopyMem (&Instance->SessionDnsServer.v4, &ServerList[0], sizeof (EFI_IPv4_ADDRESS)); @@ -301,7 +301,7 @@ Dns4Configure ( } goto ON_EXIT; } - + Instance->State = DNS_STATE_CONFIGED; } @@ -339,42 +339,42 @@ Dns4HostNameToIp ( ) { EFI_STATUS Status; - + DNS_INSTANCE *Instance; - + EFI_DNS4_CONFIG_DATA *ConfigData; - + UINTN Index; DNS4_CACHE *Item; LIST_ENTRY *Entry; LIST_ENTRY *Next; - + CHAR8 *QueryName; - + DNS4_TOKEN_ENTRY *TokenEntry; NET_BUF *Packet; - + EFI_TPL OldTpl; - + Status = EFI_SUCCESS; Item = NULL; QueryName = NULL; TokenEntry = NULL; Packet = NULL; - + // // Validate the parameters // if ((This == NULL) || (HostName == NULL) || Token == NULL) { return EFI_INVALID_PARAMETER; } - + OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - + Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This); - + ConfigData = &(Instance->Dns4CfgData); - + if (Instance->State != DNS_STATE_CONFIGED) { Status = EFI_NOT_STARTED; goto ON_EXIT; @@ -395,9 +395,9 @@ Dns4HostNameToIp ( if (Token->RetryInterval == 0) { Token->RetryInterval = ConfigData->RetryInterval; } - + // - // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. + // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. // if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) { Token->RetryInterval = DNS_DEFAULT_TIMEOUT; @@ -428,7 +428,7 @@ Dns4HostNameToIp ( if (Token->RspData.H2AData != NULL) { FreePool (Token->RspData.H2AData); } - + Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } @@ -438,12 +438,12 @@ Dns4HostNameToIp ( Item = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink); if ((UINT32)Index < Token->RspData.H2AData->IpCount && StrCmp (HostName, Item->DnsCache.HostName) == 0) { CopyMem ((Token->RspData.H2AData->IpList) + Index, Item->DnsCache.IpAddress, sizeof (EFI_IPv4_ADDRESS)); - Index++; + Index++; } } - + Token->Status = EFI_SUCCESS; - + if (Token->Event != NULL) { gBS->SignalEvent (Token->Event); DispatchDpc (); @@ -451,7 +451,7 @@ Dns4HostNameToIp ( Status = Token->Status; goto ON_EXIT; - } + } } // @@ -462,7 +462,7 @@ Dns4HostNameToIp ( Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } - + TokenEntry->PacketToLive = Token->RetryInterval; TokenEntry->Token = Token; TokenEntry->QueryHostName = AllocateZeroPool (StrSize (HostName)); @@ -470,9 +470,9 @@ Dns4HostNameToIp ( Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } - + CopyMem (TokenEntry->QueryHostName, HostName, StrSize (HostName)); - + // // Construct QName. // @@ -481,12 +481,12 @@ Dns4HostNameToIp ( Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } - + // // Construct DNS Query Packet. // Status = ConstructDNSQuery (Instance, QueryName, DNS_TYPE_A, DNS_CLASS_INET, &Packet); - if (EFI_ERROR (Status)) { + if (EFI_ERROR (Status)) { goto ON_EXIT; } @@ -499,7 +499,7 @@ Dns4HostNameToIp ( if (EFI_ERROR (Status)) { goto ON_EXIT; } - + // // Dns Query Ip // @@ -507,7 +507,7 @@ Dns4HostNameToIp ( if (EFI_ERROR (Status)) { Dns4RemoveTokenEntry (&Instance->Dns4TxTokens, TokenEntry); } - + ON_EXIT: if (EFI_ERROR (Status)) { @@ -515,19 +515,19 @@ ON_EXIT: if (TokenEntry->QueryHostName != NULL) { FreePool (TokenEntry->QueryHostName); } - + FreePool (TokenEntry); } - + if (Packet != NULL) { NetbufFree (Packet); } } - + if (QueryName != NULL) { FreePool (QueryName); } - + gBS->RestoreTPL (OldTpl); return Status; } @@ -535,7 +535,7 @@ ON_EXIT: /** IPv4 address to host name translation also known as Reverse DNS lookup. - The IpToHostName() function is used to translate the host address to host name. A type PTR + The IpToHostName() function is used to translate the host address to host name. A type PTR query is used to get the primary name of the host. Support of this function is optional. @param[in] This Pointer to EFI_DNS4_PROTOCOL instance. @@ -566,7 +566,7 @@ Dns4IpToHostName ( } /** - Retrieve arbitrary information from the DNS server. + Retrieve arbitrary information from the DNS server. This GeneralLookup() function retrieves arbitrary information from the DNS. The caller supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All @@ -597,37 +597,37 @@ EFIAPI Dns4GeneralLookUp ( IN EFI_DNS4_PROTOCOL *This, IN CHAR8 *QName, - IN UINT16 QType, + IN UINT16 QType, IN UINT16 QClass, IN EFI_DNS4_COMPLETION_TOKEN *Token ) { EFI_STATUS Status; - + DNS_INSTANCE *Instance; - + EFI_DNS4_CONFIG_DATA *ConfigData; - + DNS4_TOKEN_ENTRY *TokenEntry; NET_BUF *Packet; - + EFI_TPL OldTpl; - + Status = EFI_SUCCESS; TokenEntry = NULL; Packet = NULL; - + // // Validate the parameters // if ((This == NULL) || (QName == NULL) || Token == NULL) { return EFI_INVALID_PARAMETER; } - + OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - + Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This); - + ConfigData = &(Instance->Dns4CfgData); if (Instance->State != DNS_STATE_CONFIGED) { @@ -636,14 +636,14 @@ Dns4GeneralLookUp ( } Token->Status = EFI_NOT_READY; - + // // If zero, use the parameter configured through Dns.Configure() interface. // if (Token->RetryCount == 0) { Token->RetryCount = ConfigData->RetryCount; } - + // // If zero, use the parameter configured through Dns.Configure() interface. // @@ -652,7 +652,7 @@ Dns4GeneralLookUp ( } // - // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. + // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. // if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) { Token->RetryInterval = DNS_DEFAULT_TIMEOUT; @@ -666,7 +666,7 @@ Dns4GeneralLookUp ( Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } - + TokenEntry->PacketToLive = Token->RetryInterval; TokenEntry->GeneralLookUp = TRUE; TokenEntry->Token = Token; @@ -679,7 +679,7 @@ Dns4GeneralLookUp ( if (TokenEntry != NULL) { FreePool (TokenEntry); } - + goto ON_EXIT; } @@ -693,12 +693,12 @@ Dns4GeneralLookUp ( if (TokenEntry != NULL) { FreePool (TokenEntry); } - + NetbufFree (Packet); - + goto ON_EXIT; } - + // // Dns Query Ip // @@ -709,10 +709,10 @@ Dns4GeneralLookUp ( if (TokenEntry != NULL) { FreePool (TokenEntry); } - + NetbufFree (Packet); } - + ON_EXIT: gBS->RestoreTPL (OldTpl); return Status; @@ -753,15 +753,15 @@ Dns4UpdateDnsCache ( IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry ) { - EFI_STATUS Status; + EFI_STATUS Status; EFI_TPL OldTpl; Status = EFI_SUCCESS; - + if (DnsCacheEntry.HostName == NULL || DnsCacheEntry.IpAddress == NULL || DnsCacheEntry.Timeout == 0) { - return EFI_INVALID_PARAMETER; + return EFI_INVALID_PARAMETER; } - + OldTpl = gBS->RaiseTPL (TPL_CALLBACK); // @@ -770,7 +770,7 @@ Dns4UpdateDnsCache ( Status = UpdateDns4Cache (&mDriverData->Dns4CacheList, DeleteFlag, Override, DnsCacheEntry); gBS->RestoreTPL (OldTpl); - + return Status; } @@ -817,7 +817,7 @@ Dns4Poll ( } Udp = Instance->UdpIo->Protocol.Udp4; - + return Udp->Poll (Udp); } @@ -890,7 +890,7 @@ Dns4Cancel ( This function is used to retrieve DNS mode data for this DNS instance. @param[in] This Pointer to EFI_DNS6_PROTOCOL instance. - @param[out] DnsModeData Pointer to the caller-allocated storage for the + @param[out] DnsModeData Pointer to the caller-allocated storage for the EFI_DNS6_MODE_DATA data. @retval EFI_SUCCESS The operation completed successfully. @@ -908,11 +908,11 @@ Dns6GetModeData ( ) { DNS_INSTANCE *Instance; - + EFI_TPL OldTpl; UINTN Index; - + LIST_ENTRY *Entry; LIST_ENTRY *Next; @@ -933,7 +933,7 @@ Dns6GetModeData ( } OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - + Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This); if (Instance->State == DNS_STATE_UNCONFIGED) { Status = EFI_NOT_STARTED; @@ -943,13 +943,13 @@ Dns6GetModeData ( ZeroMem (DnsModeData, sizeof (EFI_DNS6_MODE_DATA)); // - // Get the current configuration data of this instance. + // Get the current configuration data of this instance. // Status = Dns6CopyConfigure (&DnsModeData->DnsConfigData, &Instance->Dns6CfgData); if (EFI_ERROR (Status)) { goto ON_EXIT; } - + // // Get the DnsServerCount and DnsServerList // @@ -964,7 +964,7 @@ Dns6GetModeData ( Dns6CleanConfigure (&DnsModeData->DnsConfigData); goto ON_EXIT; } - + Index = 0; NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns6ServerList) { ServerItem = NET_LIST_USER_STRUCT (Entry, DNS6_SERVER_IP, AllServerLink); @@ -988,7 +988,7 @@ Dns6GetModeData ( FreePool (ServerList); goto ON_EXIT; } - + Index =0; NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns6CacheList) { CacheItem = NET_LIST_USER_STRUCT (Entry, DNS6_CACHE, AllCacheLink); @@ -996,7 +996,7 @@ Dns6GetModeData ( Index++; } DnsModeData->DnsCacheList = CacheList; - + ON_EXIT: gBS->RestoreTPL (OldTpl); return Status; @@ -1009,7 +1009,7 @@ ON_EXIT: EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL. @param[in] This Pointer to EFI_DNS6_PROTOCOL instance. - @param[in] DnsConfigData Pointer to the configuration data structure. All associated + @param[in] DnsConfigData Pointer to the configuration data structure. All associated storage to be allocated and released by caller. @retval EFI_SUCCESS The operation completed successfully. @@ -1021,8 +1021,8 @@ ON_EXIT: @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI DNSv6 Protocol instance is not configured. @retval EFI_UNSUPPORTED The designated protocol is not supported. - @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To - reconfigure the instance the caller must call Configure() with + @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To + reconfigure the instance the caller must call Configure() with NULL first to return driver to unconfigured state. **/ EFI_STATUS @@ -1034,17 +1034,17 @@ Dns6Configure ( { EFI_STATUS Status; DNS_INSTANCE *Instance; - + EFI_TPL OldTpl; UINT32 ServerListCount; - EFI_IPv6_ADDRESS *ServerList; + EFI_IPv6_ADDRESS *ServerList; Status = EFI_SUCCESS; ServerList = NULL; - if (This == NULL || - (DnsConfigData != NULL && ((DnsConfigData->DnsServerCount != 0 && DnsConfigData->DnsServerList == NULL) || + if (This == NULL || + (DnsConfigData != NULL && ((DnsConfigData->DnsServerCount != 0 && DnsConfigData->DnsServerList == NULL) || (DnsConfigData->DnsServerCount == 0 && DnsConfigData->DnsServerList != NULL)))) { return EFI_INVALID_PARAMETER; } @@ -1075,7 +1075,7 @@ Dns6Configure ( FreePool (Instance->Dns6CfgData.DnsServerList); } ZeroMem (&Instance->Dns6CfgData, sizeof (EFI_DNS6_CONFIG_DATA)); - + Instance->State = DNS_STATE_UNCONFIGED; } else { // @@ -1099,14 +1099,14 @@ Dns6Configure ( // Status = GetDns6ServerFromDhcp6 ( Instance->Service->ImageHandle, - Instance->Service->ControllerHandle, - &ServerListCount, + Instance->Service->ControllerHandle, + &ServerListCount, &ServerList ); if (EFI_ERROR (Status)) { goto ON_EXIT; } - + ASSERT(ServerList != NULL); OldTpl = gBS->RaiseTPL (TPL_CALLBACK); @@ -1141,7 +1141,7 @@ Dns6Configure ( } goto ON_EXIT; } - + Instance->State = DNS_STATE_CONFIGED; } @@ -1181,23 +1181,23 @@ Dns6HostNameToIp ( ) { EFI_STATUS Status; - + DNS_INSTANCE *Instance; EFI_DNS6_CONFIG_DATA *ConfigData; - - UINTN Index; + + UINTN Index; DNS6_CACHE *Item; LIST_ENTRY *Entry; LIST_ENTRY *Next; - + CHAR8 *QueryName; - + DNS6_TOKEN_ENTRY *TokenEntry; NET_BUF *Packet; - + EFI_TPL OldTpl; - + Status = EFI_SUCCESS; Item = NULL; QueryName = NULL; @@ -1212,9 +1212,9 @@ Dns6HostNameToIp ( } OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - + Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This); - + ConfigData = &(Instance->Dns6CfgData); if (Instance->State != DNS_STATE_CONFIGED) { @@ -1237,9 +1237,9 @@ Dns6HostNameToIp ( if (Token->RetryInterval == 0) { Token->RetryInterval = ConfigData->RetryInterval; } - + // - // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. + // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. // if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) { Token->RetryInterval = DNS_DEFAULT_TIMEOUT; @@ -1270,7 +1270,7 @@ Dns6HostNameToIp ( if (Token->RspData.H2AData != NULL) { FreePool (Token->RspData.H2AData); } - + Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } @@ -1283,17 +1283,17 @@ Dns6HostNameToIp ( Index++; } } - + Token->Status = EFI_SUCCESS; - + if (Token->Event != NULL) { gBS->SignalEvent (Token->Event); DispatchDpc (); } - + Status = Token->Status; goto ON_EXIT; - } + } } // @@ -1304,7 +1304,7 @@ Dns6HostNameToIp ( Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } - + TokenEntry->PacketToLive = Token->RetryInterval; TokenEntry->Token = Token; TokenEntry->QueryHostName = AllocateZeroPool (StrSize (HostName)); @@ -1312,7 +1312,7 @@ Dns6HostNameToIp ( Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } - + CopyMem (TokenEntry->QueryHostName, HostName, StrSize (HostName)); // @@ -1323,7 +1323,7 @@ Dns6HostNameToIp ( Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } - + // // Construct DNS Query Packet. // @@ -1341,7 +1341,7 @@ Dns6HostNameToIp ( if (EFI_ERROR (Status)) { goto ON_EXIT; } - + // // Dns Query Ip // @@ -1349,7 +1349,7 @@ Dns6HostNameToIp ( if (EFI_ERROR (Status)) { Dns6RemoveTokenEntry (&Instance->Dns6TxTokens, TokenEntry); } - + ON_EXIT: if (EFI_ERROR (Status)) { @@ -1357,19 +1357,19 @@ ON_EXIT: if (TokenEntry->QueryHostName != NULL) { FreePool (TokenEntry->QueryHostName); } - + FreePool (TokenEntry); } - + if (Packet != NULL) { NetbufFree (Packet); } } - + if (QueryName != NULL) { FreePool (QueryName); } - + gBS->RestoreTPL (OldTpl); return Status; } @@ -1442,37 +1442,37 @@ EFIAPI Dns6GeneralLookUp ( IN EFI_DNS6_PROTOCOL *This, IN CHAR8 *QName, - IN UINT16 QType, + IN UINT16 QType, IN UINT16 QClass, IN EFI_DNS6_COMPLETION_TOKEN *Token ) { EFI_STATUS Status; - + DNS_INSTANCE *Instance; - + EFI_DNS6_CONFIG_DATA *ConfigData; - + DNS6_TOKEN_ENTRY *TokenEntry; NET_BUF *Packet; - + EFI_TPL OldTpl; - + Status = EFI_SUCCESS; TokenEntry = NULL; Packet = NULL; - + // // Validate the parameters // if ((This == NULL) || (QName == NULL) || Token == NULL) { return EFI_INVALID_PARAMETER; } - + OldTpl = gBS->RaiseTPL (TPL_CALLBACK); - + Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This); - + ConfigData = &(Instance->Dns6CfgData); if (Instance->State != DNS_STATE_CONFIGED) { @@ -1481,14 +1481,14 @@ Dns6GeneralLookUp ( } Token->Status = EFI_NOT_READY; - + // // If zero, use the parameter configured through Dns.Configure() interface. // if (Token->RetryCount == 0) { Token->RetryCount = ConfigData->RetryCount; } - + // // If zero, use the parameter configured through Dns.Configure() interface. // @@ -1497,7 +1497,7 @@ Dns6GeneralLookUp ( } // - // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. + // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. // if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) { Token->RetryInterval = DNS_DEFAULT_TIMEOUT; @@ -1511,7 +1511,7 @@ Dns6GeneralLookUp ( Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; } - + TokenEntry->PacketToLive = Token->RetryInterval; TokenEntry->GeneralLookUp = TRUE; TokenEntry->Token = Token; @@ -1524,7 +1524,7 @@ Dns6GeneralLookUp ( if (TokenEntry != NULL) { FreePool (TokenEntry); } - + goto ON_EXIT; } @@ -1538,12 +1538,12 @@ Dns6GeneralLookUp ( if (TokenEntry != NULL) { FreePool (TokenEntry); } - + NetbufFree (Packet); - + goto ON_EXIT; } - + // // Dns Query Ip // @@ -1554,10 +1554,10 @@ Dns6GeneralLookUp ( if (TokenEntry != NULL) { FreePool (TokenEntry); } - + NetbufFree (Packet); } - + ON_EXIT: gBS->RestoreTPL (OldTpl); return Status; @@ -1599,24 +1599,24 @@ Dns6UpdateDnsCache ( IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry ) { - EFI_STATUS Status; + EFI_STATUS Status; EFI_TPL OldTpl; Status = EFI_SUCCESS; - + if (DnsCacheEntry.HostName == NULL || DnsCacheEntry.IpAddress == NULL || DnsCacheEntry.Timeout == 0) { - return EFI_INVALID_PARAMETER; + return EFI_INVALID_PARAMETER; } - + OldTpl = gBS->RaiseTPL (TPL_CALLBACK); // // Update Dns6Cache here. // Status = UpdateDns6Cache (&mDriverData->Dns6CacheList, DeleteFlag, Override, DnsCacheEntry); - + gBS->RestoreTPL (OldTpl); - + return Status; } @@ -1665,7 +1665,7 @@ Dns6Poll ( } Udp = Instance->UdpIo->Protocol.Udp6; - + return Udp->Poll (Udp); }