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>
This commit is contained in:
Liming Gao
2018-06-27 21:12:32 +08:00
parent 9095d37b8f
commit f75a7f568e
180 changed files with 3642 additions and 3642 deletions

View File

@@ -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
//

View File

@@ -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;
}

View File

@@ -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
#endif

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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.
//

View File

@@ -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"

File diff suppressed because it is too large Load Diff

View File

@@ -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
);

View File

@@ -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);
}