summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/DnsDxe
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-06-27 21:12:32 +0800
committerLiming Gao <liming.gao@intel.com>2018-06-28 11:19:49 +0800
commitf75a7f568e6d0944327970b3f3f2dafd9bba76b1 (patch)
treecc64f0e24e92dab5713bf2099f7e1f4fc5152ff6 /NetworkPkg/DnsDxe
parent9095d37b8fe5bfc3d02adad6ba7fd7359ebc0107 (diff)
downloadedk2-f75a7f568e6d0944327970b3f3f2dafd9bba76b1.tar.gz
edk2-f75a7f568e6d0944327970b3f3f2dafd9bba76b1.tar.bz2
edk2-f75a7f568e6d0944327970b3f3f2dafd9bba76b1.zip
NetworkPkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'NetworkPkg/DnsDxe')
-rw-r--r--NetworkPkg/DnsDxe/ComponentName.c34
-rw-r--r--NetworkPkg/DnsDxe/DnsDhcp.c92
-rw-r--r--NetworkPkg/DnsDxe/DnsDhcp.h10
-rw-r--r--NetworkPkg/DnsDxe/DnsDriver.c286
-rw-r--r--NetworkPkg/DnsDxe/DnsDriver.h212
-rw-r--r--NetworkPkg/DnsDxe/DnsDxe.inf10
-rw-r--r--NetworkPkg/DnsDxe/DnsDxe.uni6
-rw-r--r--NetworkPkg/DnsDxe/DnsDxeExtra.uni6
-rw-r--r--NetworkPkg/DnsDxe/DnsImpl.c352
-rw-r--r--NetworkPkg/DnsDxe/DnsImpl.h120
-rw-r--r--NetworkPkg/DnsDxe/DnsProtocol.c316
11 files changed, 722 insertions, 722 deletions
diff --git a/NetworkPkg/DnsDxe/ComponentName.c b/NetworkPkg/DnsDxe/ComponentName.c
index d976bc6849..cd4eea6a8b 100644
--- a/NetworkPkg/DnsDxe/ComponentName.c
+++ b/NetworkPkg/DnsDxe/ComponentName.c
@@ -1,7 +1,7 @@
/** @file
Implementation of EFI_COMPONENT_NAME_PROTOCOL and EFI_COMPONENT_NAME2_PROTOCOL protocol.
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -101,7 +101,7 @@ DnsComponentNameGetControllerName (
///
/// Component Name Protocol instance
///
-GLOBAL_REMOVE_IF_UNREFERENCED
+GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME_PROTOCOL gDnsComponentName = {
DnsComponentNameGetDriverName,
DnsComponentNameGetControllerName,
@@ -111,7 +111,7 @@ EFI_COMPONENT_NAME_PROTOCOL gDnsComponentName = {
///
/// Component Name 2 Protocol instance
///
-GLOBAL_REMOVE_IF_UNREFERENCED
+GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME2_PROTOCOL gDnsComponentName2 = {
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME) DnsComponentNameGetDriverName,
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) DnsComponentNameGetControllerName,
@@ -121,7 +121,7 @@ EFI_COMPONENT_NAME2_PROTOCOL gDnsComponentName2 = {
///
/// Table of driver names
///
-GLOBAL_REMOVE_IF_UNREFERENCED
+GLOBAL_REMOVE_IF_UNREFERENCED
EFI_UNICODE_STRING_TABLE mDnsDriverNameTable[] = {
{ "eng;en", (CHAR16 *)L"DNS Network Service Driver" },
{ NULL, NULL }
@@ -173,10 +173,10 @@ DnsComponentNameGetDriverName (
@param Dns4 A pointer to the EFI_DNS4_PROTOCOL.
-
+
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.
@retval EFI_INVALID_PARAMETER The input parameter is invalid.
-
+
**/
EFI_STATUS
UpdateDns4Name (
@@ -190,7 +190,7 @@ UpdateDns4Name (
if (Dns4 == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
//
// Format the child name into the string buffer as:
// DNSv4 (StationIp=?, LocalPort=?)
@@ -199,7 +199,7 @@ UpdateDns4Name (
if (EFI_ERROR (Status)) {
return Status;
}
-
+
UnicodeSPrint (
HandleName,
sizeof (HandleName),
@@ -222,7 +222,7 @@ UpdateDns4Name (
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
}
-
+
Status = AddUnicodeString2 (
"eng",
gDnsComponentName.SupportedLanguages,
@@ -233,7 +233,7 @@ UpdateDns4Name (
if (EFI_ERROR (Status)) {
return Status;
}
-
+
return AddUnicodeString2 (
"en",
gDnsComponentName2.SupportedLanguages,
@@ -248,10 +248,10 @@ UpdateDns4Name (
@param Dns6 A pointer to the EFI_DNS6_PROTOCOL.
-
+
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.
@retval EFI_INVALID_PARAMETER The input parameter is invalid.
-
+
**/
EFI_STATUS
UpdateDns6Name (
@@ -266,7 +266,7 @@ UpdateDns6Name (
if (Dns6 == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
//
// Format the child name into the string buffer as:
// DNSv6 (StationIp=?, LocalPort=?)
@@ -282,7 +282,7 @@ UpdateDns6Name (
}
UnicodeSPrint (
HandleName,
- sizeof (HandleName),
+ sizeof (HandleName),
L"DNSv6 (StationIp=%s, LocalPort=%d)",
Address,
ModeData.DnsConfigData.LocalPort
@@ -299,7 +299,7 @@ UpdateDns6Name (
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
}
-
+
Status = AddUnicodeString2 (
"eng",
gDnsComponentName.SupportedLanguages,
@@ -310,7 +310,7 @@ UpdateDns6Name (
if (EFI_ERROR (Status)) {
return Status;
}
-
+
return AddUnicodeString2 (
"en",
gDnsComponentName2.SupportedLanguages,
@@ -373,7 +373,7 @@ DnsComponentNameGetControllerName (
EFI_STATUS Status;
EFI_DNS4_PROTOCOL *Dns4;
EFI_DNS6_PROTOCOL *Dns6;
-
+
//
// ChildHandle must be NULL for a Device Driver
//
diff --git a/NetworkPkg/DnsDxe/DnsDhcp.c b/NetworkPkg/DnsDxe/DnsDhcp.c
index 951477b78c..df8f615911 100644
--- a/NetworkPkg/DnsDxe/DnsDhcp.c
+++ b/NetworkPkg/DnsDxe/DnsDhcp.c
@@ -1,7 +1,7 @@
/** @file
Functions implementation related with DHCPv4/v6 for DNS driver.
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -48,7 +48,7 @@ DnsInitSeedPacket (
}
/**
- The common notify function.
+ The common notify function.
@param[in] Event The event signaled.
@param[in] Context The context.
@@ -149,16 +149,16 @@ ParseDhcp4Ack (
}
gBS->FreePool (OptionList);
-
+
return Status;
}
/**
- EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
+ EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
instance to intercept events that occurs in the DHCPv6 Information Request
exchange process.
- @param This Pointer to the EFI_DHCP6_PROTOCOL instance that
+ @param This Pointer to the EFI_DHCP6_PROTOCOL instance that
is used to configure this callback function.
@param Context Pointer to the context that is initialized in
the EFI_DHCP6_PROTOCOL.InfoRequest().
@@ -186,11 +186,11 @@ ParseDhcp6Ack (
EFI_IPv6_ADDRESS *ServerList;
UINT32 Index;
UINT32 Count;
-
+
OptionCount = 0;
ServerCount = 0;
ServerList = NULL;
-
+
Status = This->Parse (This, Packet, &OptionCount, NULL);
if (Status != EFI_BUFFER_TOO_SMALL) {
return EFI_DEVICE_ERROR;
@@ -206,7 +206,7 @@ ParseDhcp6Ack (
gBS->FreePool (OptionList);
return EFI_DEVICE_ERROR;
}
-
+
DnsServerInfor = (DNS6_SERVER_INFOR *) Context;
for (Index = 0; Index < OptionCount; Index++) {
@@ -223,7 +223,7 @@ ParseDhcp6Ack (
gBS->FreePool (OptionList);
return Status;
}
-
+
ServerCount = OptionList[Index]->OpLen/16;
ServerList = AllocatePool (ServerCount * sizeof (EFI_IPv6_ADDRESS));
if (ServerList == NULL) {
@@ -241,7 +241,7 @@ ParseDhcp6Ack (
}
gBS->FreePool (OptionList);
-
+
return Status;
}
@@ -270,10 +270,10 @@ GetDns4ServerFromDhcp4 (
EFI_HANDLE Image;
EFI_HANDLE Controller;
EFI_STATUS MediaStatus;
- EFI_HANDLE MnpChildHandle;
+ EFI_HANDLE MnpChildHandle;
EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
EFI_MANAGED_NETWORK_CONFIG_DATA MnpConfigData;
- EFI_HANDLE Dhcp4Handle;
+ EFI_HANDLE Dhcp4Handle;
EFI_DHCP4_PROTOCOL *Dhcp4;
EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;
UINTN DataSize;
@@ -286,13 +286,13 @@ GetDns4ServerFromDhcp4 (
EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN Token;
BOOLEAN IsDone;
UINTN Index;
-
+
Image = Instance->Service->ImageHandle;
Controller = Instance->Service->ControllerHandle;
MnpChildHandle = NULL;
Mnp = NULL;
-
+
Dhcp4Handle = NULL;
Dhcp4 = NULL;
@@ -304,11 +304,11 @@ GetDns4ServerFromDhcp4 (
ZeroMem ((UINT8 *) ParaList, sizeof (ParaList));
ZeroMem (&MnpConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));
-
+
ZeroMem (&DnsServerInfor, sizeof (DNS4_SERVER_INFOR));
-
+
ZeroMem (&Token, sizeof (EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN));
-
+
DnsServerInfor.ServerCount = DnsServerCount;
IsDone = FALSE;
@@ -346,7 +346,7 @@ GetDns4ServerFromDhcp4 (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
-
+
MnpConfigData.ReceivedQueueTimeoutValue = 0;
MnpConfigData.TransmitQueueTimeoutValue = 0;
MnpConfigData.ProtocolTypeFilter = IP4_ETHER_PROTO;
@@ -362,7 +362,7 @@ GetDns4ServerFromDhcp4 (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
-
+
//
// Create a DHCP4 child instance and get the protocol.
//
@@ -395,7 +395,7 @@ GetDns4ServerFromDhcp4 (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
-
+
Status = Ip4Config2->GetData (Ip4Config2, Ip4Config2DataTypeInterfaceInfo, &DataSize, Data);
if (EFI_ERROR (Status) && Status != EFI_BUFFER_TOO_SMALL) {
goto ON_EXIT;
@@ -413,7 +413,7 @@ GetDns4ServerFromDhcp4 (
}
InterfaceInfo = (EFI_IP4_CONFIG2_INTERFACE_INFO *)Data;
-
+
//
// Build required Token.
//
@@ -427,13 +427,13 @@ GetDns4ServerFromDhcp4 (
if (EFI_ERROR (Status)) {
goto ON_EXIT;
}
-
+
SetMem (&Token.RemoteAddress, sizeof (EFI_IPv4_ADDRESS), 0xff);
-
+
Token.RemotePort = 67;
Token.ListenPointCount = 1;
-
+
Token.ListenPoints = AllocateZeroPool (Token.ListenPointCount * sizeof (EFI_DHCP4_LISTEN_POINT));
if (Token.ListenPoints == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -447,9 +447,9 @@ GetDns4ServerFromDhcp4 (
CopyMem (&(Token.ListenPoints[0].ListenAddress), &(Instance->Dns4CfgData.StationIp), sizeof (EFI_IPv4_ADDRESS));
CopyMem (&(Token.ListenPoints[0].SubnetMask), &(Instance->Dns4CfgData.SubnetMask), sizeof (EFI_IPv4_ADDRESS));
}
-
+
Token.ListenPoints[0].ListenPort = 68;
-
+
Token.TimeoutValue = DNS_TIME_TO_GETMAP;
DnsInitSeedPacket (&SeedPacket, InterfaceInfo);
@@ -459,35 +459,35 @@ GetDns4ServerFromDhcp4 (
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
-
+
ParaList[0]->OpCode = DHCP4_TAG_TYPE;
ParaList[0]->Length = 1;
ParaList[0]->Data[0] = DHCP4_MSG_REQUEST;
-
+
ParaList[1] = AllocateZeroPool (sizeof (EFI_DHCP4_PACKET_OPTION));
if (ParaList[1] == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
-
+
ParaList[1]->OpCode = DHCP4_TAG_PARA_LIST;
ParaList[1]->Length = 1;
ParaList[1]->Data[0] = DHCP4_TAG_DNS_SERVER;
- Status = Dhcp4->Build (Dhcp4, &SeedPacket, 0, NULL, 2, ParaList, &Token.Packet);
+ Status = Dhcp4->Build (Dhcp4, &SeedPacket, 0, NULL, 2, ParaList, &Token.Packet);
Token.Packet->Dhcp4.Header.Xid = HTONL(NET_RANDOM (NetRandomInitSeed ()));
-
+
Token.Packet->Dhcp4.Header.Reserved = HTONS ((UINT16)0x8000);
-
+
if (Instance->Dns4CfgData.UseDefaultSetting) {
CopyMem (&(Token.Packet->Dhcp4.Header.ClientAddr), &(InterfaceInfo->StationAddress), sizeof (EFI_IPv4_ADDRESS));
} else {
CopyMem (&(Token.Packet->Dhcp4.Header.ClientAddr), &(Instance->Dns4CfgData.StationIp), sizeof (EFI_IPv4_ADDRESS));
}
-
- CopyMem (Token.Packet->Dhcp4.Header.ClientHwAddr, &(InterfaceInfo->HwAddress), InterfaceInfo->HwAddressSize);
-
+
+ CopyMem (Token.Packet->Dhcp4.Header.ClientHwAddr, &(InterfaceInfo->HwAddress), InterfaceInfo->HwAddressSize);
+
Token.Packet->Dhcp4.Header.HwAddrLen = (UINT8)(InterfaceInfo->HwAddressSize);
//
@@ -504,7 +504,7 @@ GetDns4ServerFromDhcp4 (
do {
Status = Mnp->Poll (Mnp);
} while (!IsDone);
-
+
//
// Parse the ACK to get required information if received done.
//
@@ -520,7 +520,7 @@ GetDns4ServerFromDhcp4 (
} else {
Status = Token.Status;
}
-
+
ON_EXIT:
if (Data != NULL) {
@@ -540,15 +540,15 @@ ON_EXIT:
if (Token.Packet) {
FreePool (Token.Packet);
}
-
+
if (Token.ResponseList != NULL) {
FreePool (Token.ResponseList);
}
-
+
if (Token.CompletionEvent != NULL) {
gBS->CloseEvent (Token.CompletionEvent);
}
-
+
if (Dhcp4 != NULL) {
Dhcp4->Stop (Dhcp4);
Dhcp4->Configure (Dhcp4, NULL);
@@ -560,7 +560,7 @@ ON_EXIT:
Controller
);
}
-
+
if (Dhcp4Handle != NULL) {
NetLibDestroyServiceChild (
Controller,
@@ -580,14 +580,14 @@ ON_EXIT:
Controller
);
}
-
+
NetLibDestroyServiceChild (
Controller,
Image,
&gEfiManagedNetworkServiceBindingProtocolGuid,
MnpChildHandle
);
-
+
return Status;
}
@@ -729,14 +729,14 @@ GetDns6ServerFromDhcp6 (
}
} while (TimerStatus == EFI_NOT_READY);
}
-
+
*DnsServerList = DnsServerInfor.ServerList;
ON_EXIT:
if (Oro != NULL) {
FreePool (Oro);
- }
+ }
if (Timer != NULL) {
gBS->CloseEvent (Timer);
@@ -759,6 +759,6 @@ ON_EXIT:
);
return Status;
-
+
}
diff --git a/NetworkPkg/DnsDxe/DnsDhcp.h b/NetworkPkg/DnsDxe/DnsDhcp.h
index 9c61f84c5c..29683b00a2 100644
--- a/NetworkPkg/DnsDxe/DnsDhcp.h
+++ b/NetworkPkg/DnsDxe/DnsDhcp.h
@@ -1,7 +1,7 @@
/** @file
Functions implementation related with DHCPv4/v6 for DNS driver.
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -78,11 +78,11 @@ ParseDhcp4Ack (
);
/**
- EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
+ EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
instance to intercept events that occurs in the DHCPv6 Information Request
exchange process.
- @param This Pointer to the EFI_DHCP6_PROTOCOL instance that
+ @param This Pointer to the EFI_DHCP6_PROTOCOL instance that
is used to configure this callback function.
@param Context Pointer to the context that is initialized in
the EFI_DHCP6_PROTOCOL.InfoRequest().
@@ -143,5 +143,5 @@ GetDns6ServerFromDhcp6 (
OUT UINT32 *DnsServerCount,
OUT EFI_IPv6_ADDRESS **DnsServerList
);
-
-#endif \ No newline at end of file
+
+#endif
diff --git a/NetworkPkg/DnsDxe/DnsDriver.c b/NetworkPkg/DnsDxe/DnsDriver.c
index 5dc9afe448..1f9b924c0b 100644
--- a/NetworkPkg/DnsDxe/DnsDriver.c
+++ b/NetworkPkg/DnsDxe/DnsDriver.c
@@ -1,7 +1,7 @@
/** @file
The driver binding and service binding protocol for DnsDxe driver.
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -56,9 +56,9 @@ DnsDestroyInstance (
)
{
ZeroMem (&Instance->Dns4CfgData, sizeof (EFI_DNS4_CONFIG_DATA));
-
+
ZeroMem (&Instance->Dns6CfgData, sizeof (EFI_DNS6_CONFIG_DATA));
-
+
if (!NetMapIsEmpty (&Instance->Dns4TxTokens)) {
Dns4InstanceCancelToken (Instance, NULL);
}
@@ -66,11 +66,11 @@ DnsDestroyInstance (
if (!NetMapIsEmpty (&Instance->Dns6TxTokens)) {
Dns6InstanceCancelToken (Instance, NULL);
}
-
+
if (Instance->UdpIo!= NULL) {
UdpIoFreeIo (Instance->UdpIo);
}
-
+
FreePool (Instance);
}
@@ -93,7 +93,7 @@ DnsCreateInstance (
DNS_INSTANCE *DnsIns;
*Instance = NULL;
-
+
DnsIns = AllocateZeroPool (sizeof (DNS_INSTANCE));
if (DnsIns == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -104,7 +104,7 @@ DnsCreateInstance (
DnsIns->State = DNS_STATE_UNCONFIGED;
DnsIns->InDestroy = FALSE;
DnsIns->Service = Service;
-
+
if (Service->IpVersion == IP_VERSION_4) {
CopyMem (&DnsIns->Dns4, &mDns4Protocol, sizeof (DnsIns->Dns4));
NetMapInit (&DnsIns->Dns4TxTokens);
@@ -124,7 +124,7 @@ DnsCreateInstance (
FreePool (DnsIns);
return EFI_OUT_OF_RESOURCES;
}
-
+
*Instance = DnsIns;
return EFI_SUCCESS;
@@ -132,7 +132,7 @@ DnsCreateInstance (
/**
Callback function which provided by user to remove one node in NetDestroyLinkList process.
-
+
@param[in] Entry The entry to be removed.
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
@@ -202,7 +202,7 @@ DnsDestroyService (
)
{
UdpIoFreeIo (DnsSb->ConnectUdp);
-
+
if (DnsSb->TimerToGetMap != NULL){
gBS->CloseEvent (DnsSb->TimerToGetMap);
}
@@ -241,7 +241,7 @@ DnsCreateService (
{
EFI_STATUS Status;
DNS_SERVICE *DnsSb;
-
+
Status = EFI_SUCCESS;
DnsSb = NULL;
@@ -259,7 +259,7 @@ DnsCreateService (
} else {
DnsSb->ServiceBinding = mDns6ServiceBinding;
}
-
+
DnsSb->Dns4ChildrenNum = 0;
InitializeListHead (&DnsSb->Dns4ChildrenList);
@@ -270,9 +270,9 @@ DnsCreateService (
DnsSb->ImageHandle = Image;
DnsSb->TimerToGetMap = NULL;
-
+
DnsSb->Timer = NULL;
-
+
DnsSb->IpVersion = IpVersion;
//
@@ -290,7 +290,7 @@ DnsCreateService (
FreePool (DnsSb);
return Status;
}
-
+
//
// Create the timer to retransmit packets.
//
@@ -308,7 +308,7 @@ DnsCreateService (
FreePool (DnsSb);
return Status;
}
-
+
DnsSb->ConnectUdp = NULL;
DnsSb->ConnectUdp = UdpIoCreateIo (
Controller,
@@ -339,7 +339,7 @@ DnsCreateService (
@retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
**/
-EFI_STATUS
+EFI_STATUS
EFIAPI
DnsUnload (
IN EFI_HANDLE ImageHandle
@@ -357,7 +357,7 @@ DnsUnload (
ItemServerIp4 = NULL;
ItemCache6 = NULL;
ItemServerIp6 = NULL;
-
+
//
// Disconnect the driver specified by ImageHandle
//
@@ -373,7 +373,7 @@ DnsUnload (
if (mDriverData->Timer != NULL) {
gBS->CloseEvent (mDriverData->Timer);
}
-
+
while (!IsListEmpty (&mDriverData->Dns4CacheList)) {
Entry = NetListRemoveHead (&mDriverData->Dns4CacheList);
ItemCache4 = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);
@@ -409,10 +409,10 @@ DnsUnload (
ItemServerIp6 = NET_LIST_USER_STRUCT (Entry, DNS6_SERVER_IP, AllServerLink);
FreePool (ItemServerIp6);
}
-
+
FreePool (mDriverData);
}
-
+
return Status;
}
@@ -490,7 +490,7 @@ DnsDriverEntryPoint (
if (EFI_ERROR (Status)) {
goto Error3;
}
-
+
Status = gBS->SetTimer (mDriverData->Timer, TimerPeriodic, TICKS_PER_SECOND);
if (EFI_ERROR (Status)) {
goto Error4;
@@ -500,7 +500,7 @@ DnsDriverEntryPoint (
InitializeListHead (&mDriverData->Dns4ServerList);
InitializeListHead (&mDriverData->Dns6CacheList);
InitializeListHead (&mDriverData->Dns6ServerList);
-
+
return Status;
Error4:
@@ -508,18 +508,18 @@ DnsDriverEntryPoint (
Error3:
FreePool (mDriverData);
-
- Error2:
+
+ Error2:
gBS->UninstallMultipleProtocolInterfaces (
gDns6DriverBinding.DriverBindingHandle,
&gEfiDriverBindingProtocolGuid,
- &gDns6DriverBinding,
+ &gDns6DriverBinding,
&gEfiComponentName2ProtocolGuid,
&gDnsComponentName2,
&gEfiComponentNameProtocolGuid,
&gDnsComponentName,
NULL
- );
+ );
Error1:
gBS->UninstallMultipleProtocolInterfaces (
@@ -532,38 +532,38 @@ DnsDriverEntryPoint (
&gDnsComponentName,
NULL
);
-
+
return Status;
}
/**
- Tests to see if this driver supports a given controller. If a child device is provided,
+ Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
- This function checks to see if the driver specified by This supports the device specified by
- ControllerHandle. Drivers will typically use the device path attached to
- ControllerHandle and/or the services from the bus I/O abstraction attached to
- ControllerHandle to determine if the driver supports ControllerHandle. This function
- may be called many times during platform initialization. In order to reduce boot times, the tests
- performed by this function must be very small, and take as little time as possible to execute. This
- function must not change the state of any hardware devices, and this function must be aware that the
- device specified by ControllerHandle may already be managed by the same driver or a
- different driver. This function must match its calls to AllocatePages() with FreePages(),
- AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
- Because ControllerHandle may have been previously started by the same driver, if a protocol is
- already in the opened state, then it must not be closed with CloseProtocol(). This is required
+ This function checks to see if the driver specified by This supports the device specified by
+ ControllerHandle. Drivers will typically use the device path attached to
+ ControllerHandle and/or the services from the bus I/O abstraction attached to
+ ControllerHandle to determine if the driver supports ControllerHandle. This function
+ may be called many times during platform initialization. In order to reduce boot times, the tests
+ performed by this function must be very small, and take as little time as possible to execute. This
+ function must not change the state of any hardware devices, and this function must be aware that the
+ device specified by ControllerHandle may already be managed by the same driver or a
+ different driver. This function must match its calls to AllocatePages() with FreePages(),
+ AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
+ Because ControllerHandle may have been previously started by the same driver, if a protocol is
+ already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle The handle of the controller to test. This handle
- must support a protocol interface that supplies
+ @param[in] ControllerHandle The handle of the controller to test. This handle
+ must support a protocol interface that supplies
an I/O abstraction to the driver.
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
- parameter is ignored by device drivers, and is optional for bus
- drivers. For bus drivers, if this parameter is not NULL, then
- the bus driver must determine if the bus controller specified
- by ControllerHandle and the child controller specified
- by RemainingDevicePath are both supported by this
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For bus drivers, if this parameter is not NULL, then
+ the bus driver must determine if the bus controller specified
+ by ControllerHandle and the child controller specified
+ by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -622,28 +622,28 @@ Dns4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
- As a result, much of the error checking on the parameters to Start() has been moved into this
- common boot service. It is legal to call Start() from other locations,
+ As a result, much of the error checking on the parameters to Start() has been moved into this
+ common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
- have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
+ have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle The handle of the controller to start. This handle
- must support a protocol interface that supplies
+ @param[in] ControllerHandle The handle of the controller to start. This handle
+ must support a protocol interface that supplies
an I/O abstraction to the driver.
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
- parameter is ignored by device drivers, and is optional for bus
- drivers. For a bus driver, if this parameter is NULL, then handles
- for all the children of Controller are created by this driver.
- If this parameter is not NULL and the first Device Path Node is
- not the End of Device Path Node, then only the handle for the
- child device specified by the first Device Path Node of
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For a bus driver, if this parameter is NULL, then handles
+ for all the children of Controller are created by this driver.
+ If this parameter is not NULL and the first Device Path Node is
+ not the End of Device Path Node, then only the handle for the
+ child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
- If the first Device Path Node of RemainingDevicePath is
+ If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -668,14 +668,14 @@ Dns4DriverBindingStart (
if (EFI_ERROR (Status)) {
return Status;
}
-
+
ASSERT (DnsSb != NULL);
-
+
Status = gBS->SetTimer (DnsSb->Timer, TimerPeriodic, TICKS_PER_SECOND);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
-
+
//
// Install the Dns4ServiceBinding Protocol onto ControllerHandle.
//
@@ -699,10 +699,10 @@ ON_ERROR:
/**
Stops a device controller or a bus controller.
-
- The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
- As a result, much of the error checking on the parameters to Stop() has been moved
- into this common boot service. It is legal to call Stop() from other locations,
+
+ The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
+ As a result, much of the error checking on the parameters to Stop() has been moved
+ into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -710,13 +710,13 @@ ON_ERROR:
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
-
+
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle A handle to the device being stopped. The handle must
- support a bus specific I/O protocol for the driver
+ @param[in] ControllerHandle A handle to the device being stopped. The handle must
+ support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
- @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -788,7 +788,7 @@ Dns4DriverBindingStop (
);
DnsDestroyService (DnsSb);
-
+
if (gDnsControllerNameTable != NULL) {
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
@@ -801,33 +801,33 @@ Dns4DriverBindingStop (
}
/**
- Tests to see if this driver supports a given controller. If a child device is provided,
+ Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
- This function checks to see if the driver specified by This supports the device specified by
- ControllerHandle. Drivers will typically use the device path attached to
- ControllerHandle and/or the services from the bus I/O abstraction attached to
- ControllerHandle to determine if the driver supports ControllerHandle. This function
- may be called many times during platform initialization. In order to reduce boot times, the tests
- performed by this function must be very small, and take as little time as possible to execute. This
- function must not change the state of any hardware devices, and this function must be aware that the
- device specified by ControllerHandle may already be managed by the same driver or a
- different driver. This function must match its calls to AllocatePages() with FreePages(),
- AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
- Because ControllerHandle may have been previously started by the same driver, if a protocol is
- already in the opened state, then it must not be closed with CloseProtocol(). This is required
+ This function checks to see if the driver specified by This supports the device specified by
+ ControllerHandle. Drivers will typically use the device path attached to
+ ControllerHandle and/or the services from the bus I/O abstraction attached to
+ ControllerHandle to determine if the driver supports ControllerHandle. This function
+ may be called many times during platform initialization. In order to reduce boot times, the tests
+ performed by this function must be very small, and take as little time as possible to execute. This
+ function must not change the state of any hardware devices, and this function must be aware that the
+ device specified by ControllerHandle may already be managed by the same driver or a
+ different driver. This function must match its calls to AllocatePages() with FreePages(),
+ AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
+ Because ControllerHandle may have been previously started by the same driver, if a protocol is
+ already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle The handle of the controller to test. This handle
- must support a protocol interface that supplies
+ @param[in] ControllerHandle The handle of the controller to test. This handle
+ must support a protocol interface that supplies
an I/O abstraction to the driver.
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
- parameter is ignored by device drivers, and is optional for bus
- drivers. For bus drivers, if this parameter is not NULL, then
- the bus driver must determine if the bus controller specified
- by ControllerHandle and the child controller specified
- by RemainingDevicePath are both supported by this
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For bus drivers, if this parameter is not NULL, then
+ the bus driver must determine if the bus controller specified
+ by ControllerHandle and the child controller specified
+ by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -886,28 +886,28 @@ Dns6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
- As a result, much of the error checking on the parameters to Start() has been moved into this
- common boot service. It is legal to call Start() from other locations,
+ As a result, much of the error checking on the parameters to Start() has been moved into this
+ common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
- have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
+ have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle The handle of the controller to start. This handle
- must support a protocol interface that supplies
+ @param[in] ControllerHandle The handle of the controller to start. This handle
+ must support a protocol interface that supplies
an I/O abstraction to the driver.
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
- parameter is ignored by device drivers, and is optional for bus
- drivers. For a bus driver, if this parameter is NULL, then handles
- for all the children of Controller are created by this driver.
- If this parameter is not NULL and the first Device Path Node is
- not the End of Device Path Node, then only the handle for the
- child device specified by the first Device Path Node of
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For a bus driver, if this parameter is NULL, then handles
+ for all the children of Controller are created by this driver.
+ If this parameter is not NULL and the first Device Path Node is
+ not the End of Device Path Node, then only the handle for the
+ child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
- If the first Device Path Node of RemainingDevicePath is
+ If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -932,14 +932,14 @@ Dns6DriverBindingStart (
if (EFI_ERROR (Status)) {
return Status;
}
-
+
ASSERT (DnsSb != NULL);
-
+
Status = gBS->SetTimer (DnsSb->Timer, TimerPeriodic, TICKS_PER_SECOND);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
-
+
//
// Install the Dns6ServiceBinding Protocol onto ControllerHandle
//
@@ -964,10 +964,10 @@ ON_ERROR:
/**
Stops a device controller or a bus controller.
-
- The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
- As a result, much of the error checking on the parameters to Stop() has been moved
- into this common boot service. It is legal to call Stop() from other locations,
+
+ The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
+ As a result, much of the error checking on the parameters to Stop() has been moved
+ into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -975,13 +975,13 @@ ON_ERROR:
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
-
+
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle A handle to the device being stopped. The handle must
- support a bus specific I/O protocol for the driver
+ @param[in] ControllerHandle A handle to the device being stopped. The handle must
+ support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
- @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -1053,12 +1053,12 @@ Dns6DriverBindingStop (
);
DnsDestroyService (DnsSb);
-
+
if (gDnsControllerNameTable != NULL) {
FreeUnicodeStringTable (gDnsControllerNameTable);
gDnsControllerNameTable = NULL;
}
-
+
Status = EFI_SUCCESS;
}
@@ -1067,14 +1067,14 @@ Dns6DriverBindingStop (
/**
Creates a child handle and installs a protocol.
-
- The CreateChild() function installs a protocol on ChildHandle.
- If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
+
+ The CreateChild() function installs a protocol on ChildHandle.
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
- then a new handle is created. If it is a pointer to an existing UEFI handle,
+ then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@@ -1142,7 +1142,7 @@ Dns4ServiceBindingCreateChild (
&Instance->Dns4,
NULL
);
-
+
goto ON_ERROR;
}
@@ -1167,14 +1167,14 @@ Dns4ServiceBindingCreateChild (
gDns4DriverBinding.DriverBindingHandle,
ChildHandle
);
-
+
gBS->UninstallMultipleProtocolInterfaces (
Instance->ChildHandle,
&gEfiDns4ProtocolGuid,
&Instance->Dns4,
NULL
);
-
+
goto ON_ERROR;
}
@@ -1198,9 +1198,9 @@ ON_ERROR:
/**
Destroys a child handle with a protocol installed on it.
-
- The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
- that was installed by CreateChild() from ChildHandle. If the removed protocol is the
+
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@@ -1260,7 +1260,7 @@ Dns4ServiceBindingDestroyChild (
}
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
-
+
Instance->InDestroy = TRUE;
//
@@ -1292,7 +1292,7 @@ Dns4ServiceBindingDestroyChild (
);
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
-
+
if (EFI_ERROR (Status)) {
Instance->InDestroy = FALSE;
gBS->RestoreTPL (OldTpl);
@@ -1310,14 +1310,14 @@ Dns4ServiceBindingDestroyChild (
/**
Creates a child handle and installs a protocol.
-
- The CreateChild() function installs a protocol on ChildHandle.
- If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
+
+ The CreateChild() function installs a protocol on ChildHandle.
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
- then a new handle is created. If it is a pointer to an existing UEFI handle,
+ then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@@ -1385,7 +1385,7 @@ Dns6ServiceBindingCreateChild (
&Instance->Dns6,
NULL
);
-
+
goto ON_ERROR;
}
@@ -1410,14 +1410,14 @@ Dns6ServiceBindingCreateChild (
gDns6DriverBinding.DriverBindingHandle,
ChildHandle
);
-
+
gBS->UninstallMultipleProtocolInterfaces (
Instance->ChildHandle,
&gEfiDns6ProtocolGuid,
&Instance->Dns6,
NULL
);
-
+
goto ON_ERROR;
}
@@ -1441,9 +1441,9 @@ ON_ERROR:
/**
Destroys a child handle with a protocol installed on it.
-
- The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
- that was installed by CreateChild() from ChildHandle. If the removed protocol is the
+
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
diff --git a/NetworkPkg/DnsDxe/DnsDriver.h b/NetworkPkg/DnsDxe/DnsDriver.h
index 49f6a1d8a3..23b27913a1 100644
--- a/NetworkPkg/DnsDxe/DnsDriver.h
+++ b/NetworkPkg/DnsDxe/DnsDriver.h
@@ -1,7 +1,7 @@
/** @file
The header files of the driver binding and service binding protocol for DnsDxe driver.
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -35,11 +35,11 @@ typedef struct _DNS_INSTANCE DNS_INSTANCE;
#define DNS_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'S')
-#define DNS_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'I')
+#define DNS_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'I')
struct _DNS_DRIVER_DATA {
EFI_EVENT Timer; /// Ticking timer for DNS cache update.
-
+
LIST_ENTRY Dns4CacheList;
LIST_ENTRY Dns4ServerList;
@@ -59,7 +59,7 @@ struct _DNS_SERVICE {
EFI_HANDLE ControllerHandle;
EFI_HANDLE ImageHandle;
-
+
EFI_EVENT TimerToGetMap;
EFI_EVENT Timer; /// Ticking timer for packet retransmission.
@@ -71,10 +71,10 @@ struct _DNS_SERVICE {
struct _DNS_INSTANCE {
UINT32 Signature;
LIST_ENTRY Link;
-
+
EFI_DNS4_PROTOCOL Dns4;
EFI_DNS6_PROTOCOL Dns6;
-
+
INTN State;
BOOLEAN InDestroy;
@@ -139,7 +139,7 @@ DnsCreateInstance (
/**
Callback function which provided by user to remove one node in NetDestroyLinkList process.
-
+
@param[in] Entry The entry to be removed.
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
@@ -218,7 +218,7 @@ DnsCreateService (
@retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
**/
-EFI_STATUS
+EFI_STATUS
EFIAPI
DnsUnload (
IN EFI_HANDLE ImageHandle
@@ -243,33 +243,33 @@ DnsDriverEntryPoint (
);
/**
- Tests to see if this driver supports a given controller. If a child device is provided,
+ Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
- This function checks to see if the driver specified by This supports the device specified by
- ControllerHandle. Drivers will typically use the device path attached to
- ControllerHandle and/or the services from the bus I/O abstraction attached to
- ControllerHandle to determine if the driver supports ControllerHandle. This function
- may be called many times during platform initialization. In order to reduce boot times, the tests
- performed by this function must be very small, and take as little time as possible to execute. This
- function must not change the state of any hardware devices, and this function must be aware that the
- device specified by ControllerHandle may already be managed by the same driver or a
- different driver. This function must match its calls to AllocatePages() with FreePages(),
- AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
- Because ControllerHandle may have been previously started by the same driver, if a protocol is
- already in the opened state, then it must not be closed with CloseProtocol(). This is required
+ This function checks to see if the driver specified by This supports the device specified by
+ ControllerHandle. Drivers will typically use the device path attached to
+ ControllerHandle and/or the services from the bus I/O abstraction attached to
+ ControllerHandle to determine if the driver supports ControllerHandle. This function
+ may be called many times during platform initialization. In order to reduce boot times, the tests
+ performed by this function must be very small, and take as little time as possible to execute. This
+ function must not change the state of any hardware devices, and this function must be aware that the
+ device specified by ControllerHandle may already be managed by the same driver or a
+ different driver. This function must match its calls to AllocatePages() with FreePages(),
+ AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
+ Because ControllerHandle may have been previously started by the same driver, if a protocol is
+ already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle The handle of the controller to test. This handle
- must support a protocol interface that supplies
+ @param[in] ControllerHandle The handle of the controller to test. This handle
+ must support a protocol interface that supplies
an I/O abstraction to the driver.
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
- parameter is ignored by device drivers, and is optional for bus
- drivers. For bus drivers, if this parameter is not NULL, then
- the bus driver must determine if the bus controller specified
- by ControllerHandle and the child controller specified
- by RemainingDevicePath are both supported by this
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For bus drivers, if this parameter is not NULL, then
+ the bus driver must determine if the bus controller specified
+ by ControllerHandle and the child controller specified
+ by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -296,28 +296,28 @@ Dns4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
- As a result, much of the error checking on the parameters to Start() has been moved into this
- common boot service. It is legal to call Start() from other locations,
+ As a result, much of the error checking on the parameters to Start() has been moved into this
+ common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
- have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
+ have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle The handle of the controller to start. This handle
- must support a protocol interface that supplies
+ @param[in] ControllerHandle The handle of the controller to start. This handle
+ must support a protocol interface that supplies
an I/O abstraction to the driver.
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
- parameter is ignored by device drivers, and is optional for bus
- drivers. For a bus driver, if this parameter is NULL, then handles
- for all the children of Controller are created by this driver.
- If this parameter is not NULL and the first Device Path Node is
- not the End of Device Path Node, then only the handle for the
- child device specified by the first Device Path Node of
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For a bus driver, if this parameter is NULL, then handles
+ for all the children of Controller are created by this driver.
+ If this parameter is not NULL and the first Device Path Node is
+ not the End of Device Path Node, then only the handle for the
+ child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
- If the first Device Path Node of RemainingDevicePath is
+ If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -337,10 +337,10 @@ Dns4DriverBindingStart (
/**
Stops a device controller or a bus controller.
-
- The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
- As a result, much of the error checking on the parameters to Stop() has been moved
- into this common boot service. It is legal to call Stop() from other locations,
+
+ The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
+ As a result, much of the error checking on the parameters to Stop() has been moved
+ into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -348,13 +348,13 @@ Dns4DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
-
+
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle A handle to the device being stopped. The handle must
- support a bus specific I/O protocol for the driver
+ @param[in] ControllerHandle A handle to the device being stopped. The handle must
+ support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
- @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -371,33 +371,33 @@ Dns4DriverBindingStop (
);
/**
- Tests to see if this driver supports a given controller. If a child device is provided,
+ Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
- This function checks to see if the driver specified by This supports the device specified by
- ControllerHandle. Drivers will typically use the device path attached to
- ControllerHandle and/or the services from the bus I/O abstraction attached to
- ControllerHandle to determine if the driver supports ControllerHandle. This function
- may be called many times during platform initialization. In order to reduce boot times, the tests
- performed by this function must be very small, and take as little time as possible to execute. This
- function must not change the state of any hardware devices, and this function must be aware that the
- device specified by ControllerHandle may already be managed by the same driver or a
- different driver. This function must match its calls to AllocatePages() with FreePages(),
- AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
- Because ControllerHandle may have been previously started by the same driver, if a protocol is
- already in the opened state, then it must not be closed with CloseProtocol(). This is required
+ This function checks to see if the driver specified by This supports the device specified by
+ ControllerHandle. Drivers will typically use the device path attached to
+ ControllerHandle and/or the services from the bus I/O abstraction attached to
+ ControllerHandle to determine if the driver supports ControllerHandle. This function
+ may be called many times during platform initialization. In order to reduce boot times, the tests
+ performed by this function must be very small, and take as little time as possible to execute. This
+ function must not change the state of any hardware devices, and this function must be aware that the
+ device specified by ControllerHandle may already be managed by the same driver or a
+ different driver. This function must match its calls to AllocatePages() with FreePages(),
+ AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
+ Because ControllerHandle may have been previously started by the same driver, if a protocol is
+ already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle The handle of the controller to test. This handle
- must support a protocol interface that supplies
+ @param[in] ControllerHandle The handle of the controller to test. This handle
+ must support a protocol interface that supplies
an I/O abstraction to the driver.
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
- parameter is ignored by device drivers, and is optional for bus
- drivers. For bus drivers, if this parameter is not NULL, then
- the bus driver must determine if the bus controller specified
- by ControllerHandle and the child controller specified
- by RemainingDevicePath are both supported by this
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For bus drivers, if this parameter is not NULL, then
+ the bus driver must determine if the bus controller specified
+ by ControllerHandle and the child controller specified
+ by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -424,28 +424,28 @@ Dns6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
- As a result, much of the error checking on the parameters to Start() has been moved into this
- common boot service. It is legal to call Start() from other locations,
+ As a result, much of the error checking on the parameters to Start() has been moved into this
+ common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
- have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
+ have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle The handle of the controller to start. This handle
- must support a protocol interface that supplies
+ @param[in] ControllerHandle The handle of the controller to start. This handle
+ must support a protocol interface that supplies
an I/O abstraction to the driver.
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
- parameter is ignored by device drivers, and is optional for bus
- drivers. For a bus driver, if this parameter is NULL, then handles
- for all the children of Controller are created by this driver.
- If this parameter is not NULL and the first Device Path Node is
- not the End of Device Path Node, then only the handle for the
- child device specified by the first Device Path Node of
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For a bus driver, if this parameter is NULL, then handles
+ for all the children of Controller are created by this driver.
+ If this parameter is not NULL and the first Device Path Node is
+ not the End of Device Path Node, then only the handle for the
+ child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
- If the first Device Path Node of RemainingDevicePath is
+ If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -465,10 +465,10 @@ Dns6DriverBindingStart (
/**
Stops a device controller or a bus controller.
-
- The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
- As a result, much of the error checking on the parameters to Stop() has been moved
- into this common boot service. It is legal to call Stop() from other locations,
+
+ The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
+ As a result, much of the error checking on the parameters to Stop() has been moved
+ into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -476,13 +476,13 @@ Dns6DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
-
+
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
- @param[in] ControllerHandle A handle to the device being stopped. The handle must
- support a bus specific I/O protocol for the driver
+ @param[in] ControllerHandle A handle to the device being stopped. The handle must
+ support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
- @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -500,14 +500,14 @@ Dns6DriverBindingStop (
/**
Creates a child handle and installs a protocol.
-
- The CreateChild() function installs a protocol on ChildHandle.
- If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
+
+ The CreateChild() function installs a protocol on ChildHandle.
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
- then a new handle is created. If it is a pointer to an existing UEFI handle,
+ then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@@ -526,9 +526,9 @@ Dns4ServiceBindingCreateChild (
/**
Destroys a child handle with a protocol installed on it.
-
- The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
- that was installed by CreateChild() from ChildHandle. If the removed protocol is the
+
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@@ -551,14 +551,14 @@ Dns4ServiceBindingDestroyChild (
/**
Creates a child handle and installs a protocol.
-
- The CreateChild() function installs a protocol on ChildHandle.
- If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
+
+ The CreateChild() function installs a protocol on ChildHandle.
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,
- then a new handle is created. If it is a pointer to an existing UEFI handle,
+ then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@@ -577,9 +577,9 @@ Dns6ServiceBindingCreateChild (
/**
Destroys a child handle with a protocol installed on it.
-
- The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
- that was installed by CreateChild() from ChildHandle. If the removed protocol is the
+
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
diff --git a/NetworkPkg/DnsDxe/DnsDxe.inf b/NetworkPkg/DnsDxe/DnsDxe.inf
index 01d44a6f1d..c2b50ddabd 100644
--- a/NetworkPkg/DnsDxe/DnsDxe.inf
+++ b/NetworkPkg/DnsDxe/DnsDxe.inf
@@ -1,7 +1,7 @@
## @file
# Implementation of EFI_DNS4_PROTOCOL and EFI_DNS6_PROTOCOL interfaces.
#
-# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -37,8 +37,8 @@
DnsProtocol.c
DnsDhcp.h
DnsDhcp.c
-
-
+
+
[LibraryClasses]
BaseLib
UefiLib
@@ -52,7 +52,7 @@
DpcLib
PrintLib
UdpIoLib
-
+
[Protocols]
gEfiDns4ServiceBindingProtocolGuid ## BY_START
@@ -64,7 +64,7 @@
gEfiIp4Config2ProtocolGuid ## SOMETIMES_CONSUMES
gEfiManagedNetworkServiceBindingProtocolGuid ## SOMETIMES_CONSUMES
gEfiManagedNetworkProtocolGuid ## SOMETIMES_CONSUMES
-
+
gEfiDns6ServiceBindingProtocolGuid ## BY_START
gEfiDns6ProtocolGuid ## BY_START
gEfiUdp6ServiceBindingProtocolGuid ## TO_START
diff --git a/NetworkPkg/DnsDxe/DnsDxe.uni b/NetworkPkg/DnsDxe/DnsDxe.uni
index fc1116aaa5..051f4a5b72 100644
--- a/NetworkPkg/DnsDxe/DnsDxe.uni
+++ b/NetworkPkg/DnsDxe/DnsDxe.uni
@@ -2,15 +2,15 @@
// UEFI DNS DXE Driver.
//
// This driver provides UEFI 2.5 DNS protocols. It could work with an IPv4 and IPv6 stack.
-//
//
-// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+//
+// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// 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.
//
diff --git a/NetworkPkg/DnsDxe/DnsDxeExtra.uni b/NetworkPkg/DnsDxe/DnsDxeExtra.uni
index ab262d609c..8d95570097 100644
--- a/NetworkPkg/DnsDxe/DnsDxeExtra.uni
+++ b/NetworkPkg/DnsDxe/DnsDxeExtra.uni
@@ -1,7 +1,7 @@
// /** @file
// DnsDxe Localized Strings and Content
//
-// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,8 +13,8 @@
//
// **/
-#string STR_PROPERTIES_MODULE_NAME
-#language en-US
+#string STR_PROPERTIES_MODULE_NAME
+#language en-US
"UEFI DNS DXE"
diff --git a/NetworkPkg/DnsDxe/DnsImpl.c b/NetworkPkg/DnsDxe/DnsImpl.c
index 7057bfbbec..89ea755cb2 100644
--- a/NetworkPkg/DnsDxe/DnsImpl.c
+++ b/NetworkPkg/DnsDxe/DnsImpl.c
@@ -1,7 +1,7 @@
/** @file
DnsDxe support functions implementation.
-
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
+
+Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -45,7 +45,7 @@ Dns4RemoveTokenEntry (
return EFI_SUCCESS;
}
-
+
return EFI_NOT_FOUND;
}
@@ -57,7 +57,7 @@ Dns4RemoveTokenEntry (
@retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.
@retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
-
+
**/
EFI_STATUS
Dns6RemoveTokenEntry (
@@ -80,7 +80,7 @@ Dns6RemoveTokenEntry (
return EFI_SUCCESS;
}
-
+
return EFI_NOT_FOUND;
}
@@ -219,24 +219,24 @@ EFI_STATUS
EFIAPI
GetDns4TokenEntry (
IN NET_MAP *TokensMap,
- IN EFI_DNS4_COMPLETION_TOKEN *Token,
+ IN EFI_DNS4_COMPLETION_TOKEN *Token,
OUT DNS4_TOKEN_ENTRY **TokenEntry
)
{
LIST_ENTRY *Entry;
-
+
NET_MAP_ITEM *Item;
-
+
NET_LIST_FOR_EACH (Entry, &TokensMap->Used) {
Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link);
- *TokenEntry = (DNS4_TOKEN_ENTRY *) (Item->Key);
+ *TokenEntry = (DNS4_TOKEN_ENTRY *) (Item->Key);
if ((*TokenEntry)->Token == Token) {
return EFI_SUCCESS;
}
}
-
+
*TokenEntry = NULL;
-
+
return EFI_NOT_FOUND;
}
@@ -255,24 +255,24 @@ EFI_STATUS
EFIAPI
GetDns6TokenEntry (
IN NET_MAP *TokensMap,
- IN EFI_DNS6_COMPLETION_TOKEN *Token,
+ IN EFI_DNS6_COMPLETION_TOKEN *Token,
OUT DNS6_TOKEN_ENTRY **TokenEntry
)
{
LIST_ENTRY *Entry;
-
+
NET_MAP_ITEM *Item;
-
+
NET_LIST_FOR_EACH (Entry, &TokensMap->Used) {
Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link);
- *TokenEntry = (DNS6_TOKEN_ENTRY *) (Item->Key);
+ *TokenEntry = (DNS6_TOKEN_ENTRY *) (Item->Key);
if ((*TokenEntry)->Token == Token) {
return EFI_SUCCESS;
}
}
-
+
*TokenEntry =NULL;
-
+
return EFI_NOT_FOUND;
}
@@ -325,7 +325,7 @@ Dns4InstanceCancelToken (
}
ASSERT ((TokenEntry != NULL) || (0 == NetMapGetCount (&Instance->Dns4TxTokens)));
-
+
if (NetMapIsEmpty (&Instance->Dns4TxTokens)) {
Instance->UdpIo->Protocol.Udp4->Cancel (Instance->UdpIo->Protocol.Udp4, &Instance->UdpIo->RecvRequest->Token.Udp4);
}
@@ -382,7 +382,7 @@ Dns6InstanceCancelToken (
}
ASSERT ((TokenEntry != NULL) || (0 == NetMapGetCount (&Instance->Dns6TxTokens)));
-
+
if (NetMapIsEmpty (&Instance->Dns6TxTokens)) {
Instance->UdpIo->Protocol.Udp6->Cancel (Instance->UdpIo->Protocol.Udp6, &Instance->UdpIo->RecvRequest->Token.Udp6);
}
@@ -526,9 +526,9 @@ DnsDummyExtFree (
/**
Poll the UDP to get the IP4 default address, which may be retrieved
- by DHCP.
-
- The default time out value is 5 seconds. If IP has retrieved the default address,
+ by DHCP.
+
+ The default time out value is 5 seconds. If IP has retrieved the default address,
the UDP is reconfigured.
@param Instance The DNS instance
@@ -657,10 +657,10 @@ Dns6GetMapping (
/**
Configure the UDP.
-
+
@param Instance The DNS session
@param UdpIo The UDP_IO instance
-
+
@retval EFI_SUCCESS The UDP is successfully configured for the
session.
@@ -699,13 +699,13 @@ Dns4ConfigUdp (
if ((Status == EFI_NO_MAPPING) && Dns4GetMapping (Instance, UdpIo, &UdpConfig)) {
return EFI_SUCCESS;
}
-
+
return Status;
}
/**
Configure the UDP.
-
+
@param Instance The DNS session
@param UdpIo The UDP_IO instance
@@ -742,24 +742,24 @@ Dns6ConfigUdp (
if ((Status == EFI_NO_MAPPING) && Dns6GetMapping (Instance, UdpIo, &UdpConfig)) {
return EFI_SUCCESS;
}
-
+
return Status;
}
/**
Update Dns4 cache to shared list of caches of all DNSv4 instances.
-
+
@param Dns4CacheList All Dns4 cache list.
- @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
- If TRUE, this function will delete matching DNS Cache entry.
- @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
+ @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
+ If TRUE, this function will delete matching DNS Cache entry.
+ @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
@param DnsCacheEntry Entry Pointer to DNS Cache entry.
@retval EFI_SUCCESS Update Dns4 cache successfully.
- @retval Others Failed to update Dns4 cache.
-
-**/
+ @retval Others Failed to update Dns4 cache.
+
+**/
EFI_STATUS
EFIAPI
UpdateDns4Cache (
@@ -769,14 +769,14 @@ UpdateDns4Cache (
IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry
)
{
- DNS4_CACHE *NewDnsCache;
+ DNS4_CACHE *NewDnsCache;
DNS4_CACHE *Item;
LIST_ENTRY *Entry;
LIST_ENTRY *Next;
NewDnsCache = NULL;
Item = NULL;
-
+
//
// Search the database for the matching EFI_DNS_CACHE_ENTRY
//
@@ -796,14 +796,14 @@ UpdateDns4Cache (
FreePool (Item->DnsCache.HostName);
FreePool (Item->DnsCache.IpAddress);
FreePool (Item);
-
+
return EFI_SUCCESS;
} else if (Override) {
//
// Update this one
//
Item->DnsCache.Timeout = DnsCacheEntry.Timeout;
-
+
return EFI_SUCCESS;
}else {
return EFI_ACCESS_DENIED;
@@ -815,18 +815,18 @@ UpdateDns4Cache (
// Add new one
//
NewDnsCache = AllocatePool (sizeof (DNS4_CACHE));
- if (NewDnsCache == NULL) {
+ if (NewDnsCache == NULL) {
return EFI_OUT_OF_RESOURCES;
}
-
+
InitializeListHead (&NewDnsCache->AllCacheLink);
-
+
NewDnsCache->DnsCache.HostName = AllocatePool (StrSize (DnsCacheEntry.HostName));
- if (NewDnsCache->DnsCache.HostName == NULL) {
+ if (NewDnsCache->DnsCache.HostName == NULL) {
FreePool (NewDnsCache);
return EFI_OUT_OF_RESOURCES;
}
-
+
CopyMem (NewDnsCache->DnsCache.HostName, DnsCacheEntry.HostName, StrSize (DnsCacheEntry.HostName));
NewDnsCache->DnsCache.IpAddress = AllocatePool (sizeof (EFI_IPv4_ADDRESS));
@@ -839,25 +839,25 @@ UpdateDns4Cache (
CopyMem (NewDnsCache->DnsCache.IpAddress, DnsCacheEntry.IpAddress, sizeof (EFI_IPv4_ADDRESS));
NewDnsCache->DnsCache.Timeout = DnsCacheEntry.Timeout;
-
+
InsertTailList (Dns4CacheList, &NewDnsCache->AllCacheLink);
-
+
return EFI_SUCCESS;
}
/**
- Update Dns6 cache to shared list of caches of all DNSv6 instances.
+ Update Dns6 cache to shared list of caches of all DNSv6 instances.
@param Dns6CacheList All Dns6 cache list.
- @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
- If TRUE, this function will delete matching DNS Cache entry.
- @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
+ @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
+ If TRUE, this function will delete matching DNS Cache entry.
+ @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
@param DnsCacheEntry Entry Pointer to DNS Cache entry.
-
+
@retval EFI_SUCCESS Update Dns6 cache successfully.
@retval Others Failed to update Dns6 cache.
-**/
+**/
EFI_STATUS
EFIAPI
UpdateDns6Cache (
@@ -867,14 +867,14 @@ UpdateDns6Cache (
IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
)
{
- DNS6_CACHE *NewDnsCache;
+ DNS6_CACHE *NewDnsCache;
DNS6_CACHE *Item;
LIST_ENTRY *Entry;
LIST_ENTRY *Next;
NewDnsCache = NULL;
Item = NULL;
-
+
//
// Search the database for the matching EFI_DNS_CACHE_ENTRY
//
@@ -890,18 +890,18 @@ UpdateDns6Cache (
// Delete matching DNS Cache entry
//
RemoveEntryList (&Item->AllCacheLink);
-
+
FreePool (Item->DnsCache.HostName);
FreePool (Item->DnsCache.IpAddress);
FreePool (Item);
-
+
return EFI_SUCCESS;
} else if (Override) {
//
// Update this one
//
Item->DnsCache.Timeout = DnsCacheEntry.Timeout;
-
+
return EFI_SUCCESS;
}else {
return EFI_ACCESS_DENIED;
@@ -913,18 +913,18 @@ UpdateDns6Cache (
// Add new one
//
NewDnsCache = AllocatePool (sizeof (DNS6_CACHE));
- if (NewDnsCache == NULL) {
+ if (NewDnsCache == NULL) {
return EFI_OUT_OF_RESOURCES;
}
-
+
InitializeListHead (&NewDnsCache->AllCacheLink);
-
+
NewDnsCache->DnsCache.HostName = AllocatePool (StrSize (DnsCacheEntry.HostName));
- if (NewDnsCache->DnsCache.HostName == NULL) {
+ if (NewDnsCache->DnsCache.HostName == NULL) {
FreePool (NewDnsCache);
return EFI_OUT_OF_RESOURCES;
}
-
+
CopyMem (NewDnsCache->DnsCache.HostName, DnsCacheEntry.HostName, StrSize (DnsCacheEntry.HostName));
NewDnsCache->DnsCache.IpAddress = AllocatePool (sizeof (EFI_IPv6_ADDRESS));
@@ -933,26 +933,26 @@ UpdateDns6Cache (
FreePool (NewDnsCache);
return EFI_OUT_OF_RESOURCES;
}
-
+
CopyMem (NewDnsCache->DnsCache.IpAddress, DnsCacheEntry.IpAddress, sizeof (EFI_IPv6_ADDRESS));
NewDnsCache->DnsCache.Timeout = DnsCacheEntry.Timeout;
-
+
InsertTailList (Dns6CacheList, &NewDnsCache->AllCacheLink);
-
+
return EFI_SUCCESS;
}
/**
- Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.
+ Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.
- @param Dns4ServerList Common list of addresses of all configured DNSv4 server.
- @param ServerIp DNS server Ip.
+ @param Dns4ServerList Common list of addresses of all configured DNSv4 server.
+ @param ServerIp DNS server Ip.
@retval EFI_SUCCESS Add Dns4 ServerIp to common list successfully.
@retval Others Failed to add Dns4 ServerIp to common list.
-
-**/
+
+**/
EFI_STATUS
EFIAPI
AddDns4ServerIp (
@@ -960,14 +960,14 @@ AddDns4ServerIp (
IN EFI_IPv4_ADDRESS ServerIp
)
{
- DNS4_SERVER_IP *NewServerIp;
+ DNS4_SERVER_IP *NewServerIp;
DNS4_SERVER_IP *Item;
LIST_ENTRY *Entry;
LIST_ENTRY *Next;
NewServerIp = NULL;
Item = NULL;
-
+
//
// Search the database for the matching ServerIp
//
@@ -976,7 +976,7 @@ AddDns4ServerIp (
if (CompareMem (&Item->Dns4ServerIp, &ServerIp, sizeof (EFI_IPv4_ADDRESS)) == 0) {
//
// Already done.
- //
+ //
return EFI_SUCCESS;
}
}
@@ -985,29 +985,29 @@ AddDns4ServerIp (
// Add new one
//
NewServerIp = AllocatePool (sizeof (DNS4_SERVER_IP));
- if (NewServerIp == NULL) {
+ if (NewServerIp == NULL) {
return EFI_OUT_OF_RESOURCES;
}
-
+
InitializeListHead (&NewServerIp->AllServerLink);
-
+
CopyMem (&NewServerIp->Dns4ServerIp, &ServerIp, sizeof (EFI_IPv4_ADDRESS));
-
+
InsertTailList (Dns4ServerList, &NewServerIp->AllServerLink);
-
+
return EFI_SUCCESS;
}
/**
- Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.
+ Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.
- @param Dns6ServerList Common list of addresses of all configured DNSv6 server.
- @param ServerIp DNS server Ip.
+ @param Dns6ServerList Common list of addresses of all configured DNSv6 server.
+ @param ServerIp DNS server Ip.
@retval EFI_SUCCESS Add Dns6 ServerIp to common list successfully.
@retval Others Failed to add Dns6 ServerIp to common list.
-
-**/
+
+**/
EFI_STATUS
EFIAPI
AddDns6ServerIp (
@@ -1015,14 +1015,14 @@ AddDns6ServerIp (
IN EFI_IPv6_ADDRESS ServerIp
)
{
- DNS6_SERVER_IP *NewServerIp;
+ DNS6_SERVER_IP *NewServerIp;
DNS6_SERVER_IP *Item;
LIST_ENTRY *Entry;
LIST_ENTRY *Next;
NewServerIp = NULL;
Item = NULL;
-
+
//
// Search the database for the matching ServerIp
//
@@ -1031,7 +1031,7 @@ AddDns6ServerIp (
if (CompareMem (&Item->Dns6ServerIp, &ServerIp, sizeof (EFI_IPv6_ADDRESS)) == 0) {
//
// Already done.
- //
+ //
return EFI_SUCCESS;
}
}
@@ -1040,32 +1040,32 @@ AddDns6ServerIp (
// Add new one
//
NewServerIp = AllocatePool (sizeof (DNS6_SERVER_IP));
- if (NewServerIp == NULL) {
+ if (NewServerIp == NULL) {
return EFI_OUT_OF_RESOURCES;
}
-
+
InitializeListHead (&NewServerIp->AllServerLink);
-
+
CopyMem (&NewServerIp->Dns6ServerIp, &ServerIp, sizeof (EFI_IPv6_ADDRESS));
-
+
InsertTailList (Dns6ServerList, &NewServerIp->AllServerLink);
-
+
return EFI_SUCCESS;
}
/**
Find out whether the response is valid or invalid.
- @param TokensMap All DNS transmittal Tokens entry.
- @param Identification Identification for queried packet.
+ @param TokensMap All DNS transmittal Tokens entry.
+ @param Identification Identification for queried packet.
@param Type Type for queried packet.
@param Class Class for queried packet.
@param Item Return corresponding Token entry.
@retval TRUE The response is valid.
@retval FALSE The response is invalid.
-
-**/
+
+**/
BOOLEAN
IsValidDnsResponse (
IN NET_MAP *TokensMap,
@@ -1087,7 +1087,7 @@ IsValidDnsResponse (
*Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link);
Packet = (NET_BUF *) ((*Item)->Value);
if (Packet == NULL){
-
+
continue;
} else {
TxString = NetbufGetByte (Packet, 0, NULL);
@@ -1095,17 +1095,17 @@ IsValidDnsResponse (
DnsHeader = (DNS_HEADER *) TxString;
QueryName = (CHAR8 *) (TxString + sizeof (*DnsHeader));
QuerySection = (DNS_QUERY_SECTION *) (QueryName + AsciiStrLen (QueryName) + 1);
-
+
if (NTOHS (DnsHeader->Identification) == Identification &&
- NTOHS (QuerySection->Type) == Type &&
+ NTOHS (QuerySection->Type) == Type &&
NTOHS (QuerySection->Class) == Class) {
return TRUE;
}
- }
+ }
}
-
+
*Item = NULL;
-
+
return FALSE;
}
@@ -1114,12 +1114,12 @@ IsValidDnsResponse (
@param Instance The DNS instance
@param RxString Received buffer.
- @param Completed Flag to indicate that Dns response is valid.
-
+ @param Completed Flag to indicate that Dns response is valid.
+
@retval EFI_SUCCESS Parse Dns Response successfully.
@retval Others Failed to parse Dns Response.
-
-**/
+
+**/
EFI_STATUS
ParseDnsResponse (
IN OUT DNS_INSTANCE *Instance,
@@ -1128,10 +1128,10 @@ ParseDnsResponse (
)
{
DNS_HEADER *DnsHeader;
-
+
CHAR8 *QueryName;
DNS_QUERY_SECTION *QuerySection;
-
+
CHAR8 *AnswerName;
DNS_ANSWER_SECTION *AnswerSection;
UINT8 *AnswerData;
@@ -1139,12 +1139,12 @@ ParseDnsResponse (
NET_MAP_ITEM *Item;
DNS4_TOKEN_ENTRY *Dns4TokenEntry;
DNS6_TOKEN_ENTRY *Dns6TokenEntry;
-
+
UINT32 IpCount;
UINT32 RRCount;
UINT32 AnswerSectionNum;
UINT32 CNameTtl;
-
+
EFI_IPv4_ADDRESS *HostAddr4;
EFI_IPv6_ADDRESS *HostAddr6;
@@ -1157,33 +1157,33 @@ ParseDnsResponse (
EFI_STATUS Status;
EFI_TPL OldTpl;
-
+
Item = NULL;
Dns4TokenEntry = NULL;
Dns6TokenEntry = NULL;
-
+
IpCount = 0;
RRCount = 0;
AnswerSectionNum = 0;
CNameTtl = 0;
-
+
HostAddr4 = NULL;
HostAddr6 = NULL;
-
+
Dns4CacheEntry = NULL;
Dns6CacheEntry = NULL;
-
+
Dns4RR = NULL;
Dns6RR = NULL;
*Completed = TRUE;
Status = EFI_SUCCESS;
-
+
//
// Get header
//
DnsHeader = (DNS_HEADER *) RxString;
-
+
DnsHeader->Identification = NTOHS (DnsHeader->Identification);
DnsHeader->Flags.Uint16 = NTOHS (DnsHeader->Flags.Uint16);
DnsHeader->QuestionsNum = NTOHS (DnsHeader->QuestionsNum);
@@ -1215,8 +1215,8 @@ ParseDnsResponse (
//
if (Instance->Service->IpVersion == IP_VERSION_4) {
if (!IsValidDnsResponse (
- &Instance->Dns4TxTokens,
- DnsHeader->Identification,
+ &Instance->Dns4TxTokens,
+ DnsHeader->Identification,
QuerySection->Type,
QuerySection->Class,
&Item
@@ -1229,8 +1229,8 @@ ParseDnsResponse (
Dns4TokenEntry = (DNS4_TOKEN_ENTRY *) (Item->Key);
} else {
if (!IsValidDnsResponse (
- &Instance->Dns6TxTokens,
- DnsHeader->Identification,
+ &Instance->Dns6TxTokens,
+ DnsHeader->Identification,
QuerySection->Type,
QuerySection->Class,
&Item
@@ -1242,7 +1242,7 @@ ParseDnsResponse (
ASSERT (Item != NULL);
Dns6TokenEntry = (DNS6_TOKEN_ENTRY *) (Item->Key);
}
-
+
//
// Continue Check Some Errors.
//
@@ -1252,14 +1252,14 @@ ParseDnsResponse (
// The domain name referenced in the query does not exist.
//
if (DnsHeader->Flags.Bits.RCode == DNS_FLAGS_RCODE_NAME_ERROR) {
- Status = EFI_NOT_FOUND;
+ Status = EFI_NOT_FOUND;
} else {
Status = EFI_DEVICE_ERROR;
}
-
+
goto ON_COMPLETE;
}
-
+
//
// Do some buffer allocations.
//
@@ -1352,7 +1352,7 @@ ParseDnsResponse (
Status = EFI_UNSUPPORTED;
goto ON_EXIT;
}
-
+
//
// Get Answer section.
//
@@ -1388,7 +1388,7 @@ ParseDnsResponse (
goto ON_EXIT;
}
CopyMem (Dns4RR[RRCount].RData, AnswerData, Dns4RR[RRCount].DataLength);
-
+
RRCount ++;
Status = EFI_SUCCESS;
} else if (Instance->Service->IpVersion == IP_VERSION_6 && Dns6TokenEntry->GeneralLookUp) {
@@ -1414,12 +1414,12 @@ ParseDnsResponse (
goto ON_EXIT;
}
CopyMem (Dns6RR[RRCount].RData, AnswerData, Dns6RR[RRCount].DataLength);
-
+
RRCount ++;
Status = EFI_SUCCESS;
} else {
//
- // It's not the GeneralLookUp querying.
+ // It's not the GeneralLookUp querying.
// Check the Query type, parse the response packet.
//
switch (AnswerSection->Type) {
@@ -1433,12 +1433,12 @@ ParseDnsResponse (
Status = EFI_ABORTED;
goto ON_EXIT;
}
-
+
HostAddr4 = Dns4TokenEntry->Token->RspData.H2AData->IpList;
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);
CopyMem (&HostAddr4[IpCount], AnswerData, sizeof (EFI_IPv4_ADDRESS));
- //
+ //
// Allocate new CacheEntry pool to update DNS cache dynamically.
//
Dns4CacheEntry = AllocateZeroPool (sizeof (EFI_DNS4_CACHE_ENTRY));
@@ -1464,15 +1464,15 @@ ParseDnsResponse (
} else {
Dns4CacheEntry->Timeout = MAX (CNameTtl, AnswerSection->Ttl);
}
-
+
UpdateDns4Cache (&mDriverData->Dns4CacheList, FALSE, TRUE, *Dns4CacheEntry);
- //
+ //
// Free allocated CacheEntry pool.
//
FreePool (Dns4CacheEntry->HostName);
Dns4CacheEntry->HostName = NULL;
-
+
FreePool (Dns4CacheEntry->IpAddress);
Dns4CacheEntry->IpAddress = NULL;
@@ -1492,12 +1492,12 @@ ParseDnsResponse (
Status = EFI_ABORTED;
goto ON_EXIT;
}
-
+
HostAddr6 = Dns6TokenEntry->Token->RspData.H2AData->IpList;
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);
CopyMem (&HostAddr6[IpCount], AnswerData, sizeof (EFI_IPv6_ADDRESS));
- //
+ //
// Allocate new CacheEntry pool to update DNS cache dynamically.
//
Dns6CacheEntry = AllocateZeroPool (sizeof (EFI_DNS6_CACHE_ENTRY));
@@ -1523,28 +1523,28 @@ ParseDnsResponse (
} else {
Dns6CacheEntry->Timeout = MAX (CNameTtl, AnswerSection->Ttl);
}
-
+
UpdateDns6Cache (&mDriverData->Dns6CacheList, FALSE, TRUE, *Dns6CacheEntry);
- //
+ //
// Free allocated CacheEntry pool.
//
FreePool (Dns6CacheEntry->HostName);
Dns6CacheEntry->HostName = NULL;
-
+
FreePool (Dns6CacheEntry->IpAddress);
Dns6CacheEntry->IpAddress = NULL;
FreePool (Dns6CacheEntry);
Dns6CacheEntry = NULL;
-
+
IpCount ++;
Status = EFI_SUCCESS;
break;
case DNS_TYPE_CNAME:
//
- // According RFC 1034 - 3.6.2, if the query name is an alias, the name server will include the CNAME
- // record in the response and restart the query at the domain name specified in the data field of the
+ // According RFC 1034 - 3.6.2, if the query name is an alias, the name server will include the CNAME
+ // record in the response and restart the query at the domain name specified in the data field of the
// CNAME record. So, just record the TTL value of the CNAME, then skip to parse the next record.
//
CNameTtl = AnswerSection->Ttl;
@@ -1554,7 +1554,7 @@ ParseDnsResponse (
goto ON_EXIT;
}
}
-
+
//
// Find next one
//
@@ -1564,7 +1564,7 @@ ParseDnsResponse (
if (Instance->Service->IpVersion == IP_VERSION_4) {
ASSERT (Dns4TokenEntry != NULL);
-
+
if (Dns4TokenEntry->GeneralLookUp) {
Dns4TokenEntry->Token->RspData.GLookupData->RRCount = RRCount;
} else {
@@ -1589,7 +1589,7 @@ ParseDnsResponse (
}
}
}
-
+
ON_COMPLETE:
//
// Parsing is complete, free the sending packet and signal Event here.
@@ -1597,7 +1597,7 @@ ON_COMPLETE:
if (Item != NULL && Item->Value != NULL) {
NetbufFree ((NET_BUF *) (Item->Value));
}
-
+
if (Instance->Service->IpVersion == IP_VERSION_4) {
ASSERT (Dns4TokenEntry != NULL);
Dns4RemoveTokenEntry (&Instance->Dns4TxTokens, Dns4TokenEntry);
@@ -1635,10 +1635,10 @@ ON_EXIT:
FreePool (Dns4TokenEntry->Token->RspData.GLookupData->RRList[RRCount].RData);
}
}
-
+
FreePool (Dns4TokenEntry->Token->RspData.GLookupData->RRList);
}
-
+
FreePool (Dns4TokenEntry->Token->RspData.GLookupData);
}
} else {
@@ -1646,7 +1646,7 @@ ON_EXIT:
if (Dns4TokenEntry->Token->RspData.H2AData->IpList != NULL) {
FreePool (Dns4TokenEntry->Token->RspData.H2AData->IpList);
}
-
+
FreePool (Dns4TokenEntry->Token->RspData.H2AData);
}
}
@@ -1666,10 +1666,10 @@ ON_EXIT:
FreePool (Dns6TokenEntry->Token->RspData.GLookupData->RRList[RRCount].RData);
}
}
-
+
FreePool (Dns6TokenEntry->Token->RspData.GLookupData->RRList);
}
-
+
FreePool (Dns6TokenEntry->Token->RspData.GLookupData);
}
} else {
@@ -1677,7 +1677,7 @@ ON_EXIT:
if (Dns6TokenEntry->Token->RspData.H2AData->IpList != NULL) {
FreePool (Dns6TokenEntry->Token->RspData.H2AData->IpList);
}
-
+
FreePool (Dns6TokenEntry->Token->RspData.H2AData);
}
}
@@ -1705,9 +1705,9 @@ ON_EXIT:
}
FreePool (Dns6CacheEntry);
- }
+ }
}
-
+
gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1720,7 +1720,7 @@ ON_EXIT:
@param IoStatus The status of the UDP receive
@param Context The opaque parameter to the function.
-**/
+**/
VOID
EFIAPI
DnsOnPacketReceived (
@@ -1735,7 +1735,7 @@ DnsOnPacketReceived (
UINT8 *RcvString;
BOOLEAN Completed;
-
+
Instance = (DNS_INSTANCE *) Context;
NET_CHECK_SIGNATURE (Instance, DNS_INSTANCE_SIGNATURE);
@@ -1751,10 +1751,10 @@ DnsOnPacketReceived (
if (Packet->TotalSize <= sizeof (DNS_HEADER)) {
goto ON_EXIT;
}
-
+
RcvString = NetbufGetByte (Packet, 0, NULL);
ASSERT (RcvString != NULL);
-
+
//
// Parse Dns Response
//
@@ -1820,7 +1820,7 @@ DnsOnPacketSent (
}
}
}
-
+
NetbufFree (Packet);
}
@@ -1851,14 +1851,14 @@ DoDnsQuery (
return Status;
}
}
-
+
//
// Transmit the DNS packet.
//
NET_GET_REF (Packet);
Status = UdpIoSendDatagram (Instance->UdpIo, Packet, NULL, NULL, DnsOnPacketSent, Instance);
-
+
return Status;
}
@@ -1866,9 +1866,9 @@ DoDnsQuery (
Construct the Packet according query section.
@param Instance The DNS instance
- @param QueryName Queried Name
- @param Type Queried Type
- @param Class Queried Class
+ @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.
@@ -1900,7 +1900,7 @@ ConstructDNSQuery (
//
// Fill header
//
- DnsHeader = (DNS_HEADER *) Frag.Bulk;
+ DnsHeader = (DNS_HEADER *) Frag.Bulk;
DnsHeader->Identification = (UINT16)NET_RANDOM (NetRandomInitSeed());
DnsHeader->Flags.Uint16 = 0x0000;
DnsHeader->Flags.Bits.RD = 1;
@@ -1927,7 +1927,7 @@ ConstructDNSQuery (
Frag.Len = (UINT32) (Frag.Len + AsciiStrLen (QueryName));
*(Frag.Bulk + Frag.Len) = 0;
Frag.Len ++;
-
+
//
// Rest query section
//
@@ -1946,7 +1946,7 @@ ConstructDNSQuery (
FreePool (Frag.Bulk);
return EFI_OUT_OF_RESOURCES;
}
-
+
//
// Store the UdpIo in ProtoData.
//
@@ -1959,7 +1959,7 @@ ConstructDNSQuery (
Retransmit the packet.
@param Instance The DNS instance
- @param Packet Retransmit the packet
+ @param Packet Retransmit the packet
@retval EFI_SUCCESS The packet is retransmitted.
@retval Others Failed to retransmit.
@@ -1972,7 +1972,7 @@ DnsRetransmit (
)
{
EFI_STATUS Status;
-
+
UINT8 *Buffer;
ASSERT (Packet != NULL);
@@ -2064,7 +2064,7 @@ DnsOnTimerRetransmit (
Dns4TokenEntry->Token->Status = EFI_TIMEOUT;
gBS->SignalEvent (Dns4TokenEntry->Token->Event);
DispatchDpc ();
-
+
//
// Free the sending packet.
//
@@ -2075,7 +2075,7 @@ DnsOnTimerRetransmit (
EntryNetMap = Instance->Dns4TxTokens.Used.ForwardLink;
}
}
- }
+ }
}else {
//
// Iterate through all the children of the DNS service instance. Time
@@ -2083,7 +2083,7 @@ DnsOnTimerRetransmit (
//
NET_LIST_FOR_EACH_SAFE (Entry, Next, &Service->Dns6ChildrenList) {
Instance = NET_LIST_USER_STRUCT (Entry, DNS_INSTANCE, Link);
-
+
EntryNetMap = Instance->Dns6TxTokens.Used.ForwardLink;
while (EntryNetMap != &Instance->Dns6TxTokens.Used) {
ItemNetMap = NET_LIST_USER_STRUCT (EntryNetMap, NET_MAP_ITEM, Link);
@@ -2108,7 +2108,7 @@ DnsOnTimerRetransmit (
Dns6TokenEntry->Token->Status = EFI_TIMEOUT;
gBS->SignalEvent (Dns6TokenEntry->Token->Event);
DispatchDpc ();
-
+
//
// Free the sending packet.
//
@@ -2117,10 +2117,10 @@ DnsOnTimerRetransmit (
}
EntryNetMap = Instance->Dns6TxTokens.Used.ForwardLink;
- }
+ }
}
}
- }
+ }
}
/**
@@ -2152,7 +2152,7 @@ DnsOnTimerUpdate (
Item4 = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);
Item4->DnsCache.Timeout--;
}
-
+
Entry = mDriverData->Dns4CacheList.ForwardLink;
while (Entry != &mDriverData->Dns4CacheList) {
Item4 = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);
@@ -2166,7 +2166,7 @@ DnsOnTimerUpdate (
Entry = Entry->ForwardLink;
}
}
-
+
//
// Iterate through all the DNS6 cache list.
//
@@ -2174,7 +2174,7 @@ DnsOnTimerUpdate (
Item6 = NET_LIST_USER_STRUCT (Entry, DNS6_CACHE, AllCacheLink);
Item6->DnsCache.Timeout--;
}
-
+
Entry = mDriverData->Dns6CacheList.ForwardLink;
while (Entry != &mDriverData->Dns6CacheList) {
Item6 = NET_LIST_USER_STRUCT (Entry, DNS6_CACHE, AllCacheLink);
diff --git a/NetworkPkg/DnsDxe/DnsImpl.h b/NetworkPkg/DnsDxe/DnsImpl.h
index 3c6296cb65..90dc054903 100644
--- a/NetworkPkg/DnsDxe/DnsImpl.h
+++ b/NetworkPkg/DnsDxe/DnsImpl.h
@@ -1,7 +1,7 @@
/** @file
DnsDxe support functions implementation.
-
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -95,22 +95,22 @@ typedef union _DNS_FLAGS DNS_FLAGS;
typedef struct {
LIST_ENTRY AllCacheLink;
- EFI_DNS4_CACHE_ENTRY DnsCache;
+ EFI_DNS4_CACHE_ENTRY DnsCache;
} DNS4_CACHE;
typedef struct {
LIST_ENTRY AllCacheLink;
- EFI_DNS6_CACHE_ENTRY DnsCache;
+ EFI_DNS6_CACHE_ENTRY DnsCache;
} DNS6_CACHE;
typedef struct {
LIST_ENTRY AllServerLink;
- EFI_IPv4_ADDRESS Dns4ServerIp;
+ EFI_IPv4_ADDRESS Dns4ServerIp;
} DNS4_SERVER_IP;
typedef struct {
LIST_ENTRY AllServerLink;
- EFI_IPv6_ADDRESS Dns6ServerIp;
+ EFI_IPv6_ADDRESS Dns6ServerIp;
} DNS6_SERVER_IP;
typedef struct {
@@ -206,7 +206,7 @@ Dns4RemoveTokenEntry (
@retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.
@retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
-
+
**/
EFI_STATUS
Dns6RemoveTokenEntry (
@@ -277,7 +277,7 @@ EFI_STATUS
EFIAPI
GetDns4TokenEntry (
IN NET_MAP *TokensMap,
- IN EFI_DNS4_COMPLETION_TOKEN *Token,
+ IN EFI_DNS4_COMPLETION_TOKEN *Token,
OUT DNS4_TOKEN_ENTRY **TokenEntry
);
@@ -296,7 +296,7 @@ EFI_STATUS
EFIAPI
GetDns6TokenEntry (
IN NET_MAP *TokensMap,
- IN EFI_DNS6_COMPLETION_TOKEN *Token,
+ IN EFI_DNS6_COMPLETION_TOKEN *Token,
OUT DNS6_TOKEN_ENTRY **TokenEntry
);
@@ -406,9 +406,9 @@ DnsDummyExtFree (
/**
Poll the UDP to get the IP4 default address, which may be retrieved
- by DHCP.
-
- The default time out value is 5 seconds. If IP has retrieved the default address,
+ by DHCP.
+
+ The default time out value is 5 seconds. If IP has retrieved the default address,
the UDP is reconfigured.
@param Instance The DNS instance
@@ -447,10 +447,10 @@ Dns6GetMapping (
/**
Configure the UDP.
-
+
@param Instance The DNS session
@param UdpIo The UDP_IO instance
-
+
@retval EFI_SUCCESS The UDP is successfully configured for the
session.
@@ -463,7 +463,7 @@ Dns4ConfigUdp (
/**
Configure the UDP.
-
+
@param Instance The DNS session
@param UdpIo The UDP_IO instance
@@ -479,17 +479,17 @@ Dns6ConfigUdp (
/**
Update Dns4 cache to shared list of caches of all DNSv4 instances.
-
+
@param Dns4CacheList All Dns4 cache list.
- @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
- If TRUE, this function will delete matching DNS Cache entry.
- @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
+ @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
+ If TRUE, this function will delete matching DNS Cache entry.
+ @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
@param DnsCacheEntry Entry Pointer to DNS Cache entry.
@retval EFI_SUCCESS Update Dns4 cache successfully.
- @retval Others Failed to update Dns4 cache.
-
+ @retval Others Failed to update Dns4 cache.
+
**/
EFI_STATUS
EFIAPI
@@ -501,18 +501,18 @@ UpdateDns4Cache (
);
/**
- Update Dns6 cache to shared list of caches of all DNSv6 instances.
+ Update Dns6 cache to shared list of caches of all DNSv6 instances.
@param Dns6CacheList All Dns6 cache list.
- @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
- If TRUE, this function will delete matching DNS Cache entry.
- @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
+ @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
+ If TRUE, this function will delete matching DNS Cache entry.
+ @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
@param DnsCacheEntry Entry Pointer to DNS Cache entry.
-
+
@retval EFI_SUCCESS Update Dns6 cache successfully.
@retval Others Failed to update Dns6 cache.
-**/
+**/
EFI_STATUS
EFIAPI
UpdateDns6Cache (
@@ -523,14 +523,14 @@ UpdateDns6Cache (
);
/**
- Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.
+ Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.
- @param Dns4ServerList Common list of addresses of all configured DNSv4 server.
- @param ServerIp DNS server Ip.
+ @param Dns4ServerList Common list of addresses of all configured DNSv4 server.
+ @param ServerIp DNS server Ip.
@retval EFI_SUCCESS Add Dns4 ServerIp to common list successfully.
@retval Others Failed to add Dns4 ServerIp to common list.
-
+
**/
EFI_STATUS
EFIAPI
@@ -540,15 +540,15 @@ AddDns4ServerIp (
);
/**
- Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.
+ Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.
- @param Dns6ServerList Common list of addresses of all configured DNSv6 server.
- @param ServerIp DNS server Ip.
+ @param Dns6ServerList Common list of addresses of all configured DNSv6 server.
+ @param ServerIp DNS server Ip.
@retval EFI_SUCCESS Add Dns6 ServerIp to common list successfully.
@retval Others Failed to add Dns6 ServerIp to common list.
-
-**/
+
+**/
EFI_STATUS
EFIAPI
AddDns6ServerIp (
@@ -559,16 +559,16 @@ AddDns6ServerIp (
/**
Find out whether the response is valid or invalid.
- @param TokensMap All DNS transmittal Tokens entry.
- @param Identification Identification for queried packet.
+ @param TokensMap All DNS transmittal Tokens entry.
+ @param Identification Identification for queried packet.
@param Type Type for queried packet.
@param Class Class for queried packet.
@param Item Return corresponding Token entry.
@retval TRUE The response is valid.
@retval FALSE The response is invalid.
-
-**/
+
+**/
BOOLEAN
IsValidDnsResponse (
IN NET_MAP *TokensMap,
@@ -583,12 +583,12 @@ IsValidDnsResponse (
@param Instance The DNS instance
@param RxString Received buffer.
- @param Completed Flag to indicate that Dns response is valid.
-
+ @param Completed Flag to indicate that Dns response is valid.
+
@retval EFI_SUCCESS Parse Dns Response successfully.
@retval Others Failed to parse Dns Response.
-
-**/
+
+**/
EFI_STATUS
ParseDnsResponse (
IN OUT DNS_INSTANCE *Instance,
@@ -604,7 +604,7 @@ ParseDnsResponse (
@param IoStatus The status of the UDP receive
@param Context The opaque parameter to the function.
-**/
+**/
VOID
EFIAPI
DnsOnPacketReceived (
@@ -652,9 +652,9 @@ DoDnsQuery (
Construct the Packet according query section.
@param Instance The DNS instance
- @param QueryName Queried Name
- @param Type Queried Type
- @param Class Queried Class
+ @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.
@@ -674,7 +674,7 @@ ConstructDNSQuery (
Retransmit the packet.
@param Instance The DNS instance
- @param Packet Retransmit the packet
+ @param Packet Retransmit the packet
@retval EFI_SUCCESS The packet is retransmitted.
@retval Others Failed to retransmit.
@@ -748,7 +748,7 @@ Dns4GetModeData (
@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.
@@ -758,8 +758,8 @@ Dns4GetModeData (
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
@@ -800,7 +800,7 @@ Dns4HostNameToIp (
/**
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.
@@ -828,7 +828,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
@@ -859,7 +859,7 @@ 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
);
@@ -965,7 +965,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.
@@ -989,7 +989,7 @@ Dns6GetModeData (
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.
@@ -1001,8 +1001,8 @@ Dns6GetModeData (
@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
@@ -1107,7 +1107,7 @@ 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
);
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.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
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);
}