/** @file\r
The implementation of construct ENTRY_INDEXER in IpSecConfig application.\r
\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
if (ValueStr == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
Value64 = StrToUInteger (ValueStr, &Status);\r
if (!EFI_ERROR (Status)) {\r
Indexer->Index = (UINTN) Value64;\r
## @file\r
# Shell application IpSecConfig.\r
-# \r
+#\r
# This application is used to set and retrieve security and policy related information\r
# for the EFI IPsec protocol driver.\r
#\r
-# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
// This application is used to set and retrieve security and policy related information\r
// for the EFI IPsec protocol driver.\r
//\r
-// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
// http://opensource.org/licenses/bsd-license.php.\r
-// \r
+//\r
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
// /** @file\r
// IpSecConfig Localized Strings and Content\r
//\r
-// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
//\r
// **/\r
\r
-#string STR_PROPERTIES_MODULE_NAME \r
-#language en-US \r
+#string STR_PROPERTIES_MODULE_NAME\r
+#language en-US\r
"IpSec Config App"\r
\r
\r
/** @file\r
- The internal structure and function declaration of \r
+ The internal structure and function declaration of\r
match policy entry function in IpSecConfig application.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
/** @file\r
The implementation of policy entry operation function in IpSecConfig application.\r
\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Selector\r
);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
if (CreateNew) {\r
//\r
// Edit the entry to a new one. So, we need delete the old entry.\r
/** @file\r
Shell application for VLAN configuration.\r
\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
EFI_STATUS Status;\r
\r
mImageHandle = ImageHandle;\r
- \r
+\r
//\r
// Retrieve HII package list from ImageHandle\r
//\r
//\r
// It is shell application which is used to get and set VLAN configuration.\r
//\r
-// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
// http://opensource.org/licenses/bsd-license.php.\r
-// \r
+//\r
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
// /** @file\r
// VConfig Localized Strings and Content\r
//\r
-// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
//\r
// **/\r
\r
-#string STR_PROPERTIES_MODULE_NAME \r
-#language en-US \r
+#string STR_PROPERTIES_MODULE_NAME\r
+#language en-US\r
"Vlan Config App"\r
\r
\r
/** @file\r
UEFI Component Name(2) protocol implementation for Dhcp6 driver.\r
\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
@param Dhcp6[in] A pointer to the EFI_DHCP6_PROTOCOL.\r
\r
- \r
+\r
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.\r
@retval EFI_INVALID_PARAMETER The input parameter is invalid.\r
- \r
+\r
**/\r
EFI_STATUS\r
UpdateName (\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
if (gDhcp6ControllerNameTable != NULL) {\r
FreeUnicodeStringTable (gDhcp6ControllerNameTable);\r
gDhcp6ControllerNameTable = NULL;\r
}\r
- \r
+\r
if (Dhcp6ModeData.Ia == NULL) {\r
HandleName = L"DHCPv6 (No configured IA)";\r
} else {\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
return AddUnicodeString2 (\r
"en",\r
gDhcp6ComponentName2.SupportedLanguages,\r
if (ChildHandle == NULL) {\r
return EFI_UNSUPPORTED;\r
}\r
- \r
- // \r
- // Make sure this driver produced ChildHandle \r
- // \r
+\r
+ //\r
+ // Make sure this driver produced ChildHandle\r
+ //\r
Status = EfiTestChildHandle (\r
ControllerHandle,\r
- ChildHandle, \r
+ ChildHandle,\r
&gEfiUdp6ProtocolGuid\r
);\r
if (EFI_ERROR (Status)) {\r
Status = gBS->OpenProtocol (\r
ChildHandle,\r
&gEfiDhcp6ProtocolGuid,\r
- (VOID **)&Dhcp6, \r
+ (VOID **)&Dhcp6,\r
NULL,\r
NULL,\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
Driver Binding functions and Service Binding functions\r
implementationfor for Dhcp6 Driver.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
/**\r
Callback function which provided by user to remove one node in NetDestroyLinkList process.\r
- \r
+\r
@param[in] Entry The entry to be removed.\r
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.\r
\r
\r
Instance = NET_LIST_USER_STRUCT_S (Entry, DHCP6_INSTANCE, Link, DHCP6_INSTANCE_SIGNATURE);\r
ServiceBinding = (EFI_SERVICE_BINDING_PROTOCOL *) Context;\r
- \r
+\r
return ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);\r
}\r
\r
if (!IsListEmpty (&Service->Child)) {\r
//\r
// Destroy all the children instances before destory the service.\r
- // \r
+ //\r
List = &Service->Child;\r
Status = NetDestroyLinkList (\r
List,\r
Dhcp6DestroyService (Service);\r
Status = EFI_SUCCESS;\r
}\r
- \r
+\r
ON_EXIT:\r
return Status;\r
}\r
## @file\r
# Client-side DHCPv6 services.\r
-# \r
+#\r
# This driver produces EFI DHCPv6 Protocol which is used to get IPv6 addresses\r
# and other configuration parameters from DHCPv6 servers.\r
#\r
# (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-# Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
gEfiDhcp6ProtocolGuid ## BY_START\r
gEfiIp6ConfigProtocolGuid ## TO_START\r
\r
-[Guids] \r
+[Guids]\r
gZeroGuid ## SOMETIMES_CONSUMES ## GUID\r
- \r
+\r
[Pcd]\r
gEfiNetworkPkgTokenSpaceGuid.PcdDhcp6UidType ## SOMETIMES_CONSUMES\r
\r
// This driver produces EFI DHCPv6 Protocol which is used to get IPv6 addresses\r
// and other configuration parameters from DHCPv6 servers.\r
//\r
-// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
// http://opensource.org/licenses/bsd-license.php.\r
-// \r
+//\r
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
// /** @file\r
// Dhcp6Dxe Localized Strings and Content\r
//\r
-// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
//\r
// **/\r
\r
-#string STR_PROPERTIES_MODULE_NAME \r
-#language en-US \r
+#string STR_PROPERTIES_MODULE_NAME\r
+#language en-US\r
"DHCP6 DXE"\r
\r
\r
/** @file\r
This EFI_DHCP6_PROTOCOL interface implementation.\r
\r
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
}\r
Status = Instance->UdpSts;\r
}\r
- \r
+\r
ON_EXIT:\r
//\r
// Clean up the session data for the released Ia.\r
return Status;\r
}\r
\r
- do { \r
+ do {\r
TimerStatus = gBS->CheckEvent (Timer);\r
if (!EFI_ERROR (TimerStatus)) {\r
Status = Dhcp6StartInfoRequest (\r
);\r
}\r
} while (TimerStatus == EFI_NOT_READY);\r
- \r
+\r
gBS->CloseEvent (Timer);\r
}\r
if (EFI_ERROR (Status)) {\r
/** @file\r
Dhcp6 internal data structure and definition declaration.\r
\r
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
BOOLEAN MediaPresent;\r
//\r
// StartTime is used to calculate the 'elapsed-time' option. Refer to RFC3315,\r
- // the elapsed-time is amount of time since the client began its current DHCP transaction. \r
+ // the elapsed-time is amount of time since the client began its current DHCP transaction.\r
//\r
UINT64 StartTime;\r
};\r
Dhcp6 internal functions implementation.\r
\r
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
@retval TRUE The control block is in Instance's retry list.\r
@retval FALSE The control block is NOT in Instance's retry list.\r
- \r
+\r
**/\r
BOOLEAN\r
Dhcp6IsValidTxCb (\r
if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {\r
goto ON_ERROR;\r
}\r
- \r
+\r
gBS->RestoreTPL (OldTpl);\r
return EFI_SUCCESS;\r
- \r
+\r
ON_ERROR:\r
- gBS->RestoreTPL (OldTpl); \r
+ gBS->RestoreTPL (OldTpl);\r
RemoveEntryList (&InfCb->Link);\r
FreePool (InfCb);\r
\r
//\r
Packet->Length += (UINT32) (Cursor - Packet->Dhcp6.Option);\r
ASSERT (Packet->Size > Packet->Length + 8);\r
- \r
+\r
//\r
// Clear initial time for current transaction.\r
//\r
}\r
} else if (Status == EFI_NOT_FOUND) {\r
//\r
- // Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message, \r
+ // Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message,\r
// the client sends a Renew or Rebind if the IA is not in the Reply message.\r
// Return EFI_SUCCESS so we can continue to restart the Renew/Rebind process.\r
//\r
return EFI_SUCCESS;\r
}\r
- \r
+\r
goto ON_EXIT;\r
- \r
+\r
} else if (Option != NULL) {\r
//\r
// Any error status code option is found.\r
case Dhcp6StsNoBinding:\r
if (Instance->IaCb.Ia->State == Dhcp6Renewing || Instance->IaCb.Ia->State == Dhcp6Rebinding) {\r
//\r
- // Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message, the client \r
+ // Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message, the client\r
// sends a Request message if the IA contained a Status Code option with the NoBinding status.\r
//\r
Status = Dhcp6SendRequestMsg(Instance);\r
}\r
\r
return EFI_SUCCESS;\r
- \r
+\r
ON_EXIT:\r
\r
if (!EFI_ERROR(Status)) {\r
FALSE\r
);\r
}\r
- \r
+\r
return Status;\r
}\r
\r
Dhcp6 support functions implementation.\r
\r
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
- Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
//\r
//\r
// The format of DUID-UUID:\r
- // \r
+ //\r
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\r
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r
// | DUID-Type (4) | UUID (128 bits) |\r
// sizeof (Duid-type + UUID-size) = 18 bytes\r
//\r
Duid->Length = (UINT16) (18);\r
- \r
+\r
//\r
// Set the Duid-type and copy UUID.\r
//\r
WriteUnaligned16 ((UINT16 *) (Duid->Duid), HTONS (Dhcp6DuidTypeUuid));\r
- \r
+\r
CopyMem (Duid->Duid + 2, &Uuid, sizeof(EFI_GUID));\r
\r
} else {\r
- \r
+\r
//\r
//\r
// The format of DUID-LLT:\r
if (Duid == NULL) {\r
return NULL;\r
}\r
- \r
+\r
//\r
// sizeof (Duid-type + hardware-type + time) = 8 bytes\r
//\r
Duid->Length = (UINT16) (Mode->HwAddressSize + 8);\r
- \r
+\r
//\r
// Set the Duid-type, hardware-type, time and copy the hardware address.\r
//\r
// . IAaddr-options .\r
// . .\r
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r
- \r
+\r
//\r
// Fill the value of Ia Address option type\r
//\r
}\r
\r
/**\r
- Check whether the incoming IPv6 address in IaAddr is one of the maintained \r
+ Check whether the incoming IPv6 address in IaAddr is one of the maintained\r
addresses in the IA control blcok.\r
\r
@param[in] IaAddr The pointer to the IA Address to be checked.\r
UINT32 Index;\r
\r
ASSERT (IaAddr != NULL && CurrentIa != NULL);\r
- \r
+\r
for (Index = 0; Index < CurrentIa->IaAddressCount; Index++) {\r
if (EFI_IP6_EQUAL(&IaAddr->IpAddress, &CurrentIa->IaAddress[Index].IpAddress)) {\r
return TRUE;\r
Dhcp6GetMappingTimeOut (\r
IN EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg,\r
OUT UINTN *TimeOut\r
- ) \r
+ )\r
{\r
EFI_STATUS Status;\r
UINTN DataSize;\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
*TimeOut = TICKS_PER_SECOND * DadXmits.DupAddrDetectTransmits + DHCP6_DAD_ADDITIONAL_DELAY;\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
/** @file\r
Implementation of EFI_COMPONENT_NAME_PROTOCOL and EFI_COMPONENT_NAME2_PROTOCOL protocol.\r
\r
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
///\r
/// Component Name Protocol instance\r
///\r
-GLOBAL_REMOVE_IF_UNREFERENCED \r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
EFI_COMPONENT_NAME_PROTOCOL gDnsComponentName = {\r
DnsComponentNameGetDriverName,\r
DnsComponentNameGetControllerName,\r
///\r
/// Component Name 2 Protocol instance\r
///\r
-GLOBAL_REMOVE_IF_UNREFERENCED \r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
EFI_COMPONENT_NAME2_PROTOCOL gDnsComponentName2 = {\r
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME) DnsComponentNameGetDriverName,\r
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) DnsComponentNameGetControllerName,\r
///\r
/// Table of driver names\r
///\r
-GLOBAL_REMOVE_IF_UNREFERENCED \r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
EFI_UNICODE_STRING_TABLE mDnsDriverNameTable[] = {\r
{ "eng;en", (CHAR16 *)L"DNS Network Service Driver" },\r
{ NULL, NULL }\r
\r
@param Dns4 A pointer to the EFI_DNS4_PROTOCOL.\r
\r
- \r
+\r
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.\r
@retval EFI_INVALID_PARAMETER The input parameter is invalid.\r
- \r
+\r
**/\r
EFI_STATUS\r
UpdateDns4Name (\r
if (Dns4 == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// Format the child name into the string buffer as:\r
// DNSv4 (StationIp=?, LocalPort=?)\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
UnicodeSPrint (\r
HandleName,\r
sizeof (HandleName),\r
FreeUnicodeStringTable (gDnsControllerNameTable);\r
gDnsControllerNameTable = NULL;\r
}\r
- \r
+\r
Status = AddUnicodeString2 (\r
"eng",\r
gDnsComponentName.SupportedLanguages,\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
return AddUnicodeString2 (\r
"en",\r
gDnsComponentName2.SupportedLanguages,\r
\r
@param Dns6 A pointer to the EFI_DNS6_PROTOCOL.\r
\r
- \r
+\r
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.\r
@retval EFI_INVALID_PARAMETER The input parameter is invalid.\r
- \r
+\r
**/\r
EFI_STATUS\r
UpdateDns6Name (\r
if (Dns6 == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// Format the child name into the string buffer as:\r
// DNSv6 (StationIp=?, LocalPort=?)\r
}\r
UnicodeSPrint (\r
HandleName,\r
- sizeof (HandleName), \r
+ sizeof (HandleName),\r
L"DNSv6 (StationIp=%s, LocalPort=%d)",\r
Address,\r
ModeData.DnsConfigData.LocalPort\r
FreeUnicodeStringTable (gDnsControllerNameTable);\r
gDnsControllerNameTable = NULL;\r
}\r
- \r
+\r
Status = AddUnicodeString2 (\r
"eng",\r
gDnsComponentName.SupportedLanguages,\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
return AddUnicodeString2 (\r
"en",\r
gDnsComponentName2.SupportedLanguages,\r
EFI_STATUS Status;\r
EFI_DNS4_PROTOCOL *Dns4;\r
EFI_DNS6_PROTOCOL *Dns6;\r
- \r
+\r
//\r
// ChildHandle must be NULL for a Device Driver\r
//\r
/** @file\r
Functions implementation related with DHCPv4/v6 for DNS driver.\r
\r
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
}\r
\r
/**\r
- The common notify function. \r
+ The common notify function.\r
\r
@param[in] Event The event signaled.\r
@param[in] Context The context.\r
}\r
\r
gBS->FreePool (OptionList);\r
- \r
+\r
return Status;\r
}\r
\r
/**\r
- EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol \r
+ EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol\r
instance to intercept events that occurs in the DHCPv6 Information Request\r
exchange process.\r
\r
- @param This Pointer to the EFI_DHCP6_PROTOCOL instance that \r
+ @param This Pointer to the EFI_DHCP6_PROTOCOL instance that\r
is used to configure this callback function.\r
@param Context Pointer to the context that is initialized in\r
the EFI_DHCP6_PROTOCOL.InfoRequest().\r
EFI_IPv6_ADDRESS *ServerList;\r
UINT32 Index;\r
UINT32 Count;\r
- \r
+\r
OptionCount = 0;\r
ServerCount = 0;\r
ServerList = NULL;\r
- \r
+\r
Status = This->Parse (This, Packet, &OptionCount, NULL);\r
if (Status != EFI_BUFFER_TOO_SMALL) {\r
return EFI_DEVICE_ERROR;\r
gBS->FreePool (OptionList);\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
DnsServerInfor = (DNS6_SERVER_INFOR *) Context;\r
\r
for (Index = 0; Index < OptionCount; Index++) {\r
gBS->FreePool (OptionList);\r
return Status;\r
}\r
- \r
+\r
ServerCount = OptionList[Index]->OpLen/16;\r
ServerList = AllocatePool (ServerCount * sizeof (EFI_IPv6_ADDRESS));\r
if (ServerList == NULL) {\r
}\r
\r
gBS->FreePool (OptionList);\r
- \r
+\r
return Status;\r
\r
}\r
EFI_HANDLE Image;\r
EFI_HANDLE Controller;\r
EFI_STATUS MediaStatus;\r
- EFI_HANDLE MnpChildHandle; \r
+ EFI_HANDLE MnpChildHandle;\r
EFI_MANAGED_NETWORK_PROTOCOL *Mnp;\r
EFI_MANAGED_NETWORK_CONFIG_DATA MnpConfigData;\r
- EFI_HANDLE Dhcp4Handle; \r
+ EFI_HANDLE Dhcp4Handle;\r
EFI_DHCP4_PROTOCOL *Dhcp4;\r
EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;\r
UINTN DataSize;\r
EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN Token;\r
BOOLEAN IsDone;\r
UINTN Index;\r
- \r
+\r
Image = Instance->Service->ImageHandle;\r
Controller = Instance->Service->ControllerHandle;\r
\r
MnpChildHandle = NULL;\r
Mnp = NULL;\r
- \r
+\r
Dhcp4Handle = NULL;\r
Dhcp4 = NULL;\r
\r
ZeroMem ((UINT8 *) ParaList, sizeof (ParaList));\r
\r
ZeroMem (&MnpConfigData, sizeof (EFI_MANAGED_NETWORK_CONFIG_DATA));\r
- \r
+\r
ZeroMem (&DnsServerInfor, sizeof (DNS4_SERVER_INFOR));\r
- \r
+\r
ZeroMem (&Token, sizeof (EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN));\r
- \r
+\r
DnsServerInfor.ServerCount = DnsServerCount;\r
\r
IsDone = FALSE;\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
- \r
+\r
MnpConfigData.ReceivedQueueTimeoutValue = 0;\r
MnpConfigData.TransmitQueueTimeoutValue = 0;\r
MnpConfigData.ProtocolTypeFilter = IP4_ETHER_PROTO;\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// Create a DHCP4 child instance and get the protocol.\r
//\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
- \r
+\r
Status = Ip4Config2->GetData (Ip4Config2, Ip4Config2DataTypeInterfaceInfo, &DataSize, Data);\r
if (EFI_ERROR (Status) && Status != EFI_BUFFER_TOO_SMALL) {\r
goto ON_EXIT;\r
}\r
\r
InterfaceInfo = (EFI_IP4_CONFIG2_INTERFACE_INFO *)Data;\r
- \r
+\r
//\r
// Build required Token.\r
//\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
- \r
+\r
SetMem (&Token.RemoteAddress, sizeof (EFI_IPv4_ADDRESS), 0xff);\r
- \r
+\r
Token.RemotePort = 67;\r
\r
Token.ListenPointCount = 1;\r
- \r
+\r
Token.ListenPoints = AllocateZeroPool (Token.ListenPointCount * sizeof (EFI_DHCP4_LISTEN_POINT));\r
if (Token.ListenPoints == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
CopyMem (&(Token.ListenPoints[0].ListenAddress), &(Instance->Dns4CfgData.StationIp), sizeof (EFI_IPv4_ADDRESS));\r
CopyMem (&(Token.ListenPoints[0].SubnetMask), &(Instance->Dns4CfgData.SubnetMask), sizeof (EFI_IPv4_ADDRESS));\r
}\r
- \r
+\r
Token.ListenPoints[0].ListenPort = 68;\r
- \r
+\r
Token.TimeoutValue = DNS_TIME_TO_GETMAP;\r
\r
DnsInitSeedPacket (&SeedPacket, InterfaceInfo);\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
ParaList[0]->OpCode = DHCP4_TAG_TYPE;\r
ParaList[0]->Length = 1;\r
ParaList[0]->Data[0] = DHCP4_MSG_REQUEST;\r
- \r
+\r
ParaList[1] = AllocateZeroPool (sizeof (EFI_DHCP4_PACKET_OPTION));\r
if (ParaList[1] == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
ParaList[1]->OpCode = DHCP4_TAG_PARA_LIST;\r
ParaList[1]->Length = 1;\r
ParaList[1]->Data[0] = DHCP4_TAG_DNS_SERVER;\r
\r
- Status = Dhcp4->Build (Dhcp4, &SeedPacket, 0, NULL, 2, ParaList, &Token.Packet); \r
+ Status = Dhcp4->Build (Dhcp4, &SeedPacket, 0, NULL, 2, ParaList, &Token.Packet);\r
\r
Token.Packet->Dhcp4.Header.Xid = HTONL(NET_RANDOM (NetRandomInitSeed ()));\r
- \r
+\r
Token.Packet->Dhcp4.Header.Reserved = HTONS ((UINT16)0x8000);\r
- \r
+\r
if (Instance->Dns4CfgData.UseDefaultSetting) {\r
CopyMem (&(Token.Packet->Dhcp4.Header.ClientAddr), &(InterfaceInfo->StationAddress), sizeof (EFI_IPv4_ADDRESS));\r
} else {\r
CopyMem (&(Token.Packet->Dhcp4.Header.ClientAddr), &(Instance->Dns4CfgData.StationIp), sizeof (EFI_IPv4_ADDRESS));\r
}\r
- \r
- CopyMem (Token.Packet->Dhcp4.Header.ClientHwAddr, &(InterfaceInfo->HwAddress), InterfaceInfo->HwAddressSize); \r
- \r
+\r
+ CopyMem (Token.Packet->Dhcp4.Header.ClientHwAddr, &(InterfaceInfo->HwAddress), InterfaceInfo->HwAddressSize);\r
+\r
Token.Packet->Dhcp4.Header.HwAddrLen = (UINT8)(InterfaceInfo->HwAddressSize);\r
\r
//\r
do {\r
Status = Mnp->Poll (Mnp);\r
} while (!IsDone);\r
- \r
+\r
//\r
// Parse the ACK to get required information if received done.\r
//\r
} else {\r
Status = Token.Status;\r
}\r
- \r
+\r
ON_EXIT:\r
\r
if (Data != NULL) {\r
if (Token.Packet) {\r
FreePool (Token.Packet);\r
}\r
- \r
+\r
if (Token.ResponseList != NULL) {\r
FreePool (Token.ResponseList);\r
}\r
- \r
+\r
if (Token.CompletionEvent != NULL) {\r
gBS->CloseEvent (Token.CompletionEvent);\r
}\r
- \r
+\r
if (Dhcp4 != NULL) {\r
Dhcp4->Stop (Dhcp4);\r
Dhcp4->Configure (Dhcp4, NULL);\r
Controller\r
);\r
}\r
- \r
+\r
if (Dhcp4Handle != NULL) {\r
NetLibDestroyServiceChild (\r
Controller,\r
Controller\r
);\r
}\r
- \r
+\r
NetLibDestroyServiceChild (\r
Controller,\r
Image,\r
&gEfiManagedNetworkServiceBindingProtocolGuid,\r
MnpChildHandle\r
);\r
- \r
+\r
return Status;\r
}\r
\r
}\r
} while (TimerStatus == EFI_NOT_READY);\r
}\r
- \r
+\r
*DnsServerList = DnsServerInfor.ServerList;\r
\r
ON_EXIT:\r
\r
if (Oro != NULL) {\r
FreePool (Oro);\r
- } \r
+ }\r
\r
if (Timer != NULL) {\r
gBS->CloseEvent (Timer);\r
);\r
\r
return Status;\r
- \r
+\r
}\r
\r
/** @file\r
Functions implementation related with DHCPv4/v6 for DNS driver.\r
\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
);\r
\r
/**\r
- EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol \r
+ EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol\r
instance to intercept events that occurs in the DHCPv6 Information Request\r
exchange process.\r
\r
- @param This Pointer to the EFI_DHCP6_PROTOCOL instance that \r
+ @param This Pointer to the EFI_DHCP6_PROTOCOL instance that\r
is used to configure this callback function.\r
@param Context Pointer to the context that is initialized in\r
the EFI_DHCP6_PROTOCOL.InfoRequest().\r
OUT UINT32 *DnsServerCount,\r
OUT EFI_IPv6_ADDRESS **DnsServerList\r
);\r
- \r
-#endif
\ No newline at end of file
+\r
+#endif\r
/** @file\r
The driver binding and service binding protocol for DnsDxe driver.\r
\r
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
)\r
{\r
ZeroMem (&Instance->Dns4CfgData, sizeof (EFI_DNS4_CONFIG_DATA));\r
- \r
+\r
ZeroMem (&Instance->Dns6CfgData, sizeof (EFI_DNS6_CONFIG_DATA));\r
- \r
+\r
if (!NetMapIsEmpty (&Instance->Dns4TxTokens)) {\r
Dns4InstanceCancelToken (Instance, NULL);\r
}\r
if (!NetMapIsEmpty (&Instance->Dns6TxTokens)) {\r
Dns6InstanceCancelToken (Instance, NULL);\r
}\r
- \r
+\r
if (Instance->UdpIo!= NULL) {\r
UdpIoFreeIo (Instance->UdpIo);\r
}\r
- \r
+\r
FreePool (Instance);\r
}\r
\r
DNS_INSTANCE *DnsIns;\r
\r
*Instance = NULL;\r
- \r
+\r
DnsIns = AllocateZeroPool (sizeof (DNS_INSTANCE));\r
if (DnsIns == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
DnsIns->State = DNS_STATE_UNCONFIGED;\r
DnsIns->InDestroy = FALSE;\r
DnsIns->Service = Service;\r
- \r
+\r
if (Service->IpVersion == IP_VERSION_4) {\r
CopyMem (&DnsIns->Dns4, &mDns4Protocol, sizeof (DnsIns->Dns4));\r
NetMapInit (&DnsIns->Dns4TxTokens);\r
FreePool (DnsIns);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
*Instance = DnsIns;\r
\r
return EFI_SUCCESS;\r
\r
/**\r
Callback function which provided by user to remove one node in NetDestroyLinkList process.\r
- \r
+\r
@param[in] Entry The entry to be removed.\r
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.\r
\r
)\r
{\r
UdpIoFreeIo (DnsSb->ConnectUdp);\r
- \r
+\r
if (DnsSb->TimerToGetMap != NULL){\r
gBS->CloseEvent (DnsSb->TimerToGetMap);\r
}\r
{\r
EFI_STATUS Status;\r
DNS_SERVICE *DnsSb;\r
- \r
+\r
Status = EFI_SUCCESS;\r
DnsSb = NULL;\r
\r
} else {\r
DnsSb->ServiceBinding = mDns6ServiceBinding;\r
}\r
- \r
+\r
DnsSb->Dns4ChildrenNum = 0;\r
InitializeListHead (&DnsSb->Dns4ChildrenList);\r
\r
DnsSb->ImageHandle = Image;\r
\r
DnsSb->TimerToGetMap = NULL;\r
- \r
+\r
DnsSb->Timer = NULL;\r
- \r
+\r
DnsSb->IpVersion = IpVersion;\r
\r
//\r
FreePool (DnsSb);\r
return Status;\r
}\r
- \r
+\r
//\r
// Create the timer to retransmit packets.\r
//\r
FreePool (DnsSb);\r
return Status;\r
}\r
- \r
+\r
DnsSb->ConnectUdp = NULL;\r
DnsSb->ConnectUdp = UdpIoCreateIo (\r
Controller,\r
@retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.\r
\r
**/\r
-EFI_STATUS \r
+EFI_STATUS\r
EFIAPI\r
DnsUnload (\r
IN EFI_HANDLE ImageHandle\r
ItemServerIp4 = NULL;\r
ItemCache6 = NULL;\r
ItemServerIp6 = NULL;\r
- \r
+\r
//\r
// Disconnect the driver specified by ImageHandle\r
//\r
if (mDriverData->Timer != NULL) {\r
gBS->CloseEvent (mDriverData->Timer);\r
}\r
- \r
+\r
while (!IsListEmpty (&mDriverData->Dns4CacheList)) {\r
Entry = NetListRemoveHead (&mDriverData->Dns4CacheList);\r
ItemCache4 = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);\r
ItemServerIp6 = NET_LIST_USER_STRUCT (Entry, DNS6_SERVER_IP, AllServerLink);\r
FreePool (ItemServerIp6);\r
}\r
- \r
+\r
FreePool (mDriverData);\r
}\r
- \r
+\r
return Status;\r
}\r
\r
if (EFI_ERROR (Status)) {\r
goto Error3;\r
}\r
- \r
+\r
Status = gBS->SetTimer (mDriverData->Timer, TimerPeriodic, TICKS_PER_SECOND);\r
if (EFI_ERROR (Status)) {\r
goto Error4;\r
InitializeListHead (&mDriverData->Dns4ServerList);\r
InitializeListHead (&mDriverData->Dns6CacheList);\r
InitializeListHead (&mDriverData->Dns6ServerList);\r
- \r
+\r
return Status;\r
\r
Error4:\r
\r
Error3:\r
FreePool (mDriverData);\r
- \r
- Error2: \r
+\r
+ Error2:\r
gBS->UninstallMultipleProtocolInterfaces (\r
gDns6DriverBinding.DriverBindingHandle,\r
&gEfiDriverBindingProtocolGuid,\r
- &gDns6DriverBinding, \r
+ &gDns6DriverBinding,\r
&gEfiComponentName2ProtocolGuid,\r
&gDnsComponentName2,\r
&gEfiComponentNameProtocolGuid,\r
&gDnsComponentName,\r
NULL\r
- ); \r
+ );\r
\r
Error1:\r
gBS->UninstallMultipleProtocolInterfaces (\r
&gDnsComponentName,\r
NULL\r
);\r
- \r
+\r
return Status;\r
}\r
\r
/**\r
- Tests to see if this driver supports a given controller. If a child device is provided, \r
+ Tests to see if this driver supports a given controller. If a child device is provided,\r
it further tests to see if this driver supports creating a handle for the specified child device.\r
\r
- This function checks to see if the driver specified by This supports the device specified by \r
- ControllerHandle. Drivers will typically use the device path attached to \r
- ControllerHandle and/or the services from the bus I/O abstraction attached to \r
- ControllerHandle to determine if the driver supports ControllerHandle. This function \r
- may be called many times during platform initialization. In order to reduce boot times, the tests \r
- performed by this function must be very small, and take as little time as possible to execute. This \r
- function must not change the state of any hardware devices, and this function must be aware that the \r
- device specified by ControllerHandle may already be managed by the same driver or a \r
- different driver. This function must match its calls to AllocatePages() with FreePages(), \r
- AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). \r
- Because ControllerHandle may have been previously started by the same driver, if a protocol is \r
- already in the opened state, then it must not be closed with CloseProtocol(). This is required \r
+ This function checks to see if the driver specified by This supports the device specified by\r
+ ControllerHandle. Drivers will typically use the device path attached to\r
+ ControllerHandle and/or the services from the bus I/O abstraction attached to\r
+ ControllerHandle to determine if the driver supports ControllerHandle. This function\r
+ may be called many times during platform initialization. In order to reduce boot times, the tests\r
+ performed by this function must be very small, and take as little time as possible to execute. This\r
+ function must not change the state of any hardware devices, and this function must be aware that the\r
+ device specified by ControllerHandle may already be managed by the same driver or a\r
+ different driver. This function must match its calls to AllocatePages() with FreePages(),\r
+ AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r
+ Because ControllerHandle may have been previously started by the same driver, if a protocol is\r
+ already in the opened state, then it must not be closed with CloseProtocol(). This is required\r
to guarantee the state of ControllerHandle is not modified by this function.\r
\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle The handle of the controller to test. This handle \r
- must support a protocol interface that supplies \r
+ @param[in] ControllerHandle The handle of the controller to test. This handle\r
+ must support a protocol interface that supplies\r
an I/O abstraction to the driver.\r
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
- parameter is ignored by device drivers, and is optional for bus \r
- drivers. For bus drivers, if this parameter is not NULL, then \r
- the bus driver must determine if the bus controller specified \r
- by ControllerHandle and the child controller specified \r
- by RemainingDevicePath are both supported by this \r
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
+ parameter is ignored by device drivers, and is optional for bus\r
+ drivers. For bus drivers, if this parameter is not NULL, then\r
+ the bus driver must determine if the bus controller specified\r
+ by ControllerHandle and the child controller specified\r
+ by RemainingDevicePath are both supported by this\r
bus driver.\r
\r
@retval EFI_SUCCESS The device specified by ControllerHandle and\r
Starts a device controller or a bus controller.\r
\r
The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
- As a result, much of the error checking on the parameters to Start() has been moved into this \r
- common boot service. It is legal to call Start() from other locations, \r
+ As a result, much of the error checking on the parameters to Start() has been moved into this\r
+ common boot service. It is legal to call Start() from other locations,\r
but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
1. ControllerHandle must be a valid EFI_HANDLE.\r
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
EFI_DEVICE_PATH_PROTOCOL.\r
3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
- have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. \r
+ have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r
\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle The handle of the controller to start. This handle \r
- must support a protocol interface that supplies \r
+ @param[in] ControllerHandle The handle of the controller to start. This handle\r
+ must support a protocol interface that supplies\r
an I/O abstraction to the driver.\r
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
- parameter is ignored by device drivers, and is optional for bus \r
- drivers. For a bus driver, if this parameter is NULL, then handles \r
- for all the children of Controller are created by this driver. \r
- If this parameter is not NULL and the first Device Path Node is \r
- not the End of Device Path Node, then only the handle for the \r
- child device specified by the first Device Path Node of \r
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
+ parameter is ignored by device drivers, and is optional for bus\r
+ drivers. For a bus driver, if this parameter is NULL, then handles\r
+ for all the children of Controller are created by this driver.\r
+ If this parameter is not NULL and the first Device Path Node is\r
+ not the End of Device Path Node, then only the handle for the\r
+ child device specified by the first Device Path Node of\r
RemainingDevicePath is created by this driver.\r
- If the first Device Path Node of RemainingDevicePath is \r
+ If the first Device Path Node of RemainingDevicePath is\r
the End of Device Path Node, no child handle is created by this\r
driver.\r
\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
ASSERT (DnsSb != NULL);\r
- \r
+\r
Status = gBS->SetTimer (DnsSb->Timer, TimerPeriodic, TICKS_PER_SECOND);\r
if (EFI_ERROR (Status)) {\r
goto ON_ERROR;\r
}\r
- \r
+\r
//\r
// Install the Dns4ServiceBinding Protocol onto ControllerHandle.\r
//\r
\r
/**\r
Stops a device controller or a bus controller.\r
- \r
- The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
- As a result, much of the error checking on the parameters to Stop() has been moved \r
- into this common boot service. It is legal to call Stop() from other locations, \r
+\r
+ The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r
+ As a result, much of the error checking on the parameters to Stop() has been moved\r
+ into this common boot service. It is legal to call Stop() from other locations,\r
but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
same driver's Start() function.\r
EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
Start() function, and the Start() function must have called OpenProtocol() on\r
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
- \r
+\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle A handle to the device being stopped. The handle must \r
- support a bus specific I/O protocol for the driver \r
+ @param[in] ControllerHandle A handle to the device being stopped. The handle must\r
+ support a bus specific I/O protocol for the driver\r
to use to stop the device.\r
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
- @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
if NumberOfChildren is 0.\r
\r
@retval EFI_SUCCESS The device was stopped.\r
);\r
\r
DnsDestroyService (DnsSb);\r
- \r
+\r
if (gDnsControllerNameTable != NULL) {\r
FreeUnicodeStringTable (gDnsControllerNameTable);\r
gDnsControllerNameTable = NULL;\r
}\r
\r
/**\r
- Tests to see if this driver supports a given controller. If a child device is provided, \r
+ Tests to see if this driver supports a given controller. If a child device is provided,\r
it further tests to see if this driver supports creating a handle for the specified child device.\r
\r
- This function checks to see if the driver specified by This supports the device specified by \r
- ControllerHandle. Drivers will typically use the device path attached to \r
- ControllerHandle and/or the services from the bus I/O abstraction attached to \r
- ControllerHandle to determine if the driver supports ControllerHandle. This function \r
- may be called many times during platform initialization. In order to reduce boot times, the tests \r
- performed by this function must be very small, and take as little time as possible to execute. This \r
- function must not change the state of any hardware devices, and this function must be aware that the \r
- device specified by ControllerHandle may already be managed by the same driver or a \r
- different driver. This function must match its calls to AllocatePages() with FreePages(), \r
- AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). \r
- Because ControllerHandle may have been previously started by the same driver, if a protocol is \r
- already in the opened state, then it must not be closed with CloseProtocol(). This is required \r
+ This function checks to see if the driver specified by This supports the device specified by\r
+ ControllerHandle. Drivers will typically use the device path attached to\r
+ ControllerHandle and/or the services from the bus I/O abstraction attached to\r
+ ControllerHandle to determine if the driver supports ControllerHandle. This function\r
+ may be called many times during platform initialization. In order to reduce boot times, the tests\r
+ performed by this function must be very small, and take as little time as possible to execute. This\r
+ function must not change the state of any hardware devices, and this function must be aware that the\r
+ device specified by ControllerHandle may already be managed by the same driver or a\r
+ different driver. This function must match its calls to AllocatePages() with FreePages(),\r
+ AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r
+ Because ControllerHandle may have been previously started by the same driver, if a protocol is\r
+ already in the opened state, then it must not be closed with CloseProtocol(). This is required\r
to guarantee the state of ControllerHandle is not modified by this function.\r
\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle The handle of the controller to test. This handle \r
- must support a protocol interface that supplies \r
+ @param[in] ControllerHandle The handle of the controller to test. This handle\r
+ must support a protocol interface that supplies\r
an I/O abstraction to the driver.\r
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
- parameter is ignored by device drivers, and is optional for bus \r
- drivers. For bus drivers, if this parameter is not NULL, then \r
- the bus driver must determine if the bus controller specified \r
- by ControllerHandle and the child controller specified \r
- by RemainingDevicePath are both supported by this \r
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
+ parameter is ignored by device drivers, and is optional for bus\r
+ drivers. For bus drivers, if this parameter is not NULL, then\r
+ the bus driver must determine if the bus controller specified\r
+ by ControllerHandle and the child controller specified\r
+ by RemainingDevicePath are both supported by this\r
bus driver.\r
\r
@retval EFI_SUCCESS The device specified by ControllerHandle and\r
Starts a device controller or a bus controller.\r
\r
The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
- As a result, much of the error checking on the parameters to Start() has been moved into this \r
- common boot service. It is legal to call Start() from other locations, \r
+ As a result, much of the error checking on the parameters to Start() has been moved into this\r
+ common boot service. It is legal to call Start() from other locations,\r
but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
1. ControllerHandle must be a valid EFI_HANDLE.\r
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
EFI_DEVICE_PATH_PROTOCOL.\r
3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
- have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. \r
+ have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r
\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle The handle of the controller to start. This handle \r
- must support a protocol interface that supplies \r
+ @param[in] ControllerHandle The handle of the controller to start. This handle\r
+ must support a protocol interface that supplies\r
an I/O abstraction to the driver.\r
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
- parameter is ignored by device drivers, and is optional for bus \r
- drivers. For a bus driver, if this parameter is NULL, then handles \r
- for all the children of Controller are created by this driver. \r
- If this parameter is not NULL and the first Device Path Node is \r
- not the End of Device Path Node, then only the handle for the \r
- child device specified by the first Device Path Node of \r
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
+ parameter is ignored by device drivers, and is optional for bus\r
+ drivers. For a bus driver, if this parameter is NULL, then handles\r
+ for all the children of Controller are created by this driver.\r
+ If this parameter is not NULL and the first Device Path Node is\r
+ not the End of Device Path Node, then only the handle for the\r
+ child device specified by the first Device Path Node of\r
RemainingDevicePath is created by this driver.\r
- If the first Device Path Node of RemainingDevicePath is \r
+ If the first Device Path Node of RemainingDevicePath is\r
the End of Device Path Node, no child handle is created by this\r
driver.\r
\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
ASSERT (DnsSb != NULL);\r
- \r
+\r
Status = gBS->SetTimer (DnsSb->Timer, TimerPeriodic, TICKS_PER_SECOND);\r
if (EFI_ERROR (Status)) {\r
goto ON_ERROR;\r
}\r
- \r
+\r
//\r
// Install the Dns6ServiceBinding Protocol onto ControllerHandle\r
//\r
\r
/**\r
Stops a device controller or a bus controller.\r
- \r
- The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
- As a result, much of the error checking on the parameters to Stop() has been moved \r
- into this common boot service. It is legal to call Stop() from other locations, \r
+\r
+ The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r
+ As a result, much of the error checking on the parameters to Stop() has been moved\r
+ into this common boot service. It is legal to call Stop() from other locations,\r
but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
same driver's Start() function.\r
EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
Start() function, and the Start() function must have called OpenProtocol() on\r
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
- \r
+\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle A handle to the device being stopped. The handle must \r
- support a bus specific I/O protocol for the driver \r
+ @param[in] ControllerHandle A handle to the device being stopped. The handle must\r
+ support a bus specific I/O protocol for the driver\r
to use to stop the device.\r
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
- @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
if NumberOfChildren is 0.\r
\r
@retval EFI_SUCCESS The device was stopped.\r
);\r
\r
DnsDestroyService (DnsSb);\r
- \r
+\r
if (gDnsControllerNameTable != NULL) {\r
FreeUnicodeStringTable (gDnsControllerNameTable);\r
gDnsControllerNameTable = NULL;\r
}\r
- \r
+\r
Status = EFI_SUCCESS;\r
}\r
\r
\r
/**\r
Creates a child handle and installs a protocol.\r
- \r
- The CreateChild() function installs a protocol on ChildHandle. \r
- If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. \r
+\r
+ The CreateChild() function installs a protocol on ChildHandle.\r
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
\r
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
- then a new handle is created. If it is a pointer to an existing UEFI handle, \r
+ then a new handle is created. If it is a pointer to an existing UEFI handle,\r
then the protocol is added to the existing UEFI handle.\r
\r
@retval EFI_SUCCES The protocol was added to ChildHandle.\r
&Instance->Dns4,\r
NULL\r
);\r
- \r
+\r
goto ON_ERROR;\r
}\r
\r
gDns4DriverBinding.DriverBindingHandle,\r
ChildHandle\r
);\r
- \r
+\r
gBS->UninstallMultipleProtocolInterfaces (\r
Instance->ChildHandle,\r
&gEfiDns4ProtocolGuid,\r
&Instance->Dns4,\r
NULL\r
);\r
- \r
+\r
goto ON_ERROR;\r
}\r
\r
\r
/**\r
Destroys a child handle with a protocol installed on it.\r
- \r
- The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r
- that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r
+\r
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r
last protocol on ChildHandle, then ChildHandle is destroyed.\r
\r
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
}\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- \r
+\r
Instance->InDestroy = TRUE;\r
\r
//\r
);\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- \r
+\r
if (EFI_ERROR (Status)) {\r
Instance->InDestroy = FALSE;\r
gBS->RestoreTPL (OldTpl);\r
\r
/**\r
Creates a child handle and installs a protocol.\r
- \r
- The CreateChild() function installs a protocol on ChildHandle. \r
- If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. \r
+\r
+ The CreateChild() function installs a protocol on ChildHandle.\r
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
\r
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
- then a new handle is created. If it is a pointer to an existing UEFI handle, \r
+ then a new handle is created. If it is a pointer to an existing UEFI handle,\r
then the protocol is added to the existing UEFI handle.\r
\r
@retval EFI_SUCCES The protocol was added to ChildHandle.\r
&Instance->Dns6,\r
NULL\r
);\r
- \r
+\r
goto ON_ERROR;\r
}\r
\r
gDns6DriverBinding.DriverBindingHandle,\r
ChildHandle\r
);\r
- \r
+\r
gBS->UninstallMultipleProtocolInterfaces (\r
Instance->ChildHandle,\r
&gEfiDns6ProtocolGuid,\r
&Instance->Dns6,\r
NULL\r
);\r
- \r
+\r
goto ON_ERROR;\r
}\r
\r
\r
/**\r
Destroys a child handle with a protocol installed on it.\r
- \r
- The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r
- that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r
+\r
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r
last protocol on ChildHandle, then ChildHandle is destroyed.\r
\r
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
/** @file\r
The header files of the driver binding and service binding protocol for DnsDxe driver.\r
\r
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
#define DNS_SERVICE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'S')\r
\r
-#define DNS_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'I') \r
+#define DNS_INSTANCE_SIGNATURE SIGNATURE_32 ('D', 'N', 'S', 'I')\r
\r
struct _DNS_DRIVER_DATA {\r
EFI_EVENT Timer; /// Ticking timer for DNS cache update.\r
- \r
+\r
LIST_ENTRY Dns4CacheList;\r
LIST_ENTRY Dns4ServerList;\r
\r
\r
EFI_HANDLE ControllerHandle;\r
EFI_HANDLE ImageHandle;\r
- \r
+\r
EFI_EVENT TimerToGetMap;\r
\r
EFI_EVENT Timer; /// Ticking timer for packet retransmission.\r
struct _DNS_INSTANCE {\r
UINT32 Signature;\r
LIST_ENTRY Link;\r
- \r
+\r
EFI_DNS4_PROTOCOL Dns4;\r
EFI_DNS6_PROTOCOL Dns6;\r
- \r
+\r
INTN State;\r
BOOLEAN InDestroy;\r
\r
\r
/**\r
Callback function which provided by user to remove one node in NetDestroyLinkList process.\r
- \r
+\r
@param[in] Entry The entry to be removed.\r
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.\r
\r
@retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.\r
\r
**/\r
-EFI_STATUS \r
+EFI_STATUS\r
EFIAPI\r
DnsUnload (\r
IN EFI_HANDLE ImageHandle\r
);\r
\r
/**\r
- Tests to see if this driver supports a given controller. If a child device is provided, \r
+ Tests to see if this driver supports a given controller. If a child device is provided,\r
it further tests to see if this driver supports creating a handle for the specified child device.\r
\r
- This function checks to see if the driver specified by This supports the device specified by \r
- ControllerHandle. Drivers will typically use the device path attached to \r
- ControllerHandle and/or the services from the bus I/O abstraction attached to \r
- ControllerHandle to determine if the driver supports ControllerHandle. This function \r
- may be called many times during platform initialization. In order to reduce boot times, the tests \r
- performed by this function must be very small, and take as little time as possible to execute. This \r
- function must not change the state of any hardware devices, and this function must be aware that the \r
- device specified by ControllerHandle may already be managed by the same driver or a \r
- different driver. This function must match its calls to AllocatePages() with FreePages(), \r
- AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). \r
- Because ControllerHandle may have been previously started by the same driver, if a protocol is \r
- already in the opened state, then it must not be closed with CloseProtocol(). This is required \r
+ This function checks to see if the driver specified by This supports the device specified by\r
+ ControllerHandle. Drivers will typically use the device path attached to\r
+ ControllerHandle and/or the services from the bus I/O abstraction attached to\r
+ ControllerHandle to determine if the driver supports ControllerHandle. This function\r
+ may be called many times during platform initialization. In order to reduce boot times, the tests\r
+ performed by this function must be very small, and take as little time as possible to execute. This\r
+ function must not change the state of any hardware devices, and this function must be aware that the\r
+ device specified by ControllerHandle may already be managed by the same driver or a\r
+ different driver. This function must match its calls to AllocatePages() with FreePages(),\r
+ AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r
+ Because ControllerHandle may have been previously started by the same driver, if a protocol is\r
+ already in the opened state, then it must not be closed with CloseProtocol(). This is required\r
to guarantee the state of ControllerHandle is not modified by this function.\r
\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle The handle of the controller to test. This handle \r
- must support a protocol interface that supplies \r
+ @param[in] ControllerHandle The handle of the controller to test. This handle\r
+ must support a protocol interface that supplies\r
an I/O abstraction to the driver.\r
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
- parameter is ignored by device drivers, and is optional for bus \r
- drivers. For bus drivers, if this parameter is not NULL, then \r
- the bus driver must determine if the bus controller specified \r
- by ControllerHandle and the child controller specified \r
- by RemainingDevicePath are both supported by this \r
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
+ parameter is ignored by device drivers, and is optional for bus\r
+ drivers. For bus drivers, if this parameter is not NULL, then\r
+ the bus driver must determine if the bus controller specified\r
+ by ControllerHandle and the child controller specified\r
+ by RemainingDevicePath are both supported by this\r
bus driver.\r
\r
@retval EFI_SUCCESS The device specified by ControllerHandle and\r
Starts a device controller or a bus controller.\r
\r
The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
- As a result, much of the error checking on the parameters to Start() has been moved into this \r
- common boot service. It is legal to call Start() from other locations, \r
+ As a result, much of the error checking on the parameters to Start() has been moved into this\r
+ common boot service. It is legal to call Start() from other locations,\r
but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
1. ControllerHandle must be a valid EFI_HANDLE.\r
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
EFI_DEVICE_PATH_PROTOCOL.\r
3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
- have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. \r
+ have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r
\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle The handle of the controller to start. This handle \r
- must support a protocol interface that supplies \r
+ @param[in] ControllerHandle The handle of the controller to start. This handle\r
+ must support a protocol interface that supplies\r
an I/O abstraction to the driver.\r
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
- parameter is ignored by device drivers, and is optional for bus \r
- drivers. For a bus driver, if this parameter is NULL, then handles \r
- for all the children of Controller are created by this driver. \r
- If this parameter is not NULL and the first Device Path Node is \r
- not the End of Device Path Node, then only the handle for the \r
- child device specified by the first Device Path Node of \r
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
+ parameter is ignored by device drivers, and is optional for bus\r
+ drivers. For a bus driver, if this parameter is NULL, then handles\r
+ for all the children of Controller are created by this driver.\r
+ If this parameter is not NULL and the first Device Path Node is\r
+ not the End of Device Path Node, then only the handle for the\r
+ child device specified by the first Device Path Node of\r
RemainingDevicePath is created by this driver.\r
- If the first Device Path Node of RemainingDevicePath is \r
+ If the first Device Path Node of RemainingDevicePath is\r
the End of Device Path Node, no child handle is created by this\r
driver.\r
\r
\r
/**\r
Stops a device controller or a bus controller.\r
- \r
- The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
- As a result, much of the error checking on the parameters to Stop() has been moved \r
- into this common boot service. It is legal to call Stop() from other locations, \r
+\r
+ The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r
+ As a result, much of the error checking on the parameters to Stop() has been moved\r
+ into this common boot service. It is legal to call Stop() from other locations,\r
but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
same driver's Start() function.\r
EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
Start() function, and the Start() function must have called OpenProtocol() on\r
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
- \r
+\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle A handle to the device being stopped. The handle must \r
- support a bus specific I/O protocol for the driver \r
+ @param[in] ControllerHandle A handle to the device being stopped. The handle must\r
+ support a bus specific I/O protocol for the driver\r
to use to stop the device.\r
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
- @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
if NumberOfChildren is 0.\r
\r
@retval EFI_SUCCESS The device was stopped.\r
);\r
\r
/**\r
- Tests to see if this driver supports a given controller. If a child device is provided, \r
+ Tests to see if this driver supports a given controller. If a child device is provided,\r
it further tests to see if this driver supports creating a handle for the specified child device.\r
\r
- This function checks to see if the driver specified by This supports the device specified by \r
- ControllerHandle. Drivers will typically use the device path attached to \r
- ControllerHandle and/or the services from the bus I/O abstraction attached to \r
- ControllerHandle to determine if the driver supports ControllerHandle. This function \r
- may be called many times during platform initialization. In order to reduce boot times, the tests \r
- performed by this function must be very small, and take as little time as possible to execute. This \r
- function must not change the state of any hardware devices, and this function must be aware that the \r
- device specified by ControllerHandle may already be managed by the same driver or a \r
- different driver. This function must match its calls to AllocatePages() with FreePages(), \r
- AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). \r
- Because ControllerHandle may have been previously started by the same driver, if a protocol is \r
- already in the opened state, then it must not be closed with CloseProtocol(). This is required \r
+ This function checks to see if the driver specified by This supports the device specified by\r
+ ControllerHandle. Drivers will typically use the device path attached to\r
+ ControllerHandle and/or the services from the bus I/O abstraction attached to\r
+ ControllerHandle to determine if the driver supports ControllerHandle. This function\r
+ may be called many times during platform initialization. In order to reduce boot times, the tests\r
+ performed by this function must be very small, and take as little time as possible to execute. This\r
+ function must not change the state of any hardware devices, and this function must be aware that the\r
+ device specified by ControllerHandle may already be managed by the same driver or a\r
+ different driver. This function must match its calls to AllocatePages() with FreePages(),\r
+ AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r
+ Because ControllerHandle may have been previously started by the same driver, if a protocol is\r
+ already in the opened state, then it must not be closed with CloseProtocol(). This is required\r
to guarantee the state of ControllerHandle is not modified by this function.\r
\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle The handle of the controller to test. This handle \r
- must support a protocol interface that supplies \r
+ @param[in] ControllerHandle The handle of the controller to test. This handle\r
+ must support a protocol interface that supplies\r
an I/O abstraction to the driver.\r
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
- parameter is ignored by device drivers, and is optional for bus \r
- drivers. For bus drivers, if this parameter is not NULL, then \r
- the bus driver must determine if the bus controller specified \r
- by ControllerHandle and the child controller specified \r
- by RemainingDevicePath are both supported by this \r
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
+ parameter is ignored by device drivers, and is optional for bus\r
+ drivers. For bus drivers, if this parameter is not NULL, then\r
+ the bus driver must determine if the bus controller specified\r
+ by ControllerHandle and the child controller specified\r
+ by RemainingDevicePath are both supported by this\r
bus driver.\r
\r
@retval EFI_SUCCESS The device specified by ControllerHandle and\r
Starts a device controller or a bus controller.\r
\r
The Start() function is designed to be invoked from the EFI boot service ConnectController().\r
- As a result, much of the error checking on the parameters to Start() has been moved into this \r
- common boot service. It is legal to call Start() from other locations, \r
+ As a result, much of the error checking on the parameters to Start() has been moved into this\r
+ common boot service. It is legal to call Start() from other locations,\r
but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
1. ControllerHandle must be a valid EFI_HANDLE.\r
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
EFI_DEVICE_PATH_PROTOCOL.\r
3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
- have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. \r
+ have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r
\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle The handle of the controller to start. This handle \r
- must support a protocol interface that supplies \r
+ @param[in] ControllerHandle The handle of the controller to start. This handle\r
+ must support a protocol interface that supplies\r
an I/O abstraction to the driver.\r
- @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This \r
- parameter is ignored by device drivers, and is optional for bus \r
- drivers. For a bus driver, if this parameter is NULL, then handles \r
- for all the children of Controller are created by this driver. \r
- If this parameter is not NULL and the first Device Path Node is \r
- not the End of Device Path Node, then only the handle for the \r
- child device specified by the first Device Path Node of \r
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r
+ parameter is ignored by device drivers, and is optional for bus\r
+ drivers. For a bus driver, if this parameter is NULL, then handles\r
+ for all the children of Controller are created by this driver.\r
+ If this parameter is not NULL and the first Device Path Node is\r
+ not the End of Device Path Node, then only the handle for the\r
+ child device specified by the first Device Path Node of\r
RemainingDevicePath is created by this driver.\r
- If the first Device Path Node of RemainingDevicePath is \r
+ If the first Device Path Node of RemainingDevicePath is\r
the End of Device Path Node, no child handle is created by this\r
driver.\r
\r
\r
/**\r
Stops a device controller or a bus controller.\r
- \r
- The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). \r
- As a result, much of the error checking on the parameters to Stop() has been moved \r
- into this common boot service. It is legal to call Stop() from other locations, \r
+\r
+ The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r
+ As a result, much of the error checking on the parameters to Stop() has been moved\r
+ into this common boot service. It is legal to call Stop() from other locations,\r
but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
same driver's Start() function.\r
EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
Start() function, and the Start() function must have called OpenProtocol() on\r
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
- \r
+\r
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param[in] ControllerHandle A handle to the device being stopped. The handle must \r
- support a bus specific I/O protocol for the driver \r
+ @param[in] ControllerHandle A handle to the device being stopped. The handle must\r
+ support a bus specific I/O protocol for the driver\r
to use to stop the device.\r
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
- @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
if NumberOfChildren is 0.\r
\r
@retval EFI_SUCCESS The device was stopped.\r
\r
/**\r
Creates a child handle and installs a protocol.\r
- \r
- The CreateChild() function installs a protocol on ChildHandle. \r
- If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. \r
+\r
+ The CreateChild() function installs a protocol on ChildHandle.\r
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
\r
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
- then a new handle is created. If it is a pointer to an existing UEFI handle, \r
+ then a new handle is created. If it is a pointer to an existing UEFI handle,\r
then the protocol is added to the existing UEFI handle.\r
\r
@retval EFI_SUCCES The protocol was added to ChildHandle.\r
\r
/**\r
Destroys a child handle with a protocol installed on it.\r
- \r
- The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r
- that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r
+\r
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r
last protocol on ChildHandle, then ChildHandle is destroyed.\r
\r
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
\r
/**\r
Creates a child handle and installs a protocol.\r
- \r
- The CreateChild() function installs a protocol on ChildHandle. \r
- If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. \r
+\r
+ The CreateChild() function installs a protocol on ChildHandle.\r
+ If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
\r
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
@param[in] ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
- then a new handle is created. If it is a pointer to an existing UEFI handle, \r
+ then a new handle is created. If it is a pointer to an existing UEFI handle,\r
then the protocol is added to the existing UEFI handle.\r
\r
@retval EFI_SUCCES The protocol was added to ChildHandle.\r
\r
/**\r
Destroys a child handle with a protocol installed on it.\r
- \r
- The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r
- that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r
+\r
+ The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r
+ that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r
last protocol on ChildHandle, then ChildHandle is destroyed.\r
\r
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
## @file\r
# Implementation of EFI_DNS4_PROTOCOL and EFI_DNS6_PROTOCOL interfaces.\r
#\r
-# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
DnsProtocol.c\r
DnsDhcp.h\r
DnsDhcp.c\r
- \r
- \r
+\r
+\r
[LibraryClasses]\r
BaseLib\r
UefiLib\r
DpcLib\r
PrintLib\r
UdpIoLib\r
- \r
+\r
\r
[Protocols]\r
gEfiDns4ServiceBindingProtocolGuid ## BY_START\r
gEfiIp4Config2ProtocolGuid ## SOMETIMES_CONSUMES\r
gEfiManagedNetworkServiceBindingProtocolGuid ## SOMETIMES_CONSUMES\r
gEfiManagedNetworkProtocolGuid ## SOMETIMES_CONSUMES\r
- \r
+\r
gEfiDns6ServiceBindingProtocolGuid ## BY_START\r
gEfiDns6ProtocolGuid ## BY_START\r
gEfiUdp6ServiceBindingProtocolGuid ## TO_START\r
// UEFI DNS DXE Driver.\r
//\r
// This driver provides UEFI 2.5 DNS protocols. It could work with an IPv4 and IPv6 stack.\r
-// \r
//\r
-// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+//\r
+// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
// http://opensource.org/licenses/bsd-license.php.\r
-// \r
+//\r
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
// /** @file\r
// DnsDxe Localized Strings and Content\r
//\r
-// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
//\r
// **/\r
\r
-#string STR_PROPERTIES_MODULE_NAME \r
-#language en-US \r
+#string STR_PROPERTIES_MODULE_NAME\r
+#language en-US\r
"UEFI DNS DXE"\r
\r
\r
/** @file\r
DnsDxe support functions implementation.\r
- \r
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
+\r
+Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
return EFI_SUCCESS;\r
}\r
- \r
+\r
return EFI_NOT_FOUND;\r
}\r
\r
\r
@retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.\r
@retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.\r
- \r
+\r
**/\r
EFI_STATUS\r
Dns6RemoveTokenEntry (\r
\r
return EFI_SUCCESS;\r
}\r
- \r
+\r
return EFI_NOT_FOUND;\r
}\r
\r
EFIAPI\r
GetDns4TokenEntry (\r
IN NET_MAP *TokensMap,\r
- IN EFI_DNS4_COMPLETION_TOKEN *Token, \r
+ IN EFI_DNS4_COMPLETION_TOKEN *Token,\r
OUT DNS4_TOKEN_ENTRY **TokenEntry\r
)\r
{\r
LIST_ENTRY *Entry;\r
- \r
+\r
NET_MAP_ITEM *Item;\r
- \r
+\r
NET_LIST_FOR_EACH (Entry, &TokensMap->Used) {\r
Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link);\r
- *TokenEntry = (DNS4_TOKEN_ENTRY *) (Item->Key); \r
+ *TokenEntry = (DNS4_TOKEN_ENTRY *) (Item->Key);\r
if ((*TokenEntry)->Token == Token) {\r
return EFI_SUCCESS;\r
}\r
}\r
- \r
+\r
*TokenEntry = NULL;\r
- \r
+\r
return EFI_NOT_FOUND;\r
}\r
\r
EFIAPI\r
GetDns6TokenEntry (\r
IN NET_MAP *TokensMap,\r
- IN EFI_DNS6_COMPLETION_TOKEN *Token, \r
+ IN EFI_DNS6_COMPLETION_TOKEN *Token,\r
OUT DNS6_TOKEN_ENTRY **TokenEntry\r
)\r
{\r
LIST_ENTRY *Entry;\r
- \r
+\r
NET_MAP_ITEM *Item;\r
- \r
+\r
NET_LIST_FOR_EACH (Entry, &TokensMap->Used) {\r
Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link);\r
- *TokenEntry = (DNS6_TOKEN_ENTRY *) (Item->Key); \r
+ *TokenEntry = (DNS6_TOKEN_ENTRY *) (Item->Key);\r
if ((*TokenEntry)->Token == Token) {\r
return EFI_SUCCESS;\r
}\r
}\r
- \r
+\r
*TokenEntry =NULL;\r
- \r
+\r
return EFI_NOT_FOUND;\r
}\r
\r
}\r
\r
ASSERT ((TokenEntry != NULL) || (0 == NetMapGetCount (&Instance->Dns4TxTokens)));\r
- \r
+\r
if (NetMapIsEmpty (&Instance->Dns4TxTokens)) {\r
Instance->UdpIo->Protocol.Udp4->Cancel (Instance->UdpIo->Protocol.Udp4, &Instance->UdpIo->RecvRequest->Token.Udp4);\r
}\r
}\r
\r
ASSERT ((TokenEntry != NULL) || (0 == NetMapGetCount (&Instance->Dns6TxTokens)));\r
- \r
+\r
if (NetMapIsEmpty (&Instance->Dns6TxTokens)) {\r
Instance->UdpIo->Protocol.Udp6->Cancel (Instance->UdpIo->Protocol.Udp6, &Instance->UdpIo->RecvRequest->Token.Udp6);\r
}\r
\r
/**\r
Poll the UDP to get the IP4 default address, which may be retrieved\r
- by DHCP. \r
- \r
- The default time out value is 5 seconds. If IP has retrieved the default address, \r
+ by DHCP.\r
+\r
+ The default time out value is 5 seconds. If IP has retrieved the default address,\r
the UDP is reconfigured.\r
\r
@param Instance The DNS instance\r
\r
/**\r
Configure the UDP.\r
- \r
+\r
@param Instance The DNS session\r
@param UdpIo The UDP_IO instance\r
- \r
+\r
@retval EFI_SUCCESS The UDP is successfully configured for the\r
session.\r
\r
if ((Status == EFI_NO_MAPPING) && Dns4GetMapping (Instance, UdpIo, &UdpConfig)) {\r
return EFI_SUCCESS;\r
}\r
- \r
+\r
return Status;\r
}\r
\r
/**\r
Configure the UDP.\r
- \r
+\r
@param Instance The DNS session\r
@param UdpIo The UDP_IO instance\r
\r
if ((Status == EFI_NO_MAPPING) && Dns6GetMapping (Instance, UdpIo, &UdpConfig)) {\r
return EFI_SUCCESS;\r
}\r
- \r
+\r
return Status;\r
}\r
\r
/**\r
Update Dns4 cache to shared list of caches of all DNSv4 instances.\r
- \r
+\r
@param Dns4CacheList All Dns4 cache list.\r
- @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache. \r
- If TRUE, this function will delete matching DNS Cache entry. \r
- @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter. \r
+ @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.\r
+ If TRUE, this function will delete matching DNS Cache entry.\r
+ @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.\r
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.\r
@param DnsCacheEntry Entry Pointer to DNS Cache entry.\r
\r
@retval EFI_SUCCESS Update Dns4 cache successfully.\r
- @retval Others Failed to update Dns4 cache. \r
- \r
-**/ \r
+ @retval Others Failed to update Dns4 cache.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
UpdateDns4Cache (\r
IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry\r
)\r
{\r
- DNS4_CACHE *NewDnsCache; \r
+ DNS4_CACHE *NewDnsCache;\r
DNS4_CACHE *Item;\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *Next;\r
\r
NewDnsCache = NULL;\r
Item = NULL;\r
- \r
+\r
//\r
// Search the database for the matching EFI_DNS_CACHE_ENTRY\r
//\r
FreePool (Item->DnsCache.HostName);\r
FreePool (Item->DnsCache.IpAddress);\r
FreePool (Item);\r
- \r
+\r
return EFI_SUCCESS;\r
} else if (Override) {\r
//\r
// Update this one\r
//\r
Item->DnsCache.Timeout = DnsCacheEntry.Timeout;\r
- \r
+\r
return EFI_SUCCESS;\r
}else {\r
return EFI_ACCESS_DENIED;\r
// Add new one\r
//\r
NewDnsCache = AllocatePool (sizeof (DNS4_CACHE));\r
- if (NewDnsCache == NULL) { \r
+ if (NewDnsCache == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
InitializeListHead (&NewDnsCache->AllCacheLink);\r
- \r
+\r
NewDnsCache->DnsCache.HostName = AllocatePool (StrSize (DnsCacheEntry.HostName));\r
- if (NewDnsCache->DnsCache.HostName == NULL) { \r
+ if (NewDnsCache->DnsCache.HostName == NULL) {\r
FreePool (NewDnsCache);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
CopyMem (NewDnsCache->DnsCache.HostName, DnsCacheEntry.HostName, StrSize (DnsCacheEntry.HostName));\r
\r
NewDnsCache->DnsCache.IpAddress = AllocatePool (sizeof (EFI_IPv4_ADDRESS));\r
CopyMem (NewDnsCache->DnsCache.IpAddress, DnsCacheEntry.IpAddress, sizeof (EFI_IPv4_ADDRESS));\r
\r
NewDnsCache->DnsCache.Timeout = DnsCacheEntry.Timeout;\r
- \r
+\r
InsertTailList (Dns4CacheList, &NewDnsCache->AllCacheLink);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
- Update Dns6 cache to shared list of caches of all DNSv6 instances. \r
+ Update Dns6 cache to shared list of caches of all DNSv6 instances.\r
\r
@param Dns6CacheList All Dns6 cache list.\r
- @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache. \r
- If TRUE, this function will delete matching DNS Cache entry. \r
- @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter. \r
+ @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.\r
+ If TRUE, this function will delete matching DNS Cache entry.\r
+ @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.\r
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.\r
@param DnsCacheEntry Entry Pointer to DNS Cache entry.\r
- \r
+\r
@retval EFI_SUCCESS Update Dns6 cache successfully.\r
@retval Others Failed to update Dns6 cache.\r
-**/ \r
+**/\r
EFI_STATUS\r
EFIAPI\r
UpdateDns6Cache (\r
IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry\r
)\r
{\r
- DNS6_CACHE *NewDnsCache; \r
+ DNS6_CACHE *NewDnsCache;\r
DNS6_CACHE *Item;\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *Next;\r
\r
NewDnsCache = NULL;\r
Item = NULL;\r
- \r
+\r
//\r
// Search the database for the matching EFI_DNS_CACHE_ENTRY\r
//\r
// Delete matching DNS Cache entry\r
//\r
RemoveEntryList (&Item->AllCacheLink);\r
- \r
+\r
FreePool (Item->DnsCache.HostName);\r
FreePool (Item->DnsCache.IpAddress);\r
FreePool (Item);\r
- \r
+\r
return EFI_SUCCESS;\r
} else if (Override) {\r
//\r
// Update this one\r
//\r
Item->DnsCache.Timeout = DnsCacheEntry.Timeout;\r
- \r
+\r
return EFI_SUCCESS;\r
}else {\r
return EFI_ACCESS_DENIED;\r
// Add new one\r
//\r
NewDnsCache = AllocatePool (sizeof (DNS6_CACHE));\r
- if (NewDnsCache == NULL) { \r
+ if (NewDnsCache == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
InitializeListHead (&NewDnsCache->AllCacheLink);\r
- \r
+\r
NewDnsCache->DnsCache.HostName = AllocatePool (StrSize (DnsCacheEntry.HostName));\r
- if (NewDnsCache->DnsCache.HostName == NULL) { \r
+ if (NewDnsCache->DnsCache.HostName == NULL) {\r
FreePool (NewDnsCache);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
CopyMem (NewDnsCache->DnsCache.HostName, DnsCacheEntry.HostName, StrSize (DnsCacheEntry.HostName));\r
\r
NewDnsCache->DnsCache.IpAddress = AllocatePool (sizeof (EFI_IPv6_ADDRESS));\r
FreePool (NewDnsCache);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
CopyMem (NewDnsCache->DnsCache.IpAddress, DnsCacheEntry.IpAddress, sizeof (EFI_IPv6_ADDRESS));\r
\r
NewDnsCache->DnsCache.Timeout = DnsCacheEntry.Timeout;\r
- \r
+\r
InsertTailList (Dns6CacheList, &NewDnsCache->AllCacheLink);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
- Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server. \r
+ Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.\r
\r
- @param Dns4ServerList Common list of addresses of all configured DNSv4 server. \r
- @param ServerIp DNS server Ip. \r
+ @param Dns4ServerList Common list of addresses of all configured DNSv4 server.\r
+ @param ServerIp DNS server Ip.\r
\r
@retval EFI_SUCCESS Add Dns4 ServerIp to common list successfully.\r
@retval Others Failed to add Dns4 ServerIp to common list.\r
- \r
-**/ \r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
AddDns4ServerIp (\r
IN EFI_IPv4_ADDRESS ServerIp\r
)\r
{\r
- DNS4_SERVER_IP *NewServerIp; \r
+ DNS4_SERVER_IP *NewServerIp;\r
DNS4_SERVER_IP *Item;\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *Next;\r
\r
NewServerIp = NULL;\r
Item = NULL;\r
- \r
+\r
//\r
// Search the database for the matching ServerIp\r
//\r
if (CompareMem (&Item->Dns4ServerIp, &ServerIp, sizeof (EFI_IPv4_ADDRESS)) == 0) {\r
//\r
// Already done.\r
- // \r
+ //\r
return EFI_SUCCESS;\r
}\r
}\r
// Add new one\r
//\r
NewServerIp = AllocatePool (sizeof (DNS4_SERVER_IP));\r
- if (NewServerIp == NULL) { \r
+ if (NewServerIp == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
InitializeListHead (&NewServerIp->AllServerLink);\r
- \r
+\r
CopyMem (&NewServerIp->Dns4ServerIp, &ServerIp, sizeof (EFI_IPv4_ADDRESS));\r
- \r
+\r
InsertTailList (Dns4ServerList, &NewServerIp->AllServerLink);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
- Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server. \r
+ Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.\r
\r
- @param Dns6ServerList Common list of addresses of all configured DNSv6 server. \r
- @param ServerIp DNS server Ip. \r
+ @param Dns6ServerList Common list of addresses of all configured DNSv6 server.\r
+ @param ServerIp DNS server Ip.\r
\r
@retval EFI_SUCCESS Add Dns6 ServerIp to common list successfully.\r
@retval Others Failed to add Dns6 ServerIp to common list.\r
- \r
-**/ \r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
AddDns6ServerIp (\r
IN EFI_IPv6_ADDRESS ServerIp\r
)\r
{\r
- DNS6_SERVER_IP *NewServerIp; \r
+ DNS6_SERVER_IP *NewServerIp;\r
DNS6_SERVER_IP *Item;\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *Next;\r
\r
NewServerIp = NULL;\r
Item = NULL;\r
- \r
+\r
//\r
// Search the database for the matching ServerIp\r
//\r
if (CompareMem (&Item->Dns6ServerIp, &ServerIp, sizeof (EFI_IPv6_ADDRESS)) == 0) {\r
//\r
// Already done.\r
- // \r
+ //\r
return EFI_SUCCESS;\r
}\r
}\r
// Add new one\r
//\r
NewServerIp = AllocatePool (sizeof (DNS6_SERVER_IP));\r
- if (NewServerIp == NULL) { \r
+ if (NewServerIp == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
InitializeListHead (&NewServerIp->AllServerLink);\r
- \r
+\r
CopyMem (&NewServerIp->Dns6ServerIp, &ServerIp, sizeof (EFI_IPv6_ADDRESS));\r
- \r
+\r
InsertTailList (Dns6ServerList, &NewServerIp->AllServerLink);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
Find out whether the response is valid or invalid.\r
\r
- @param TokensMap All DNS transmittal Tokens entry. \r
- @param Identification Identification for queried packet. \r
+ @param TokensMap All DNS transmittal Tokens entry.\r
+ @param Identification Identification for queried packet.\r
@param Type Type for queried packet.\r
@param Class Class for queried packet.\r
@param Item Return corresponding Token entry.\r
\r
@retval TRUE The response is valid.\r
@retval FALSE The response is invalid.\r
- \r
-**/ \r
+\r
+**/\r
BOOLEAN\r
IsValidDnsResponse (\r
IN NET_MAP *TokensMap,\r
*Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link);\r
Packet = (NET_BUF *) ((*Item)->Value);\r
if (Packet == NULL){\r
- \r
+\r
continue;\r
} else {\r
TxString = NetbufGetByte (Packet, 0, NULL);\r
DnsHeader = (DNS_HEADER *) TxString;\r
QueryName = (CHAR8 *) (TxString + sizeof (*DnsHeader));\r
QuerySection = (DNS_QUERY_SECTION *) (QueryName + AsciiStrLen (QueryName) + 1);\r
- \r
+\r
if (NTOHS (DnsHeader->Identification) == Identification &&\r
- NTOHS (QuerySection->Type) == Type && \r
+ NTOHS (QuerySection->Type) == Type &&\r
NTOHS (QuerySection->Class) == Class) {\r
return TRUE;\r
}\r
- } \r
+ }\r
}\r
- \r
+\r
*Item = NULL;\r
- \r
+\r
return FALSE;\r
}\r
\r
\r
@param Instance The DNS instance\r
@param RxString Received buffer.\r
- @param Completed Flag to indicate that Dns response is valid. \r
- \r
+ @param Completed Flag to indicate that Dns response is valid.\r
+\r
@retval EFI_SUCCESS Parse Dns Response successfully.\r
@retval Others Failed to parse Dns Response.\r
- \r
-**/ \r
+\r
+**/\r
EFI_STATUS\r
ParseDnsResponse (\r
IN OUT DNS_INSTANCE *Instance,\r
)\r
{\r
DNS_HEADER *DnsHeader;\r
- \r
+\r
CHAR8 *QueryName;\r
DNS_QUERY_SECTION *QuerySection;\r
- \r
+\r
CHAR8 *AnswerName;\r
DNS_ANSWER_SECTION *AnswerSection;\r
UINT8 *AnswerData;\r
NET_MAP_ITEM *Item;\r
DNS4_TOKEN_ENTRY *Dns4TokenEntry;\r
DNS6_TOKEN_ENTRY *Dns6TokenEntry;\r
- \r
+\r
UINT32 IpCount;\r
UINT32 RRCount;\r
UINT32 AnswerSectionNum;\r
UINT32 CNameTtl;\r
- \r
+\r
EFI_IPv4_ADDRESS *HostAddr4;\r
EFI_IPv6_ADDRESS *HostAddr6;\r
\r
EFI_STATUS Status;\r
\r
EFI_TPL OldTpl;\r
- \r
+\r
Item = NULL;\r
Dns4TokenEntry = NULL;\r
Dns6TokenEntry = NULL;\r
- \r
+\r
IpCount = 0;\r
RRCount = 0;\r
AnswerSectionNum = 0;\r
CNameTtl = 0;\r
- \r
+\r
HostAddr4 = NULL;\r
HostAddr6 = NULL;\r
- \r
+\r
Dns4CacheEntry = NULL;\r
Dns6CacheEntry = NULL;\r
- \r
+\r
Dns4RR = NULL;\r
Dns6RR = NULL;\r
\r
*Completed = TRUE;\r
Status = EFI_SUCCESS;\r
- \r
+\r
//\r
// Get header\r
//\r
DnsHeader = (DNS_HEADER *) RxString;\r
- \r
+\r
DnsHeader->Identification = NTOHS (DnsHeader->Identification);\r
DnsHeader->Flags.Uint16 = NTOHS (DnsHeader->Flags.Uint16);\r
DnsHeader->QuestionsNum = NTOHS (DnsHeader->QuestionsNum);\r
//\r
if (Instance->Service->IpVersion == IP_VERSION_4) {\r
if (!IsValidDnsResponse (\r
- &Instance->Dns4TxTokens, \r
- DnsHeader->Identification, \r
+ &Instance->Dns4TxTokens,\r
+ DnsHeader->Identification,\r
QuerySection->Type,\r
QuerySection->Class,\r
&Item\r
Dns4TokenEntry = (DNS4_TOKEN_ENTRY *) (Item->Key);\r
} else {\r
if (!IsValidDnsResponse (\r
- &Instance->Dns6TxTokens, \r
- DnsHeader->Identification, \r
+ &Instance->Dns6TxTokens,\r
+ DnsHeader->Identification,\r
QuerySection->Type,\r
QuerySection->Class,\r
&Item\r
ASSERT (Item != NULL);\r
Dns6TokenEntry = (DNS6_TOKEN_ENTRY *) (Item->Key);\r
}\r
- \r
+\r
//\r
// Continue Check Some Errors.\r
//\r
// The domain name referenced in the query does not exist.\r
//\r
if (DnsHeader->Flags.Bits.RCode == DNS_FLAGS_RCODE_NAME_ERROR) {\r
- Status = EFI_NOT_FOUND; \r
+ Status = EFI_NOT_FOUND;\r
} else {\r
Status = EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
goto ON_COMPLETE;\r
}\r
- \r
+\r
//\r
// Do some buffer allocations.\r
//\r
Status = EFI_UNSUPPORTED;\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// Get Answer section.\r
//\r
goto ON_EXIT;\r
}\r
CopyMem (Dns4RR[RRCount].RData, AnswerData, Dns4RR[RRCount].DataLength);\r
- \r
+\r
RRCount ++;\r
Status = EFI_SUCCESS;\r
} else if (Instance->Service->IpVersion == IP_VERSION_6 && Dns6TokenEntry->GeneralLookUp) {\r
goto ON_EXIT;\r
}\r
CopyMem (Dns6RR[RRCount].RData, AnswerData, Dns6RR[RRCount].DataLength);\r
- \r
+\r
RRCount ++;\r
Status = EFI_SUCCESS;\r
} else {\r
//\r
- // It's not the GeneralLookUp querying. \r
+ // It's not the GeneralLookUp querying.\r
// Check the Query type, parse the response packet.\r
//\r
switch (AnswerSection->Type) {\r
Status = EFI_ABORTED;\r
goto ON_EXIT;\r
}\r
- \r
+\r
HostAddr4 = Dns4TokenEntry->Token->RspData.H2AData->IpList;\r
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);\r
CopyMem (&HostAddr4[IpCount], AnswerData, sizeof (EFI_IPv4_ADDRESS));\r
\r
- // \r
+ //\r
// Allocate new CacheEntry pool to update DNS cache dynamically.\r
//\r
Dns4CacheEntry = AllocateZeroPool (sizeof (EFI_DNS4_CACHE_ENTRY));\r
} else {\r
Dns4CacheEntry->Timeout = MAX (CNameTtl, AnswerSection->Ttl);\r
}\r
- \r
+\r
UpdateDns4Cache (&mDriverData->Dns4CacheList, FALSE, TRUE, *Dns4CacheEntry);\r
\r
- // \r
+ //\r
// Free allocated CacheEntry pool.\r
//\r
FreePool (Dns4CacheEntry->HostName);\r
Dns4CacheEntry->HostName = NULL;\r
- \r
+\r
FreePool (Dns4CacheEntry->IpAddress);\r
Dns4CacheEntry->IpAddress = NULL;\r
\r
Status = EFI_ABORTED;\r
goto ON_EXIT;\r
}\r
- \r
+\r
HostAddr6 = Dns6TokenEntry->Token->RspData.H2AData->IpList;\r
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);\r
CopyMem (&HostAddr6[IpCount], AnswerData, sizeof (EFI_IPv6_ADDRESS));\r
\r
- // \r
+ //\r
// Allocate new CacheEntry pool to update DNS cache dynamically.\r
//\r
Dns6CacheEntry = AllocateZeroPool (sizeof (EFI_DNS6_CACHE_ENTRY));\r
} else {\r
Dns6CacheEntry->Timeout = MAX (CNameTtl, AnswerSection->Ttl);\r
}\r
- \r
+\r
UpdateDns6Cache (&mDriverData->Dns6CacheList, FALSE, TRUE, *Dns6CacheEntry);\r
\r
- // \r
+ //\r
// Free allocated CacheEntry pool.\r
//\r
FreePool (Dns6CacheEntry->HostName);\r
Dns6CacheEntry->HostName = NULL;\r
- \r
+\r
FreePool (Dns6CacheEntry->IpAddress);\r
Dns6CacheEntry->IpAddress = NULL;\r
\r
FreePool (Dns6CacheEntry);\r
Dns6CacheEntry = NULL;\r
- \r
+\r
IpCount ++;\r
Status = EFI_SUCCESS;\r
break;\r
case DNS_TYPE_CNAME:\r
//\r
- // According RFC 1034 - 3.6.2, if the query name is an alias, the name server will include the CNAME \r
- // record in the response and restart the query at the domain name specified in the data field of the \r
+ // According RFC 1034 - 3.6.2, if the query name is an alias, the name server will include the CNAME\r
+ // record in the response and restart the query at the domain name specified in the data field of the\r
// CNAME record. So, just record the TTL value of the CNAME, then skip to parse the next record.\r
//\r
CNameTtl = AnswerSection->Ttl;\r
goto ON_EXIT;\r
}\r
}\r
- \r
+\r
//\r
// Find next one\r
//\r
\r
if (Instance->Service->IpVersion == IP_VERSION_4) {\r
ASSERT (Dns4TokenEntry != NULL);\r
- \r
+\r
if (Dns4TokenEntry->GeneralLookUp) {\r
Dns4TokenEntry->Token->RspData.GLookupData->RRCount = RRCount;\r
} else {\r
}\r
}\r
}\r
- \r
+\r
ON_COMPLETE:\r
//\r
// Parsing is complete, free the sending packet and signal Event here.\r
if (Item != NULL && Item->Value != NULL) {\r
NetbufFree ((NET_BUF *) (Item->Value));\r
}\r
- \r
+\r
if (Instance->Service->IpVersion == IP_VERSION_4) {\r
ASSERT (Dns4TokenEntry != NULL);\r
Dns4RemoveTokenEntry (&Instance->Dns4TxTokens, Dns4TokenEntry);\r
FreePool (Dns4TokenEntry->Token->RspData.GLookupData->RRList[RRCount].RData);\r
}\r
}\r
- \r
+\r
FreePool (Dns4TokenEntry->Token->RspData.GLookupData->RRList);\r
}\r
- \r
+\r
FreePool (Dns4TokenEntry->Token->RspData.GLookupData);\r
}\r
} else {\r
if (Dns4TokenEntry->Token->RspData.H2AData->IpList != NULL) {\r
FreePool (Dns4TokenEntry->Token->RspData.H2AData->IpList);\r
}\r
- \r
+\r
FreePool (Dns4TokenEntry->Token->RspData.H2AData);\r
}\r
}\r
FreePool (Dns6TokenEntry->Token->RspData.GLookupData->RRList[RRCount].RData);\r
}\r
}\r
- \r
+\r
FreePool (Dns6TokenEntry->Token->RspData.GLookupData->RRList);\r
}\r
- \r
+\r
FreePool (Dns6TokenEntry->Token->RspData.GLookupData);\r
}\r
} else {\r
if (Dns6TokenEntry->Token->RspData.H2AData->IpList != NULL) {\r
FreePool (Dns6TokenEntry->Token->RspData.H2AData->IpList);\r
}\r
- \r
+\r
FreePool (Dns6TokenEntry->Token->RspData.H2AData);\r
}\r
}\r
}\r
\r
FreePool (Dns6CacheEntry);\r
- } \r
+ }\r
}\r
- \r
+\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
@param IoStatus The status of the UDP receive\r
@param Context The opaque parameter to the function.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DnsOnPacketReceived (\r
UINT8 *RcvString;\r
\r
BOOLEAN Completed;\r
- \r
+\r
Instance = (DNS_INSTANCE *) Context;\r
NET_CHECK_SIGNATURE (Instance, DNS_INSTANCE_SIGNATURE);\r
\r
if (Packet->TotalSize <= sizeof (DNS_HEADER)) {\r
goto ON_EXIT;\r
}\r
- \r
+\r
RcvString = NetbufGetByte (Packet, 0, NULL);\r
ASSERT (RcvString != NULL);\r
- \r
+\r
//\r
// Parse Dns Response\r
//\r
}\r
}\r
}\r
- \r
+\r
NetbufFree (Packet);\r
}\r
\r
return Status;\r
}\r
}\r
- \r
+\r
//\r
// Transmit the DNS packet.\r
//\r
NET_GET_REF (Packet);\r
\r
Status = UdpIoSendDatagram (Instance->UdpIo, Packet, NULL, NULL, DnsOnPacketSent, Instance);\r
- \r
+\r
return Status;\r
}\r
\r
Construct the Packet according query section.\r
\r
@param Instance The DNS instance\r
- @param QueryName Queried Name \r
- @param Type Queried Type \r
- @param Class Queried Class \r
+ @param QueryName Queried Name\r
+ @param Type Queried Type\r
+ @param Class Queried Class\r
@param Packet The packet for query\r
\r
@retval EFI_SUCCESS The packet is constructed.\r
//\r
// Fill header\r
//\r
- DnsHeader = (DNS_HEADER *) Frag.Bulk; \r
+ DnsHeader = (DNS_HEADER *) Frag.Bulk;\r
DnsHeader->Identification = (UINT16)NET_RANDOM (NetRandomInitSeed());\r
DnsHeader->Flags.Uint16 = 0x0000;\r
DnsHeader->Flags.Bits.RD = 1;\r
Frag.Len = (UINT32) (Frag.Len + AsciiStrLen (QueryName));\r
*(Frag.Bulk + Frag.Len) = 0;\r
Frag.Len ++;\r
- \r
+\r
//\r
// Rest query section\r
//\r
FreePool (Frag.Bulk);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
//\r
// Store the UdpIo in ProtoData.\r
//\r
Retransmit the packet.\r
\r
@param Instance The DNS instance\r
- @param Packet Retransmit the packet \r
+ @param Packet Retransmit the packet\r
\r
@retval EFI_SUCCESS The packet is retransmitted.\r
@retval Others Failed to retransmit.\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
UINT8 *Buffer;\r
\r
ASSERT (Packet != NULL);\r
Dns4TokenEntry->Token->Status = EFI_TIMEOUT;\r
gBS->SignalEvent (Dns4TokenEntry->Token->Event);\r
DispatchDpc ();\r
- \r
+\r
//\r
// Free the sending packet.\r
//\r
EntryNetMap = Instance->Dns4TxTokens.Used.ForwardLink;\r
}\r
}\r
- } \r
+ }\r
}else {\r
//\r
// Iterate through all the children of the DNS service instance. Time\r
//\r
NET_LIST_FOR_EACH_SAFE (Entry, Next, &Service->Dns6ChildrenList) {\r
Instance = NET_LIST_USER_STRUCT (Entry, DNS_INSTANCE, Link);\r
- \r
+\r
EntryNetMap = Instance->Dns6TxTokens.Used.ForwardLink;\r
while (EntryNetMap != &Instance->Dns6TxTokens.Used) {\r
ItemNetMap = NET_LIST_USER_STRUCT (EntryNetMap, NET_MAP_ITEM, Link);\r
Dns6TokenEntry->Token->Status = EFI_TIMEOUT;\r
gBS->SignalEvent (Dns6TokenEntry->Token->Event);\r
DispatchDpc ();\r
- \r
+\r
//\r
// Free the sending packet.\r
//\r
}\r
\r
EntryNetMap = Instance->Dns6TxTokens.Used.ForwardLink;\r
- } \r
+ }\r
}\r
}\r
- } \r
+ }\r
}\r
\r
/**\r
Item4 = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);\r
Item4->DnsCache.Timeout--;\r
}\r
- \r
+\r
Entry = mDriverData->Dns4CacheList.ForwardLink;\r
while (Entry != &mDriverData->Dns4CacheList) {\r
Item4 = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);\r
Entry = Entry->ForwardLink;\r
}\r
}\r
- \r
+\r
//\r
// Iterate through all the DNS6 cache list.\r
//\r
Item6 = NET_LIST_USER_STRUCT (Entry, DNS6_CACHE, AllCacheLink);\r
Item6->DnsCache.Timeout--;\r
}\r
- \r
+\r
Entry = mDriverData->Dns6CacheList.ForwardLink;\r
while (Entry != &mDriverData->Dns6CacheList) {\r
Item6 = NET_LIST_USER_STRUCT (Entry, DNS6_CACHE, AllCacheLink);\r
/** @file\r
DnsDxe support functions implementation.\r
- \r
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+\r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
typedef struct {\r
LIST_ENTRY AllCacheLink;\r
- EFI_DNS4_CACHE_ENTRY DnsCache; \r
+ EFI_DNS4_CACHE_ENTRY DnsCache;\r
} DNS4_CACHE;\r
\r
typedef struct {\r
LIST_ENTRY AllCacheLink;\r
- EFI_DNS6_CACHE_ENTRY DnsCache; \r
+ EFI_DNS6_CACHE_ENTRY DnsCache;\r
} DNS6_CACHE;\r
\r
typedef struct {\r
LIST_ENTRY AllServerLink;\r
- EFI_IPv4_ADDRESS Dns4ServerIp; \r
+ EFI_IPv4_ADDRESS Dns4ServerIp;\r
} DNS4_SERVER_IP;\r
\r
typedef struct {\r
LIST_ENTRY AllServerLink;\r
- EFI_IPv6_ADDRESS Dns6ServerIp; \r
+ EFI_IPv6_ADDRESS Dns6ServerIp;\r
} DNS6_SERVER_IP;\r
\r
typedef struct {\r
\r
@retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.\r
@retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.\r
- \r
+\r
**/\r
EFI_STATUS\r
Dns6RemoveTokenEntry (\r
EFIAPI\r
GetDns4TokenEntry (\r
IN NET_MAP *TokensMap,\r
- IN EFI_DNS4_COMPLETION_TOKEN *Token, \r
+ IN EFI_DNS4_COMPLETION_TOKEN *Token,\r
OUT DNS4_TOKEN_ENTRY **TokenEntry\r
);\r
\r
EFIAPI\r
GetDns6TokenEntry (\r
IN NET_MAP *TokensMap,\r
- IN EFI_DNS6_COMPLETION_TOKEN *Token, \r
+ IN EFI_DNS6_COMPLETION_TOKEN *Token,\r
OUT DNS6_TOKEN_ENTRY **TokenEntry\r
);\r
\r
\r
/**\r
Poll the UDP to get the IP4 default address, which may be retrieved\r
- by DHCP. \r
- \r
- The default time out value is 5 seconds. If IP has retrieved the default address, \r
+ by DHCP.\r
+\r
+ The default time out value is 5 seconds. If IP has retrieved the default address,\r
the UDP is reconfigured.\r
\r
@param Instance The DNS instance\r
\r
/**\r
Configure the UDP.\r
- \r
+\r
@param Instance The DNS session\r
@param UdpIo The UDP_IO instance\r
- \r
+\r
@retval EFI_SUCCESS The UDP is successfully configured for the\r
session.\r
\r
\r
/**\r
Configure the UDP.\r
- \r
+\r
@param Instance The DNS session\r
@param UdpIo The UDP_IO instance\r
\r
\r
/**\r
Update Dns4 cache to shared list of caches of all DNSv4 instances.\r
- \r
+\r
@param Dns4CacheList All Dns4 cache list.\r
- @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache. \r
- If TRUE, this function will delete matching DNS Cache entry. \r
- @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter. \r
+ @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.\r
+ If TRUE, this function will delete matching DNS Cache entry.\r
+ @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.\r
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.\r
@param DnsCacheEntry Entry Pointer to DNS Cache entry.\r
\r
@retval EFI_SUCCESS Update Dns4 cache successfully.\r
- @retval Others Failed to update Dns4 cache. \r
- \r
+ @retval Others Failed to update Dns4 cache.\r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
);\r
\r
/**\r
- Update Dns6 cache to shared list of caches of all DNSv6 instances. \r
+ Update Dns6 cache to shared list of caches of all DNSv6 instances.\r
\r
@param Dns6CacheList All Dns6 cache list.\r
- @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache. \r
- If TRUE, this function will delete matching DNS Cache entry. \r
- @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter. \r
+ @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.\r
+ If TRUE, this function will delete matching DNS Cache entry.\r
+ @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.\r
If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.\r
@param DnsCacheEntry Entry Pointer to DNS Cache entry.\r
- \r
+\r
@retval EFI_SUCCESS Update Dns6 cache successfully.\r
@retval Others Failed to update Dns6 cache.\r
-**/ \r
+**/\r
EFI_STATUS\r
EFIAPI\r
UpdateDns6Cache (\r
);\r
\r
/**\r
- Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server. \r
+ Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.\r
\r
- @param Dns4ServerList Common list of addresses of all configured DNSv4 server. \r
- @param ServerIp DNS server Ip. \r
+ @param Dns4ServerList Common list of addresses of all configured DNSv4 server.\r
+ @param ServerIp DNS server Ip.\r
\r
@retval EFI_SUCCESS Add Dns4 ServerIp to common list successfully.\r
@retval Others Failed to add Dns4 ServerIp to common list.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
);\r
\r
/**\r
- Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server. \r
+ Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.\r
\r
- @param Dns6ServerList Common list of addresses of all configured DNSv6 server. \r
- @param ServerIp DNS server Ip. \r
+ @param Dns6ServerList Common list of addresses of all configured DNSv6 server.\r
+ @param ServerIp DNS server Ip.\r
\r
@retval EFI_SUCCESS Add Dns6 ServerIp to common list successfully.\r
@retval Others Failed to add Dns6 ServerIp to common list.\r
- \r
-**/ \r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
AddDns6ServerIp (\r
/**\r
Find out whether the response is valid or invalid.\r
\r
- @param TokensMap All DNS transmittal Tokens entry. \r
- @param Identification Identification for queried packet. \r
+ @param TokensMap All DNS transmittal Tokens entry.\r
+ @param Identification Identification for queried packet.\r
@param Type Type for queried packet.\r
@param Class Class for queried packet.\r
@param Item Return corresponding Token entry.\r
\r
@retval TRUE The response is valid.\r
@retval FALSE The response is invalid.\r
- \r
-**/ \r
+\r
+**/\r
BOOLEAN\r
IsValidDnsResponse (\r
IN NET_MAP *TokensMap,\r
\r
@param Instance The DNS instance\r
@param RxString Received buffer.\r
- @param Completed Flag to indicate that Dns response is valid. \r
- \r
+ @param Completed Flag to indicate that Dns response is valid.\r
+\r
@retval EFI_SUCCESS Parse Dns Response successfully.\r
@retval Others Failed to parse Dns Response.\r
- \r
-**/ \r
+\r
+**/\r
EFI_STATUS\r
ParseDnsResponse (\r
IN OUT DNS_INSTANCE *Instance,\r
@param IoStatus The status of the UDP receive\r
@param Context The opaque parameter to the function.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DnsOnPacketReceived (\r
Construct the Packet according query section.\r
\r
@param Instance The DNS instance\r
- @param QueryName Queried Name \r
- @param Type Queried Type \r
- @param Class Queried Class \r
+ @param QueryName Queried Name\r
+ @param Type Queried Type\r
+ @param Class Queried Class\r
@param Packet The packet for query\r
\r
@retval EFI_SUCCESS The packet is constructed.\r
Retransmit the packet.\r
\r
@param Instance The DNS instance\r
- @param Packet Retransmit the packet \r
+ @param Packet Retransmit the packet\r
\r
@retval EFI_SUCCESS The packet is retransmitted.\r
@retval Others Failed to retransmit.\r
@retval EFI_SUCCESS The operation completed successfully.\r
@retval EFI_UNSUPPORTED The designated protocol is not supported.\r
@retval EFI_INVALID_PARAMTER Thisis NULL.\r
- The StationIp address provided in DnsConfigData is not a \r
+ The StationIp address provided in DnsConfigData is not a\r
valid unicast.\r
DnsServerList is NULL while DnsServerListCount\r
is not ZERO.\r
allocated.\r
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
EFI DNSv4 Protocol instance is not configured.\r
- @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
- reconfigure the instance the caller must call Configure() \r
+ @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To\r
+ reconfigure the instance the caller must call Configure()\r
with NULL first to return driver to unconfigured state.\r
**/\r
EFI_STATUS\r
/**\r
IPv4 address to host name translation also known as Reverse DNS lookup.\r
\r
- The IpToHostName() function is used to translate the host address to host name. A type PTR \r
+ The IpToHostName() function is used to translate the host address to host name. A type PTR\r
query is used to get the primary name of the host. Support of this function is optional.\r
\r
@param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
);\r
\r
/**\r
- Retrieve arbitrary information from the DNS server. \r
+ Retrieve arbitrary information from the DNS server.\r
\r
This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r
supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r
Dns4GeneralLookUp (\r
IN EFI_DNS4_PROTOCOL *This,\r
IN CHAR8 *QName,\r
- IN UINT16 QType, \r
+ IN UINT16 QType,\r
IN UINT16 QClass,\r
IN EFI_DNS4_COMPLETION_TOKEN *Token\r
);\r
This function is used to retrieve DNS mode data for this DNS instance.\r
\r
@param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
- @param[out] DnsModeData Pointer to the caller-allocated storage for the \r
+ @param[out] DnsModeData Pointer to the caller-allocated storage for the\r
EFI_DNS6_MODE_DATA data.\r
\r
@retval EFI_SUCCESS The operation completed successfully.\r
EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.\r
\r
@param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
- @param[in] DnsConfigData Pointer to the configuration data structure. All associated \r
+ @param[in] DnsConfigData Pointer to the configuration data structure. All associated\r
storage to be allocated and released by caller.\r
\r
@retval EFI_SUCCESS The operation completed successfully.\r
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
EFI DNSv6 Protocol instance is not configured.\r
@retval EFI_UNSUPPORTED The designated protocol is not supported.\r
- @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
- reconfigure the instance the caller must call Configure() with \r
+ @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To\r
+ reconfigure the instance the caller must call Configure() with\r
NULL first to return driver to unconfigured state.\r
**/\r
EFI_STATUS\r
Dns6GeneralLookUp (\r
IN EFI_DNS6_PROTOCOL *This,\r
IN CHAR8 *QName,\r
- IN UINT16 QType, \r
+ IN UINT16 QType,\r
IN UINT16 QClass,\r
IN EFI_DNS6_COMPLETION_TOKEN *Token\r
);\r
/** @file\r
Implementation of EFI_DNS4_PROTOCOL and EFI_DNS6_PROTOCOL interfaces.\r
\r
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
)\r
{\r
DNS_INSTANCE *Instance;\r
- \r
+\r
EFI_TPL OldTpl;\r
\r
UINTN Index;\r
- \r
+\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *Next;\r
- \r
+\r
DNS4_SERVER_IP *ServerItem;\r
EFI_IPv4_ADDRESS *ServerList;\r
DNS4_CACHE *CacheItem;\r
CacheItem = NULL;\r
CacheList = NULL;\r
Status = EFI_SUCCESS;\r
- \r
- \r
+\r
+\r
if ((This == NULL) || (DnsModeData == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- \r
+\r
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This);\r
if (Instance->State == DNS_STATE_UNCONFIGED) {\r
Status = EFI_NOT_STARTED;\r
goto ON_EXIT;\r
}\r
- \r
+\r
ZeroMem (DnsModeData, sizeof (EFI_DNS4_MODE_DATA));\r
\r
//\r
- // Get the current configuration data of this instance. \r
+ // Get the current configuration data of this instance.\r
//\r
Status = Dns4CopyConfigure (&DnsModeData->DnsConfigData, &Instance->Dns4CfgData);\r
if (EFI_ERROR (Status)) {\r
Dns4CleanConfigure (&DnsModeData->DnsConfigData);\r
goto ON_EXIT;\r
}\r
- \r
+\r
Index = 0;\r
NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns4ServerList) {\r
ServerItem = NET_LIST_USER_STRUCT (Entry, DNS4_SERVER_IP, AllServerLink);\r
FreePool (ServerList);\r
goto ON_EXIT;\r
}\r
- \r
+\r
Index =0;\r
NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns4CacheList) {\r
CacheItem = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);\r
@retval EFI_SUCCESS The operation completed successfully.\r
@retval EFI_UNSUPPORTED The designated protocol is not supported.\r
@retval EFI_INVALID_PARAMTER Thisis NULL.\r
- The StationIp address provided in DnsConfigData is not a \r
+ The StationIp address provided in DnsConfigData is not a\r
valid unicast.\r
DnsServerList is NULL while DnsServerListCount\r
is not ZERO.\r
allocated.\r
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
EFI DNSv4 Protocol instance is not configured.\r
- @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
- reconfigure the instance the caller must call Configure() \r
+ @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To\r
+ reconfigure the instance the caller must call Configure()\r
with NULL first to return driver to unconfigured state.\r
**/\r
EFI_STATUS\r
{\r
EFI_STATUS Status;\r
DNS_INSTANCE *Instance;\r
- \r
+\r
EFI_TPL OldTpl;\r
IP4_ADDR Ip;\r
IP4_ADDR Netmask;\r
\r
UINT32 ServerListCount;\r
- EFI_IPv4_ADDRESS *ServerList; \r
+ EFI_IPv4_ADDRESS *ServerList;\r
\r
Status = EFI_SUCCESS;\r
ServerList = NULL;\r
- \r
- if (This == NULL || \r
- (DnsConfigData != NULL && ((DnsConfigData->DnsServerListCount != 0 && DnsConfigData->DnsServerList == NULL) || \r
+\r
+ if (This == NULL ||\r
+ (DnsConfigData != NULL && ((DnsConfigData->DnsServerListCount != 0 && DnsConfigData->DnsServerList == NULL) ||\r
(DnsConfigData->DnsServerListCount == 0 && DnsConfigData->DnsServerList != NULL)))) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
if (DnsConfigData == NULL) {\r
ZeroMem (&Instance->SessionDnsServer, sizeof (EFI_IP_ADDRESS));\r
- \r
+\r
//\r
// Reset the Instance if ConfigData is NULL\r
//\r
if (Instance->UdpIo != NULL){\r
UdpIoCleanIo (Instance->UdpIo);\r
}\r
- \r
+\r
if (Instance->Dns4CfgData.DnsServerList != NULL) {\r
FreePool (Instance->Dns4CfgData.DnsServerList);\r
}\r
ZeroMem (&Instance->Dns4CfgData, sizeof (EFI_DNS4_CONFIG_DATA));\r
- \r
+\r
Instance->State = DNS_STATE_UNCONFIGED;\r
} else {\r
//\r
}\r
\r
if (DnsConfigData->DnsServerListCount == 0) {\r
- gBS->RestoreTPL (OldTpl); \r
- \r
+ gBS->RestoreTPL (OldTpl);\r
+\r
//\r
// The DNS instance will retrieve DNS server from DHCP Server\r
//\r
Status = GetDns4ServerFromDhcp4 (\r
Instance,\r
- &ServerListCount, \r
+ &ServerListCount,\r
&ServerList\r
);\r
if (EFI_ERROR (Status)) {\r
}\r
\r
ASSERT(ServerList != NULL);\r
- \r
+\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
CopyMem (&Instance->SessionDnsServer.v4, &ServerList[0], sizeof (EFI_IPv4_ADDRESS));\r
}\r
goto ON_EXIT;\r
}\r
- \r
+\r
Instance->State = DNS_STATE_CONFIGED;\r
}\r
\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
DNS_INSTANCE *Instance;\r
- \r
+\r
EFI_DNS4_CONFIG_DATA *ConfigData;\r
- \r
+\r
UINTN Index;\r
DNS4_CACHE *Item;\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *Next;\r
- \r
+\r
CHAR8 *QueryName;\r
- \r
+\r
DNS4_TOKEN_ENTRY *TokenEntry;\r
NET_BUF *Packet;\r
- \r
+\r
EFI_TPL OldTpl;\r
- \r
+\r
Status = EFI_SUCCESS;\r
Item = NULL;\r
QueryName = NULL;\r
TokenEntry = NULL;\r
Packet = NULL;\r
- \r
+\r
//\r
// Validate the parameters\r
//\r
if ((This == NULL) || (HostName == NULL) || Token == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- \r
+\r
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This);\r
- \r
+\r
ConfigData = &(Instance->Dns4CfgData);\r
- \r
+\r
if (Instance->State != DNS_STATE_CONFIGED) {\r
Status = EFI_NOT_STARTED;\r
goto ON_EXIT;\r
if (Token->RetryInterval == 0) {\r
Token->RetryInterval = ConfigData->RetryInterval;\r
}\r
- \r
+\r
//\r
- // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. \r
+ // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.\r
//\r
if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) {\r
Token->RetryInterval = DNS_DEFAULT_TIMEOUT;\r
if (Token->RspData.H2AData != NULL) {\r
FreePool (Token->RspData.H2AData);\r
}\r
- \r
+\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
Item = NET_LIST_USER_STRUCT (Entry, DNS4_CACHE, AllCacheLink);\r
if ((UINT32)Index < Token->RspData.H2AData->IpCount && StrCmp (HostName, Item->DnsCache.HostName) == 0) {\r
CopyMem ((Token->RspData.H2AData->IpList) + Index, Item->DnsCache.IpAddress, sizeof (EFI_IPv4_ADDRESS));\r
- Index++; \r
+ Index++;\r
}\r
}\r
- \r
+\r
Token->Status = EFI_SUCCESS;\r
- \r
+\r
if (Token->Event != NULL) {\r
gBS->SignalEvent (Token->Event);\r
DispatchDpc ();\r
\r
Status = Token->Status;\r
goto ON_EXIT;\r
- } \r
+ }\r
}\r
\r
//\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
TokenEntry->PacketToLive = Token->RetryInterval;\r
TokenEntry->Token = Token;\r
TokenEntry->QueryHostName = AllocateZeroPool (StrSize (HostName));\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
CopyMem (TokenEntry->QueryHostName, HostName, StrSize (HostName));\r
- \r
+\r
//\r
// Construct QName.\r
//\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// Construct DNS Query Packet.\r
//\r
Status = ConstructDNSQuery (Instance, QueryName, DNS_TYPE_A, DNS_CLASS_INET, &Packet);\r
- if (EFI_ERROR (Status)) { \r
+ if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// Dns Query Ip\r
//\r
if (EFI_ERROR (Status)) {\r
Dns4RemoveTokenEntry (&Instance->Dns4TxTokens, TokenEntry);\r
}\r
- \r
+\r
ON_EXIT:\r
\r
if (EFI_ERROR (Status)) {\r
if (TokenEntry->QueryHostName != NULL) {\r
FreePool (TokenEntry->QueryHostName);\r
}\r
- \r
+\r
FreePool (TokenEntry);\r
}\r
- \r
+\r
if (Packet != NULL) {\r
NetbufFree (Packet);\r
}\r
}\r
- \r
+\r
if (QueryName != NULL) {\r
FreePool (QueryName);\r
}\r
- \r
+\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
/**\r
IPv4 address to host name translation also known as Reverse DNS lookup.\r
\r
- The IpToHostName() function is used to translate the host address to host name. A type PTR \r
+ The IpToHostName() function is used to translate the host address to host name. A type PTR\r
query is used to get the primary name of the host. Support of this function is optional.\r
\r
@param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
}\r
\r
/**\r
- Retrieve arbitrary information from the DNS server. \r
+ Retrieve arbitrary information from the DNS server.\r
\r
This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r
supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r
Dns4GeneralLookUp (\r
IN EFI_DNS4_PROTOCOL *This,\r
IN CHAR8 *QName,\r
- IN UINT16 QType, \r
+ IN UINT16 QType,\r
IN UINT16 QClass,\r
IN EFI_DNS4_COMPLETION_TOKEN *Token\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
DNS_INSTANCE *Instance;\r
- \r
+\r
EFI_DNS4_CONFIG_DATA *ConfigData;\r
- \r
+\r
DNS4_TOKEN_ENTRY *TokenEntry;\r
NET_BUF *Packet;\r
- \r
+\r
EFI_TPL OldTpl;\r
- \r
+\r
Status = EFI_SUCCESS;\r
TokenEntry = NULL;\r
Packet = NULL;\r
- \r
+\r
//\r
// Validate the parameters\r
//\r
if ((This == NULL) || (QName == NULL) || Token == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- \r
+\r
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This);\r
- \r
+\r
ConfigData = &(Instance->Dns4CfgData);\r
\r
if (Instance->State != DNS_STATE_CONFIGED) {\r
}\r
\r
Token->Status = EFI_NOT_READY;\r
- \r
+\r
//\r
// If zero, use the parameter configured through Dns.Configure() interface.\r
//\r
if (Token->RetryCount == 0) {\r
Token->RetryCount = ConfigData->RetryCount;\r
}\r
- \r
+\r
//\r
// If zero, use the parameter configured through Dns.Configure() interface.\r
//\r
}\r
\r
//\r
- // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. \r
+ // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.\r
//\r
if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) {\r
Token->RetryInterval = DNS_DEFAULT_TIMEOUT;\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
TokenEntry->PacketToLive = Token->RetryInterval;\r
TokenEntry->GeneralLookUp = TRUE;\r
TokenEntry->Token = Token;\r
if (TokenEntry != NULL) {\r
FreePool (TokenEntry);\r
}\r
- \r
+\r
goto ON_EXIT;\r
}\r
\r
if (TokenEntry != NULL) {\r
FreePool (TokenEntry);\r
}\r
- \r
+\r
NetbufFree (Packet);\r
- \r
+\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// Dns Query Ip\r
//\r
if (TokenEntry != NULL) {\r
FreePool (TokenEntry);\r
}\r
- \r
+\r
NetbufFree (Packet);\r
}\r
- \r
+\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry\r
)\r
{\r
- EFI_STATUS Status; \r
+ EFI_STATUS Status;\r
EFI_TPL OldTpl;\r
\r
Status = EFI_SUCCESS;\r
- \r
+\r
if (DnsCacheEntry.HostName == NULL || DnsCacheEntry.IpAddress == NULL || DnsCacheEntry.Timeout == 0) {\r
- return EFI_INVALID_PARAMETER; \r
+ return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
//\r
Status = UpdateDns4Cache (&mDriverData->Dns4CacheList, DeleteFlag, Override, DnsCacheEntry);\r
\r
gBS->RestoreTPL (OldTpl);\r
- \r
+\r
return Status;\r
}\r
\r
}\r
\r
Udp = Instance->UdpIo->Protocol.Udp4;\r
- \r
+\r
return Udp->Poll (Udp);\r
}\r
\r
This function is used to retrieve DNS mode data for this DNS instance.\r
\r
@param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
- @param[out] DnsModeData Pointer to the caller-allocated storage for the \r
+ @param[out] DnsModeData Pointer to the caller-allocated storage for the\r
EFI_DNS6_MODE_DATA data.\r
\r
@retval EFI_SUCCESS The operation completed successfully.\r
)\r
{\r
DNS_INSTANCE *Instance;\r
- \r
+\r
EFI_TPL OldTpl;\r
\r
UINTN Index;\r
- \r
+\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *Next;\r
\r
}\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- \r
+\r
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This);\r
if (Instance->State == DNS_STATE_UNCONFIGED) {\r
Status = EFI_NOT_STARTED;\r
ZeroMem (DnsModeData, sizeof (EFI_DNS6_MODE_DATA));\r
\r
//\r
- // Get the current configuration data of this instance. \r
+ // Get the current configuration data of this instance.\r
//\r
Status = Dns6CopyConfigure (&DnsModeData->DnsConfigData, &Instance->Dns6CfgData);\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// Get the DnsServerCount and DnsServerList\r
//\r
Dns6CleanConfigure (&DnsModeData->DnsConfigData);\r
goto ON_EXIT;\r
}\r
- \r
+\r
Index = 0;\r
NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns6ServerList) {\r
ServerItem = NET_LIST_USER_STRUCT (Entry, DNS6_SERVER_IP, AllServerLink);\r
FreePool (ServerList);\r
goto ON_EXIT;\r
}\r
- \r
+\r
Index =0;\r
NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns6CacheList) {\r
CacheItem = NET_LIST_USER_STRUCT (Entry, DNS6_CACHE, AllCacheLink);\r
Index++;\r
}\r
DnsModeData->DnsCacheList = CacheList;\r
- \r
+\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.\r
\r
@param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
- @param[in] DnsConfigData Pointer to the configuration data structure. All associated \r
+ @param[in] DnsConfigData Pointer to the configuration data structure. All associated\r
storage to be allocated and released by caller.\r
\r
@retval EFI_SUCCESS The operation completed successfully.\r
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
EFI DNSv6 Protocol instance is not configured.\r
@retval EFI_UNSUPPORTED The designated protocol is not supported.\r
- @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
- reconfigure the instance the caller must call Configure() with \r
+ @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To\r
+ reconfigure the instance the caller must call Configure() with\r
NULL first to return driver to unconfigured state.\r
**/\r
EFI_STATUS\r
{\r
EFI_STATUS Status;\r
DNS_INSTANCE *Instance;\r
- \r
+\r
EFI_TPL OldTpl;\r
\r
UINT32 ServerListCount;\r
- EFI_IPv6_ADDRESS *ServerList; \r
+ EFI_IPv6_ADDRESS *ServerList;\r
\r
Status = EFI_SUCCESS;\r
ServerList = NULL;\r
\r
- if (This == NULL || \r
- (DnsConfigData != NULL && ((DnsConfigData->DnsServerCount != 0 && DnsConfigData->DnsServerList == NULL) || \r
+ if (This == NULL ||\r
+ (DnsConfigData != NULL && ((DnsConfigData->DnsServerCount != 0 && DnsConfigData->DnsServerList == NULL) ||\r
(DnsConfigData->DnsServerCount == 0 && DnsConfigData->DnsServerList != NULL)))) {\r
return EFI_INVALID_PARAMETER;\r
}\r
FreePool (Instance->Dns6CfgData.DnsServerList);\r
}\r
ZeroMem (&Instance->Dns6CfgData, sizeof (EFI_DNS6_CONFIG_DATA));\r
- \r
+\r
Instance->State = DNS_STATE_UNCONFIGED;\r
} else {\r
//\r
//\r
Status = GetDns6ServerFromDhcp6 (\r
Instance->Service->ImageHandle,\r
- Instance->Service->ControllerHandle, \r
- &ServerListCount, \r
+ Instance->Service->ControllerHandle,\r
+ &ServerListCount,\r
&ServerList\r
);\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
- \r
+\r
ASSERT(ServerList != NULL);\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
}\r
goto ON_EXIT;\r
}\r
- \r
+\r
Instance->State = DNS_STATE_CONFIGED;\r
}\r
\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
DNS_INSTANCE *Instance;\r
\r
EFI_DNS6_CONFIG_DATA *ConfigData;\r
- \r
- UINTN Index; \r
+\r
+ UINTN Index;\r
DNS6_CACHE *Item;\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *Next;\r
- \r
+\r
CHAR8 *QueryName;\r
- \r
+\r
DNS6_TOKEN_ENTRY *TokenEntry;\r
NET_BUF *Packet;\r
- \r
+\r
EFI_TPL OldTpl;\r
- \r
+\r
Status = EFI_SUCCESS;\r
Item = NULL;\r
QueryName = NULL;\r
}\r
\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- \r
+\r
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This);\r
- \r
+\r
ConfigData = &(Instance->Dns6CfgData);\r
\r
if (Instance->State != DNS_STATE_CONFIGED) {\r
if (Token->RetryInterval == 0) {\r
Token->RetryInterval = ConfigData->RetryInterval;\r
}\r
- \r
+\r
//\r
- // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. \r
+ // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.\r
//\r
if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) {\r
Token->RetryInterval = DNS_DEFAULT_TIMEOUT;\r
if (Token->RspData.H2AData != NULL) {\r
FreePool (Token->RspData.H2AData);\r
}\r
- \r
+\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
Index++;\r
}\r
}\r
- \r
+\r
Token->Status = EFI_SUCCESS;\r
- \r
+\r
if (Token->Event != NULL) {\r
gBS->SignalEvent (Token->Event);\r
DispatchDpc ();\r
}\r
- \r
+\r
Status = Token->Status;\r
goto ON_EXIT;\r
- } \r
+ }\r
}\r
\r
//\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
TokenEntry->PacketToLive = Token->RetryInterval;\r
TokenEntry->Token = Token;\r
TokenEntry->QueryHostName = AllocateZeroPool (StrSize (HostName));\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
CopyMem (TokenEntry->QueryHostName, HostName, StrSize (HostName));\r
\r
//\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// Construct DNS Query Packet.\r
//\r
if (EFI_ERROR (Status)) {\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// Dns Query Ip\r
//\r
if (EFI_ERROR (Status)) {\r
Dns6RemoveTokenEntry (&Instance->Dns6TxTokens, TokenEntry);\r
}\r
- \r
+\r
ON_EXIT:\r
\r
if (EFI_ERROR (Status)) {\r
if (TokenEntry->QueryHostName != NULL) {\r
FreePool (TokenEntry->QueryHostName);\r
}\r
- \r
+\r
FreePool (TokenEntry);\r
}\r
- \r
+\r
if (Packet != NULL) {\r
NetbufFree (Packet);\r
}\r
}\r
- \r
+\r
if (QueryName != NULL) {\r
FreePool (QueryName);\r
}\r
- \r
+\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
Dns6GeneralLookUp (\r
IN EFI_DNS6_PROTOCOL *This,\r
IN CHAR8 *QName,\r
- IN UINT16 QType, \r
+ IN UINT16 QType,\r
IN UINT16 QClass,\r
IN EFI_DNS6_COMPLETION_TOKEN *Token\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
DNS_INSTANCE *Instance;\r
- \r
+\r
EFI_DNS6_CONFIG_DATA *ConfigData;\r
- \r
+\r
DNS6_TOKEN_ENTRY *TokenEntry;\r
NET_BUF *Packet;\r
- \r
+\r
EFI_TPL OldTpl;\r
- \r
+\r
Status = EFI_SUCCESS;\r
TokenEntry = NULL;\r
Packet = NULL;\r
- \r
+\r
//\r
// Validate the parameters\r
//\r
if ((This == NULL) || (QName == NULL) || Token == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
- \r
+\r
Instance = DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This);\r
- \r
+\r
ConfigData = &(Instance->Dns6CfgData);\r
\r
if (Instance->State != DNS_STATE_CONFIGED) {\r
}\r
\r
Token->Status = EFI_NOT_READY;\r
- \r
+\r
//\r
// If zero, use the parameter configured through Dns.Configure() interface.\r
//\r
if (Token->RetryCount == 0) {\r
Token->RetryCount = ConfigData->RetryCount;\r
}\r
- \r
+\r
//\r
// If zero, use the parameter configured through Dns.Configure() interface.\r
//\r
}\r
\r
//\r
- // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second. \r
+ // Minimum interval of retry is 2 second. If the retry interval is less than 2 second, then use the 2 second.\r
//\r
if (Token->RetryInterval < DNS_DEFAULT_TIMEOUT) {\r
Token->RetryInterval = DNS_DEFAULT_TIMEOUT;\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ON_EXIT;\r
}\r
- \r
+\r
TokenEntry->PacketToLive = Token->RetryInterval;\r
TokenEntry->GeneralLookUp = TRUE;\r
TokenEntry->Token = Token;\r
if (TokenEntry != NULL) {\r
FreePool (TokenEntry);\r
}\r
- \r
+\r
goto ON_EXIT;\r
}\r
\r
if (TokenEntry != NULL) {\r
FreePool (TokenEntry);\r
}\r
- \r
+\r
NetbufFree (Packet);\r
- \r
+\r
goto ON_EXIT;\r
}\r
- \r
+\r
//\r
// Dns Query Ip\r
//\r
if (TokenEntry != NULL) {\r
FreePool (TokenEntry);\r
}\r
- \r
+\r
NetbufFree (Packet);\r
}\r
- \r
+\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
return Status;\r
IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry\r
)\r
{\r
- EFI_STATUS Status; \r
+ EFI_STATUS Status;\r
EFI_TPL OldTpl;\r
\r
Status = EFI_SUCCESS;\r
- \r
+\r
if (DnsCacheEntry.HostName == NULL || DnsCacheEntry.IpAddress == NULL || DnsCacheEntry.Timeout == 0) {\r
- return EFI_INVALID_PARAMETER; \r
+ return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
//\r
// Update Dns6Cache here.\r
//\r
Status = UpdateDns6Cache (&mDriverData->Dns6CacheList, DeleteFlag, Override, DnsCacheEntry);\r
- \r
+\r
gBS->RestoreTPL (OldTpl);\r
- \r
+\r
return Status;\r
}\r
\r
}\r
\r
Udp = Instance->UdpIo->Protocol.Udp6;\r
- \r
+\r
return Udp->Poll (Udp);\r
}\r
\r
\r
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-This program and the accompanying materials are licensed and made available under \r
-the terms and conditions of the BSD License that accompanies this distribution. \r
+This program and the accompanying materials are licensed and made available under\r
+the terms and conditions of the BSD License that accompanies this distribution.\r
The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php. \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+http://opensource.org/licenses/bsd-license.php.\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
@retval EFI_SUCCESS Device patch successfully updated.\r
@retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.\r
@retval Others Unexpected error happened.\r
- \r
+\r
**/\r
EFI_STATUS\r
HttpBootUpdateDevicePath (\r
\r
TmpIpDevicePath = NULL;\r
TmpDnsDevicePath = NULL;\r
- \r
+\r
//\r
// Update the IP node with DHCP assigned information.\r
//\r
SetDevicePathNodeLength (Node, sizeof (IPv6_DEVICE_PATH));\r
Node->Ipv6.PrefixLength = IP6_PREFIX_LENGTH;\r
Node->Ipv6.RemotePort = Private->Port;\r
- Node->Ipv6.Protocol = EFI_IP_PROTO_TCP; \r
+ Node->Ipv6.Protocol = EFI_IP_PROTO_TCP;\r
Node->Ipv6.IpAddressOrigin = 0;\r
CopyMem (&Node->Ipv6.LocalIpAddress, &Private->StationIp.v6, sizeof (EFI_IPv6_ADDRESS));\r
CopyMem (&Node->Ipv6.RemoteIpAddress, &Private->ServerIp.v6, sizeof (EFI_IPv6_ADDRESS));\r
CopyMem (&Node->Ipv6.GatewayIpAddress, &Private->GatewayIp.v6, sizeof (EFI_IPv6_ADDRESS));\r
}\r
- \r
+\r
TmpIpDevicePath = AppendDevicePathNode (Private->ParentDevicePath, (EFI_DEVICE_PATH_PROTOCOL*) Node);\r
FreePool (Node);\r
if (TmpIpDevicePath == NULL) {\r
SetDevicePathNodeLength (Node, Length);\r
Node->Dns.IsIPv6 = Private->UsingIpv6 ? 0x01 : 0x00;\r
CopyMem ((UINT8*) Node + sizeof (EFI_DEVICE_PATH_PROTOCOL) + sizeof (Node->Dns.IsIPv6), Private->DnsServerIp, Private->DnsServerCount * sizeof (EFI_IP_ADDRESS));\r
- \r
+\r
TmpDnsDevicePath = AppendDevicePathNode (TmpIpDevicePath, (EFI_DEVICE_PATH_PROTOCOL*) Node);\r
FreePool (Node);\r
FreePool (TmpIpDevicePath);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
FreePool (Private->Ip4Nic->DevicePath);\r
Private->Ip4Nic->DevicePath = NewDevicePath;\r
} else {\r
FreePool (Private->Ip6Nic->DevicePath);\r
Private->Ip6Nic->DevicePath = NewDevicePath;\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
ASSERT (SelectIndex < HTTP_BOOT_OFFER_MAX_NUM);\r
\r
DnsServerIndex = 0;\r
- \r
+\r
Status = EFI_SUCCESS;\r
\r
//\r
//\r
// In Corporate environment, we need a HttpOffer.\r
//\r
- if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) || \r
+ if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) ||\r
(SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns) ||\r
(SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns)) {\r
HttpOffer = SelectOffer;\r
return Status;\r
}\r
\r
- if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) || \r
+ if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||\r
(SelectOffer->OfferType == HttpOfferTypeDhcpDns) ||\r
(SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns)) {\r
Option = SelectOffer->OptList[HTTP_BOOT_DHCP4_TAG_INDEX_DNS_SERVER];\r
for (DnsServerIndex = 0; DnsServerIndex < Private->DnsServerCount; DnsServerIndex++) {\r
CopyMem (&(Private->DnsServerIp[DnsServerIndex].v4), &(((EFI_IPv4_ADDRESS *) Option->Data)[DnsServerIndex]), sizeof (EFI_IPv4_ADDRESS));\r
}\r
- \r
+\r
//\r
// Configure the default DNS server if server assigned.\r
- // \r
+ //\r
Status = HttpBootRegisterIp4Dns (\r
Private,\r
Option->Length,\r
if (EFI_ERROR (Status) || Private->Port == 0) {\r
Private->Port = 80;\r
}\r
- \r
+\r
//\r
// All boot informations are valid here.\r
//\r
return Status;\r
}\r
\r
- if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) || \r
+ if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||\r
(SelectOffer->OfferType == HttpOfferTypeDhcpDns) ||\r
(SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns)) {\r
Option = SelectOffer->OptList[HTTP_BOOT_DHCP6_IDX_DNS_SERVER];\r
goto Error;\r
}\r
}\r
- \r
+\r
//\r
- // Extract the HTTP server Ip from URL. This is used to Check route table \r
+ // Extract the HTTP server Ip from URL. This is used to Check route table\r
// whether can send message to HTTP Server Ip through the GateWay.\r
//\r
Status = HttpUrlGetIp6 (\r
Private->BootFileUriParser,\r
&IpAddr\r
);\r
- \r
+\r
if (EFI_ERROR (Status)) {\r
//\r
// The Http server address is expressed by Name Ip, so perform DNS resolution\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Error;\r
}\r
- \r
+\r
AsciiStrToUnicodeStrS (HostName, HostNameStr, HostNameSize);\r
\r
if (HostName != NULL) {\r
FreePool (HostName);\r
}\r
- \r
+\r
Status = HttpBootDns (Private, HostNameStr, &IpAddr);\r
FreePool (HostNameStr);\r
if (EFI_ERROR (Status)) {\r
AsciiPrint ("\n Error: Could not retrieve the host address from DNS server.\n");\r
goto Error;\r
- } \r
- } \r
- \r
+ }\r
+ }\r
+\r
CopyMem (&Private->ServerIp.v6, &IpAddr, sizeof (EFI_IPv6_ADDRESS));\r
- \r
+\r
//\r
// Extract the port from URL, and use default HTTP port 80 if not provided.\r
//\r
if (EFI_ERROR (Status) || Private->Port == 0) {\r
Private->Port = 80;\r
}\r
- \r
+\r
//\r
// All boot informations are valid here.\r
//\r
if (EFI_ERROR (Status)) {\r
goto Error;\r
}\r
- \r
+\r
return Status;\r
\r
Error:\r
FreePool (Private->DnsServerIp);\r
Private->DnsServerIp = NULL;\r
}\r
- \r
+\r
return Status;\r
}\r
\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
//\r
// Start D.O.R.A/S.A.R.R exchange to acquire station ip address and\r
// other Http boot information.\r
@param[in] EventType Indicate the Event type that occurs in the current callback.\r
@param[in] Message HTTP message which will be send to, or just received from HTTP server.\r
@param[in] Context The Callback Context pointer.\r
- \r
+\r
@retval EFI_SUCCESS Tells the HttpIo to continue the HTTP process.\r
@retval Others Tells the HttpIo to abort the current HTTP process.\r
**/\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *NextEntry;\r
HTTP_BOOT_CACHE_CONTENT *Cache;\r
- \r
+\r
NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->CacheList) {\r
Cache = NET_LIST_USER_STRUCT (Entry, HTTP_BOOT_CACHE_CONTENT, Link);\r
RemoveEntryList (&Cache->Link);\r
HTTP_BOOT_CACHE_CONTENT *Cache;\r
HTTP_BOOT_ENTITY_DATA *EntityData;\r
UINTN CopyedSize;\r
- \r
+\r
if (Uri == NULL || BufferSize == NULL || Buffer == NULL || ImageType == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
@retval EFI_SUCCESS Continue to parser the message body.\r
@retval Others Abort the parse.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
\r
/**\r
This function download the boot file by using UEFI HTTP protocol.\r
- \r
+\r
@param[in] Private The pointer to the driver's private data.\r
@param[in] HeaderOnly Only request the response header, it could save a lot of time if\r
the caller only want to know the size of the requested file.\r
CHAR16 *Url;\r
BOOLEAN IdentityMode;\r
UINTN ReceivedSize;\r
- \r
+\r
ASSERT (Private != NULL);\r
ASSERT (Private->HttpCreated);\r
\r
Cache->ResponseData = ResponseData;\r
Cache->ImageType = *ImageType;\r
}\r
- \r
+\r
//\r
// 3.3 Init a message-body parser from the header information.\r
//\r
}\r
\r
return Status;\r
- \r
+\r
ERROR_6:\r
if (Parser != NULL) {\r
HttpFreeMsgParser (Parser);\r
FreePool (Context.Block);\r
}\r
HttpBootFreeCache (Cache);\r
- \r
+\r
ERROR_5:\r
if (ResponseData != NULL) {\r
FreePool (ResponseData);\r
/** @file\r
Declaration of the boot file download function.\r
\r
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
-This program and the accompanying materials are licensed and made available under \r
-the terms and conditions of the BSD License that accompanies this distribution. \r
+This program and the accompanying materials are licensed and made available under\r
+the terms and conditions of the BSD License that accompanies this distribution.\r
The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php. \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+http://opensource.org/licenses/bsd-license.php.\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
/**\r
This function download the boot file by using UEFI HTTP protocol.\r
- \r
+\r
@param[in] Private The pointer to the driver's private data.\r
@param[in] HeaderOnly Only request the response header, it could save a lot of time if\r
the caller only want to know the size of the requested file.\r
/** @file\r
Implementation of EFI_COMPONENT_NAME_PROTOCOL and EFI_COMPONENT_NAME2_PROTOCOL protocol.\r
\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under \r
-the terms and conditions of the BSD License that accompanies this distribution. \r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under\r
+the terms and conditions of the BSD License that accompanies this distribution.\r
The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php. \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+http://opensource.org/licenses/bsd-license.php.\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
///\r
/// Component Name Protocol instance\r
///\r
-GLOBAL_REMOVE_IF_UNREFERENCED \r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
EFI_COMPONENT_NAME_PROTOCOL gHttpBootDxeComponentName = {\r
(EFI_COMPONENT_NAME_GET_DRIVER_NAME) HttpBootDxeComponentNameGetDriverName,\r
(EFI_COMPONENT_NAME_GET_CONTROLLER_NAME)HttpBootDxeComponentNameGetControllerName,\r
///\r
/// Component Name 2 Protocol instance\r
///\r
-GLOBAL_REMOVE_IF_UNREFERENCED \r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
EFI_COMPONENT_NAME2_PROTOCOL gHttpBootDxeComponentName2 = {\r
HttpBootDxeComponentNameGetDriverName,\r
HttpBootDxeComponentNameGetControllerName,\r
///\r
/// Table of driver names\r
///\r
-GLOBAL_REMOVE_IF_UNREFERENCED \r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
EFI_UNICODE_STRING_TABLE mHttpBootDxeDriverNameTable[] = {\r
{ "eng;en", (CHAR16 *)L"UEFI HTTP Boot Driver" },\r
{ NULL, NULL }\r
///\r
/// Table of controller names\r
///\r
-GLOBAL_REMOVE_IF_UNREFERENCED \r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
EFI_UNICODE_STRING_TABLE mHttpBootDxeControllerNameTable[] = {\r
{ "eng;en", (CHAR16 *)L"UEFI Http Boot Controller" },\r
{ NULL, NULL }\r
if (ControllerHandle == NULL || ChildHandle != NULL) {\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
NicHandle = HttpBootGetNicByIp4Children (ControllerHandle);\r
if (NicHandle == NULL) {\r
NicHandle = HttpBootGetNicByIp6Children(ControllerHandle);\r
/** @file\r
- Declaration of HTTP boot driver's EFI_COMPONENT_NAME_PROTOCOL and \r
+ Declaration of HTTP boot driver's EFI_COMPONENT_NAME_PROTOCOL and\r
EFI_COMPONENT_NAME2_PROTOCOL function.\r
\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under \r
-the terms and conditions of the BSD License that accompanies this distribution. \r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under\r
+the terms and conditions of the BSD License that accompanies this distribution.\r
The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php. \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+http://opensource.org/licenses/bsd-license.php.\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
/** @file\r
Helper functions for configuring or getting the parameters relating to HTTP Boot.\r
\r
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
@param[in] UsingIpv6 Set to TRUE if creating boot option for IPv6.\r
@param[in] Description The description text of the boot option.\r
@param[in] Uri The URI string of the boot file.\r
- \r
+\r
@retval EFI_SUCCESS The boot option is created successfully.\r
@retval Others Failed to create new boot option.\r
\r
if ((StrLen (Uri) != 0) && (StrnCmp (Uri, L"http://", 7) != 0) && (StrnCmp (Uri, L"https://", 8) != 0)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// Create a new device path by appending the IP node and URI node to\r
// the driver's parent device path\r
}\r
\r
/**\r
- \r
+\r
This function allows the caller to request the current\r
configuration for one or more named elements. The resulting\r
string is in <ConfigAltResp> format. Also, any and all alternative\r
to the most recent "&" before the first\r
failing name / value pair (or the beginning\r
of the string if the failure is in the first\r
- name / value pair) if the request was not successful. \r
+ name / value pair) if the request was not successful.\r
\r
@param[out] Results A null-terminated Unicode string in\r
<ConfigAltResp> format which has all values\r
would result in this type of\r
error. In this case, the\r
Progress parameter would be\r
- set to NULL. \r
+ set to NULL.\r
\r
@retval EFI_NOT_FOUND Routing data doesn't match any\r
known driver. Progress set to the\r
if ((Request != NULL) && !HiiIsConfigHdrMatch (Request, &gHttpBootConfigGuid, mHttpBootConfigStorageName)) {\r
return EFI_NOT_FOUND;\r
}\r
- \r
+\r
ConfigRequestHdr = NULL;\r
ConfigRequest = NULL;\r
AllocatedRequest = FALSE;\r
Results,\r
Progress\r
);\r
- \r
+\r
//\r
// Free the allocated config request string.\r
//\r
}\r
\r
/**\r
- \r
+\r
This function applies changes in a driver's configuration.\r
Input is a Configuration, which has the routing data for this\r
driver followed by name / value configuration pairs. The driver\r
@param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
\r
@param[in] Configuration A null-terminated Unicode string in\r
- <ConfigString> format. \r
- \r
+ <ConfigString> format.\r
+\r
@param[out] Progress A pointer to a string filled in with the\r
offset of the most recent '&' before the\r
first failing name / value pair (or the\r
\r
@retval EFI_SUCCESS The results have been distributed or are\r
awaiting distribution.\r
- \r
+\r
@retval EFI_OUT_OF_RESOURCES Not enough memory to store the\r
parts of the results that must be\r
stored awaiting possible future\r
protocols.\r
- \r
+\r
@retval EFI_INVALID_PARAMETERS Passing in a NULL for the\r
Results parameter would result\r
in this type of error.\r
- \r
+\r
@retval EFI_NOT_FOUND Target for the specified routing data\r
was not found.\r
\r
\r
CallbackInfo = HTTP_BOOT_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS (This);\r
Private = HTTP_BOOT_PRIVATE_DATA_FROM_CALLBACK_INFO (CallbackInfo);\r
- \r
+\r
BufferSize = sizeof (HTTP_BOOT_CONFIG_IFR_NVDATA);\r
ZeroMem (&CallbackInfo->HttpBootNvData, BufferSize);\r
\r
CallbackInfo->HttpBootNvData.Description,\r
CallbackInfo->HttpBootNvData.Uri\r
);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
- \r
+\r
This function is called to provide results data to the driver.\r
This data consists of a unique key that is used to identify\r
which data is either being passed back or being asked for.\r
@param[in] Action Specifies the type of action taken by the browser.\r
@param[in] QuestionId A unique value which is sent to the original\r
exporting driver so that it can identify the type\r
- of data to expect. The format of the data tends to \r
+ of data to expect. The format of the data tends to\r
vary based on the opcode that generated the callback.\r
@param[in] Type The type of value for the question.\r
@param[in, out] Value A pointer to the data being sent to the original\r
UriLen = 0;\r
AsciiUri = NULL;\r
Status = EFI_SUCCESS;\r
- \r
+\r
if (This == NULL || Value == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
CallbackInfo = HTTP_BOOT_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS (This);\r
- \r
+\r
if (Action != EFI_BROWSER_ACTION_CHANGING) {\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
switch (QuestionId) {\r
case KEY_INITIATOR_URI:\r
//\r
//\r
Uri = HiiGetString (CallbackInfo->RegisteredHandle, Value->string, NULL);\r
if(Uri == NULL) {\r
- return EFI_INVALID_PARAMETER;\r
- } \r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
\r
//\r
// The URI should be either an empty string (for corporate environment) ,or http(s) for home environment.\r
UnicodeStrToAsciiStrS (Uri,&nbs