2 Implementation of EFI_DNS4_PROTOCOL and EFI_DNS6_PROTOCOL interfaces.
4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 EFI_DNS4_PROTOCOL mDns4Protocol
= {
28 EFI_DNS6_PROTOCOL mDns6Protocol
= {
40 This function is used to retrieve DNS mode data for this DNS instance.
42 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
43 @param[out] DnsModeData Pointer to the caller-allocated storage for the EFI_DNS4_MODE_DATA structure.
45 @retval EFI_SUCCESS The operation completed successfully.
46 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data is
47 available because this instance has not been configured.
48 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
49 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
55 IN EFI_DNS4_PROTOCOL
*This
,
56 OUT EFI_DNS4_MODE_DATA
*DnsModeData
59 DNS_INSTANCE
*Instance
;
68 DNS4_SERVER_IP
*ServerItem
;
69 EFI_IPv4_ADDRESS
*ServerList
;
70 DNS4_CACHE
*CacheItem
;
71 EFI_DNS4_CACHE_ENTRY
*CacheList
;
81 if ((This
== NULL
) || (DnsModeData
== NULL
)) {
82 return EFI_INVALID_PARAMETER
;
85 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
87 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This
);
88 if (Instance
->State
== DNS_STATE_UNCONFIGED
) {
89 gBS
->RestoreTPL (OldTpl
);
90 return EFI_NOT_STARTED
;
93 ZeroMem (DnsModeData
, sizeof (EFI_DNS4_MODE_DATA
));
96 // Get the current configuration data of this instance.
98 Status
= Dns4CopyConfigure (&DnsModeData
->DnsConfigData
, &Instance
->Dns4CfgData
);
99 if (EFI_ERROR (Status
)) {
100 gBS
->RestoreTPL (OldTpl
);
105 // Get the DnsServerCount and DnsServerList
108 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns4ServerList
) {
111 DnsModeData
->DnsServerCount
= (UINT32
) Index
;
112 ServerList
= AllocatePool (sizeof (EFI_IPv4_ADDRESS
) * DnsModeData
->DnsServerCount
);
113 ASSERT (ServerList
!= NULL
);
115 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns4ServerList
) {
116 ServerItem
= NET_LIST_USER_STRUCT (Entry
, DNS4_SERVER_IP
, AllServerLink
);
117 CopyMem (ServerList
+ Index
, &ServerItem
->Dns4ServerIp
, sizeof (EFI_IPv4_ADDRESS
));
120 DnsModeData
->DnsServerList
= ServerList
;
123 // Get the DnsCacheCount and DnsCacheList
126 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns4CacheList
) {
129 DnsModeData
->DnsCacheCount
= (UINT32
) Index
;
130 CacheList
= AllocatePool (sizeof (EFI_DNS4_CACHE_ENTRY
) * DnsModeData
->DnsCacheCount
);
131 ASSERT (CacheList
!= NULL
);
133 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns4CacheList
) {
134 CacheItem
= NET_LIST_USER_STRUCT (Entry
, DNS4_CACHE
, AllCacheLink
);
135 CopyMem (CacheList
+ Index
, &CacheItem
->DnsCache
, sizeof (EFI_DNS4_CACHE_ENTRY
));
138 DnsModeData
->DnsCacheList
= CacheList
;
140 gBS
->RestoreTPL (OldTpl
);
146 This function is used to configure DNS configuration data for this DNS instance.
148 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
149 @param[in] DnsConfigData Pointer to caller-allocated buffer containing EFI_DNS4_CONFIG_DATA structure.
150 If NULL, the driver will reinitialize the protocol instance to the unconfigured state.
152 @retval EFI_SUCCESS The operation completed successfully.
153 @retval EFI_UNSUPPORTED The designated protocol is not supported.
154 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
155 @retval EFI_INVALID_PARAMETER This is NULL.
156 The StationIp address provided in DnsConfigData is not a valid unicast.
157 DnsServerList is NULL while DnsServerListCount is not equal to Zero.
158 DnsServerListCount is Zero while DnsServerListCount is not equal to NULL.
159 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI DNSv4 Protocol instance is not configured.
165 IN EFI_DNS4_PROTOCOL
*This
,
166 IN EFI_DNS4_CONFIG_DATA
*DnsConfigData
170 DNS_INSTANCE
*Instance
;
176 UINT32 ServerListCount
;
177 EFI_IPv4_ADDRESS
*ServerList
;
179 Status
= EFI_SUCCESS
;
183 (DnsConfigData
!= NULL
&& ((DnsConfigData
->DnsServerListCount
!= 0 && DnsConfigData
->DnsServerList
== NULL
) ||
184 (DnsConfigData
->DnsServerListCount
== 0 && DnsConfigData
->DnsServerList
!= NULL
)))) {
185 return EFI_INVALID_PARAMETER
;
188 if (DnsConfigData
!= NULL
&& DnsConfigData
->Protocol
!= DNS_PROTOCOL_UDP
) {
189 return EFI_UNSUPPORTED
;
192 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
194 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This
);
196 if (DnsConfigData
== NULL
) {
197 ZeroMem (&Instance
->SessionDnsServer
, sizeof (EFI_IP_ADDRESS
));
200 // Reset the Instance if ConfigData is NULL
202 if (!NetMapIsEmpty(&Instance
->Dns4TxTokens
)) {
203 Dns4InstanceCancelToken(Instance
, NULL
);
206 Instance
->MaxRetry
= 0;
208 if (Instance
->UdpIo
!= NULL
){
209 UdpIoCleanIo (Instance
->UdpIo
);
212 if (Instance
->Dns4CfgData
.DnsServerList
!= NULL
) {
213 FreePool (Instance
->Dns4CfgData
.DnsServerList
);
215 ZeroMem (&Instance
->Dns4CfgData
, sizeof (EFI_DNS4_CONFIG_DATA
));
217 Instance
->State
= DNS_STATE_UNCONFIGED
;
220 // Configure the parameters for new operation.
222 CopyMem (&Ip
, &DnsConfigData
->StationIp
, sizeof (IP4_ADDR
));
223 CopyMem (&Netmask
, &DnsConfigData
->SubnetMask
, sizeof (IP4_ADDR
));
226 Netmask
= NTOHL (Netmask
);
228 if (!DnsConfigData
->UseDefaultSetting
&&
229 ((!IP4_IS_VALID_NETMASK (Netmask
) || !NetIp4IsUnicast (Ip
, Netmask
)))) {
230 Status
= EFI_INVALID_PARAMETER
;
234 Status
= Dns4CopyConfigure (&Instance
->Dns4CfgData
, DnsConfigData
);
235 if (EFI_ERROR (Status
)) {
239 if (DnsConfigData
->DnsServerListCount
== 0 || DnsConfigData
->DnsServerList
== NULL
) {
240 gBS
->RestoreTPL (OldTpl
);
243 // The DNS instance will retrieve DNS server from DHCP Server
245 Status
= GetDns4ServerFromDhcp4 (
250 if (EFI_ERROR (Status
)) {
254 ASSERT(ServerList
!= NULL
);
256 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
258 CopyMem (&Instance
->SessionDnsServer
.v4
, &ServerList
[0], sizeof (EFI_IPv4_ADDRESS
));
260 CopyMem (&Instance
->SessionDnsServer
.v4
, &DnsConfigData
->DnsServerList
[0], sizeof (EFI_IPv4_ADDRESS
));
266 Status
= Dns4ConfigUdp (Instance
, Instance
->UdpIo
);
267 if (EFI_ERROR (Status
)) {
268 if (Instance
->Dns4CfgData
.DnsServerList
!= NULL
) {
269 FreePool (Instance
->Dns4CfgData
.DnsServerList
);
275 // Add configured DNS server used by this instance to ServerList.
277 Status
= AddDns4ServerIp (&mDriverData
->Dns4ServerList
, Instance
->SessionDnsServer
.v4
);
278 if (EFI_ERROR (Status
)) {
279 if (Instance
->Dns4CfgData
.DnsServerList
!= NULL
) {
280 FreePool (Instance
->Dns4CfgData
.DnsServerList
);
285 Instance
->State
= DNS_STATE_CONFIGED
;
289 gBS
->RestoreTPL (OldTpl
);
294 The function is used to translate the host name to host IP address.
295 A type A query is used to get the one or more IP addresses for this host.
297 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
298 @param[in] HostName Pointer to caller-supplied buffer containing Host name to be translated.
299 This buffer contains 16 bit characters but these are translated to ASCII for use with
300 DNSv4 server and there is no requirement for driver to support non-ASCII Unicode characters.
301 @param[in] Token Pointer to the caller-allocated completion token to return at the completion of the process to translate host name to host address.
303 @retval EFI_SUCCESS The operation completed successfully.
304 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
305 @retval EFI_INVALID_PARAMETER This is NULL.
309 @retval EFI_NO_MAPPING There's no source address is available for use.
310 @retval EFI_NOT_STARTED This instance has not been started.
316 IN EFI_DNS4_PROTOCOL
*This
,
318 IN EFI_DNS4_COMPLETION_TOKEN
*Token
323 DNS_INSTANCE
*Instance
;
325 EFI_DNS4_CONFIG_DATA
*ConfigData
;
334 DNS4_TOKEN_ENTRY
*TokenEntry
;
339 Status
= EFI_SUCCESS
;
346 // Validate the parameters
348 if ((This
== NULL
) || (HostName
== NULL
) || Token
== NULL
) {
349 return EFI_INVALID_PARAMETER
;
352 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
354 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This
);
356 ConfigData
= &(Instance
->Dns4CfgData
);
358 Instance
->MaxRetry
= ConfigData
->RetryCount
;
360 Token
->Status
= EFI_NOT_READY
;
361 Token
->RetryCount
= 0;
362 Token
->RetryInterval
= ConfigData
->RetryInterval
;
364 if (Instance
->State
!= DNS_STATE_CONFIGED
) {
365 Status
= EFI_NOT_STARTED
;
370 // Check the MaxRetry and RetryInterval values.
372 if (Instance
->MaxRetry
== 0) {
373 Instance
->MaxRetry
= DNS_DEFAULT_RETRY
;
376 if (Token
->RetryInterval
< DNS_DEFAULT_TIMEOUT
) {
377 Token
->RetryInterval
= DNS_DEFAULT_TIMEOUT
;
383 if (ConfigData
->EnableDnsCache
) {
385 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns4CacheList
) {
386 Item
= NET_LIST_USER_STRUCT (Entry
, DNS4_CACHE
, AllCacheLink
);
387 if (StrCmp (HostName
, Item
->DnsCache
.HostName
) == 0) {
393 Token
->RspData
.H2AData
= AllocatePool (sizeof (DNS_HOST_TO_ADDR_DATA
));
394 if (Token
->RspData
.H2AData
== NULL
) {
395 Status
= EFI_OUT_OF_RESOURCES
;
399 Token
->RspData
.H2AData
->IpCount
= (UINT32
)Index
;
400 Token
->RspData
.H2AData
->IpList
= AllocatePool (sizeof (EFI_IPv4_ADDRESS
) * Index
);
401 if (Token
->RspData
.H2AData
->IpList
== NULL
) {
402 if (Token
->RspData
.H2AData
!= NULL
) {
403 FreePool (Token
->RspData
.H2AData
);
406 Status
= EFI_OUT_OF_RESOURCES
;
411 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns4CacheList
) {
412 Item
= NET_LIST_USER_STRUCT (Entry
, DNS4_CACHE
, AllCacheLink
);
413 if ((UINT32
)Index
< Token
->RspData
.H2AData
->IpCount
&& StrCmp (HostName
, Item
->DnsCache
.HostName
) == 0) {
414 CopyMem ((Token
->RspData
.H2AData
->IpList
) + Index
, Item
->DnsCache
.IpAddress
, sizeof (EFI_IPv4_ADDRESS
));
419 Token
->Status
= EFI_SUCCESS
;
421 if (Token
->Event
!= NULL
) {
422 gBS
->SignalEvent (Token
->Event
);
426 Status
= Token
->Status
;
432 // Construct DNS TokenEntry.
434 TokenEntry
= AllocateZeroPool (sizeof(DNS4_TOKEN_ENTRY
));
435 if (TokenEntry
== NULL
) {
436 Status
= EFI_OUT_OF_RESOURCES
;
440 TokenEntry
->PacketToLive
= Token
->RetryInterval
;
441 TokenEntry
->QueryHostName
= HostName
;
442 TokenEntry
->Token
= Token
;
447 QueryName
= DnsFillinQNameForQueryIp (TokenEntry
->QueryHostName
);
448 if (QueryName
== NULL
) {
449 Status
= EFI_OUT_OF_RESOURCES
;
454 // Construct DNS Query Packet.
456 Status
= ConstructDNSQuery (Instance
, QueryName
, DNS_TYPE_A
, DNS_CLASS_INET
, &Packet
);
457 if (EFI_ERROR (Status
)) {
458 if (TokenEntry
!= NULL
) {
459 FreePool (TokenEntry
);
466 // Save the token into the Dns4TxTokens map.
468 Status
= NetMapInsertTail (&Instance
->Dns4TxTokens
, TokenEntry
, Packet
);
469 if (EFI_ERROR (Status
)) {
470 if (TokenEntry
!= NULL
) {
471 FreePool (TokenEntry
);
482 Status
= DoDnsQuery (Instance
, Packet
);
483 if (EFI_ERROR (Status
)) {
484 if (TokenEntry
!= NULL
) {
485 FreePool (TokenEntry
);
492 if (QueryName
!= NULL
) {
493 FreePool (QueryName
);
496 gBS
->RestoreTPL (OldTpl
);
501 The function is used to translate the host address to host name.
502 A type PTR query is used to get the primary name of the host.
504 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
505 @param[in] IpAddress IP address.
506 @param[in] Token Pointer to the caller-allocated completion used token to translate host address to host name.
508 @retval EFI_SUCCESS The operation completed successfully.
509 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
510 @retval EFI_INVALID_PARAMETER This is NULL.
513 IpAddress is not valid IP address.
514 @retval EFI_NO_MAPPING There's no source address is available for use.
515 @retval EFI_NOT_STARTED This instance has not been started.
516 @retval EFI_UNSUPPORTED This function is not supported.
522 IN EFI_DNS4_PROTOCOL
*This
,
523 IN EFI_IPv4_ADDRESS IpAddress
,
524 IN EFI_DNS4_COMPLETION_TOKEN
*Token
527 return EFI_UNSUPPORTED
;
531 This function retrieves arbitrary information from the DNS.
532 The caller supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned.
533 All RR content (e.g., Ttl) was returned.
534 The caller need parse the returned RR to get required information. This function is optional.
536 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
537 @param[in] QName Pointer to Query Name.
538 @param[in] QType Query Type.
539 @param[in] QClass Query Name.
540 @param[in] Token Point to the caller-allocated completion token to retrieve arbitrary information.
542 @retval EFI_SUCCESS The operation completed successfully.
543 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
544 @retval EFI_INVALID_PARAMETER This is NULL.
548 @retval EFI_NO_MAPPING There's no source address is available for use.
549 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.
550 @retval EFI_UNSUPPORTED This function is not supported. Or the requested QType is not supported
556 IN EFI_DNS4_PROTOCOL
*This
,
560 IN EFI_DNS4_COMPLETION_TOKEN
*Token
565 DNS_INSTANCE
*Instance
;
567 EFI_DNS4_CONFIG_DATA
*ConfigData
;
569 DNS4_TOKEN_ENTRY
*TokenEntry
;
574 Status
= EFI_SUCCESS
;
579 // Validate the parameters
581 if ((This
== NULL
) || (QName
== NULL
) || Token
== NULL
) {
582 return EFI_INVALID_PARAMETER
;
585 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
587 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This
);
589 ConfigData
= &(Instance
->Dns4CfgData
);
591 Instance
->MaxRetry
= ConfigData
->RetryCount
;
593 Token
->Status
= EFI_NOT_READY
;
594 Token
->RetryCount
= 0;
595 Token
->RetryInterval
= ConfigData
->RetryInterval
;
597 if (Instance
->State
!= DNS_STATE_CONFIGED
) {
598 Status
= EFI_NOT_STARTED
;
603 // Check the MaxRetry and RetryInterval values.
605 if (Instance
->MaxRetry
== 0) {
606 Instance
->MaxRetry
= DNS_DEFAULT_RETRY
;
609 if (Token
->RetryInterval
< DNS_DEFAULT_TIMEOUT
) {
610 Token
->RetryInterval
= DNS_DEFAULT_TIMEOUT
;
614 // Construct DNS TokenEntry.
616 TokenEntry
= AllocateZeroPool (sizeof(DNS4_TOKEN_ENTRY
));
617 if (TokenEntry
== NULL
) {
618 Status
= EFI_OUT_OF_RESOURCES
;
622 TokenEntry
->PacketToLive
= Token
->RetryInterval
;
623 TokenEntry
->GeneralLookUp
= TRUE
;
624 TokenEntry
->Token
= Token
;
627 // Construct DNS Query Packet.
629 Status
= ConstructDNSQuery (Instance
, QName
, QType
, QClass
, &Packet
);
630 if (EFI_ERROR (Status
)) {
631 if (TokenEntry
!= NULL
) {
632 FreePool (TokenEntry
);
639 // Save the token into the Dns4TxTokens map.
641 Status
= NetMapInsertTail (&Instance
->Dns4TxTokens
, TokenEntry
, Packet
);
642 if (EFI_ERROR (Status
)) {
643 if (TokenEntry
!= NULL
) {
644 FreePool (TokenEntry
);
655 Status
= DoDnsQuery (Instance
, Packet
);
656 if (EFI_ERROR (Status
)) {
657 if (TokenEntry
!= NULL
) {
658 FreePool (TokenEntry
);
665 gBS
->RestoreTPL (OldTpl
);
670 This function is used to add/delete/modify DNS cache entry.
671 DNS cache can be normally dynamically updated after the DNS resolve succeeds.
672 This function provided capability to manually add/delete/modify the DNS cache.
674 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
675 @param[in] DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
676 If TRUE, this function will delete matching DNS Cache entry.
677 @param[in] Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
678 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
679 @param[in] DnsCacheEntry Pointer to DNS Cache entry.
681 @retval EFI_SUCCESS The operation completed successfully.
682 @retval EFI_INVALID_PARAMETER This is NULL.
683 DnsCacheEntry.HostName is NULL.
684 DnsCacheEntry.IpAddress is NULL.
685 DnsCacheEntry.Timeout is zero.
686 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is not TRUE.
692 IN EFI_DNS4_PROTOCOL
*This
,
693 IN BOOLEAN DeleteFlag
,
695 IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry
701 Status
= EFI_SUCCESS
;
703 if (DnsCacheEntry
.HostName
== NULL
|| DnsCacheEntry
.IpAddress
== NULL
|| DnsCacheEntry
.Timeout
== 0) {
704 return EFI_INVALID_PARAMETER
;
707 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
710 // Update Dns4Cache here.
712 Status
= UpdateDns4Cache (&mDriverData
->Dns4CacheList
, DeleteFlag
, Override
, DnsCacheEntry
);
714 gBS
->RestoreTPL (OldTpl
);
720 This function can be used by network drivers and applications to increase the rate that data packets are moved between
721 the communications device and the transmit and receive queues. In some systems, the periodic timer event in the managed
722 network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets
723 without missing incoming packets or dropping outgoing packets.
725 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
727 @retval EFI_SUCCESS Incoming or outgoing data was processed.
728 @retval EFI_INVALID_PARAMETER This is NULL.
729 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
730 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
731 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
732 Consider increasing the polling rate.
738 IN EFI_DNS4_PROTOCOL
*This
741 DNS_INSTANCE
*Instance
;
742 EFI_UDP4_PROTOCOL
*Udp
;
745 return EFI_INVALID_PARAMETER
;
748 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This
);
750 if (Instance
->State
== DNS_STATE_UNCONFIGED
) {
751 return EFI_NOT_STARTED
;
752 } else if (Instance
->State
== DNS_STATE_DESTROY
) {
753 return EFI_DEVICE_ERROR
;
756 Udp
= Instance
->UdpIo
->Protocol
.Udp4
;
758 return Udp
->Poll (Udp
);
762 This function is used to abort a pending resolution request.
763 After calling this function, Token.Status will be set to EFI_ABORTED and then Token.
765 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
766 @param[in] Token Pointer to a token that has been issued by EFI_DNS4_PROTOCOL.HostNameToIp(),
767 EFI_DNS4_PROTOCOL.IpToHostName() or EFI_DNS4_PROTOCOL.GeneralLookup().
768 If NULL, all pending tokens are aborted.
770 @retval EFI_SUCCESS Incoming or outgoing data was processed.
771 @retval EFI_INVALID_PARAMETER This is NULL.
772 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
773 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS operation was not found in the transmit queue.
774 It was either completed or was not issued by HostNameToIp(), IpToHostName() or GeneralLookup().
780 IN EFI_DNS4_PROTOCOL
*This
,
781 IN EFI_DNS4_COMPLETION_TOKEN
*Token
785 DNS_INSTANCE
*Instance
;
789 return EFI_INVALID_PARAMETER
;
792 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL4 (This
);
794 if (Instance
->State
== DNS_STATE_UNCONFIGED
) {
795 return EFI_NOT_STARTED
;
798 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
801 // Cancle the tokens specified by Token for this instance.
803 Status
= Dns4InstanceCancelToken (Instance
, Token
);
806 // Dispatch the DPC queued by the NotifyFunction of the canceled token's events.
810 gBS
->RestoreTPL (OldTpl
);
816 This function is used to retrieve DNS mode data for this DNS instance.
818 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
819 @param[out] DnsModeData Pointer to the caller-allocated storage for the EFI_DNS6_MODE_DATA structure.
821 @retval EFI_SUCCESS The operation completed successfully.
822 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data is
823 available because this instance has not been configured.
824 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
825 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
831 IN EFI_DNS6_PROTOCOL
*This
,
832 OUT EFI_DNS6_MODE_DATA
*DnsModeData
835 DNS_INSTANCE
*Instance
;
844 DNS6_SERVER_IP
*ServerItem
;
845 EFI_IPv6_ADDRESS
*ServerList
;
846 DNS6_CACHE
*CacheItem
;
847 EFI_DNS6_CACHE_ENTRY
*CacheList
;
854 Status
= EFI_SUCCESS
;
856 if ((This
== NULL
) || (DnsModeData
== NULL
)) {
857 return EFI_INVALID_PARAMETER
;
860 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
862 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This
);
863 if (Instance
->State
== DNS_STATE_UNCONFIGED
) {
864 gBS
->RestoreTPL (OldTpl
);
865 return EFI_NOT_STARTED
;
868 ZeroMem (DnsModeData
, sizeof (EFI_DNS6_MODE_DATA
));
871 // Get the current configuration data of this instance.
873 Status
= Dns6CopyConfigure(&DnsModeData
->DnsConfigData
, &Instance
->Dns6CfgData
);
874 if (EFI_ERROR (Status
)) {
875 gBS
->RestoreTPL (OldTpl
);
880 // Get the DnsServerCount and DnsServerList
883 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns6ServerList
) {
886 DnsModeData
->DnsServerCount
= (UINT32
) Index
;
887 ServerList
= AllocatePool (sizeof(EFI_IPv6_ADDRESS
) * DnsModeData
->DnsServerCount
);
888 ASSERT (ServerList
!= NULL
);
890 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns6ServerList
) {
891 ServerItem
= NET_LIST_USER_STRUCT (Entry
, DNS6_SERVER_IP
, AllServerLink
);
892 CopyMem (ServerList
+ Index
, &ServerItem
->Dns6ServerIp
, sizeof (EFI_IPv6_ADDRESS
));
895 DnsModeData
->DnsServerList
= ServerList
;
898 // Get the DnsCacheCount and DnsCacheList
901 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns6CacheList
) {
904 DnsModeData
->DnsCacheCount
= (UINT32
) Index
;
905 CacheList
= AllocatePool (sizeof(EFI_DNS6_CACHE_ENTRY
) * DnsModeData
->DnsCacheCount
);
906 ASSERT (CacheList
!= NULL
);
908 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns6CacheList
) {
909 CacheItem
= NET_LIST_USER_STRUCT (Entry
, DNS6_CACHE
, AllCacheLink
);
910 CopyMem (CacheList
+ Index
, &CacheItem
->DnsCache
, sizeof (EFI_DNS6_CACHE_ENTRY
));
913 DnsModeData
->DnsCacheList
= CacheList
;
915 gBS
->RestoreTPL (OldTpl
);
921 The function is used to set and change the configuration data for this EFI DNSv6 Protocol driver instance.
922 Reset the DNS instance if DnsConfigData is NULL.
924 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
925 @param[in] DnsConfigData Pointer to the configuration data structure.
926 All associated storage to be allocated and released by caller.
928 @retval EFI_SUCCESS The operation completed successfully.
929 @retval EFI_UNSUPPORTED The designated protocol is not supported.
930 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
931 @retval EFI_INVALID_PARAMETER This is NULL.
932 The StationIp address provided in DnsConfigData is not a valid unicast.
933 DnsServerList is NULL while DnsServerListCount is not equal to Zero.
934 DnsServerListCount is Zero while DnsServerList is not equal to NULL.
935 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI DNSv6 Protocol instance is not configured.
941 IN EFI_DNS6_PROTOCOL
*This
,
942 IN EFI_DNS6_CONFIG_DATA
*DnsConfigData
946 DNS_INSTANCE
*Instance
;
950 UINT32 ServerListCount
;
951 EFI_IPv6_ADDRESS
*ServerList
;
953 Status
= EFI_SUCCESS
;
957 (DnsConfigData
!= NULL
&& ((DnsConfigData
->DnsServerCount
!= 0 && DnsConfigData
->DnsServerList
== NULL
) ||
958 (DnsConfigData
->DnsServerCount
== 0 && DnsConfigData
->DnsServerList
!= NULL
)))) {
959 return EFI_INVALID_PARAMETER
;
962 if (DnsConfigData
!= NULL
&& DnsConfigData
->Protocol
!= DNS_PROTOCOL_UDP
) {
963 return EFI_UNSUPPORTED
;
966 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
968 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This
);
970 if (DnsConfigData
== NULL
) {
971 ZeroMem (&Instance
->SessionDnsServer
, sizeof (EFI_IP_ADDRESS
));
974 // Reset the Instance if ConfigData is NULL
976 if (!NetMapIsEmpty(&Instance
->Dns6TxTokens
)) {
977 Dns6InstanceCancelToken(Instance
, NULL
);
980 Instance
->MaxRetry
= 0;
982 if (Instance
->UdpIo
!= NULL
){
983 UdpIoCleanIo (Instance
->UdpIo
);
986 if (Instance
->Dns6CfgData
.DnsServerList
!= NULL
) {
987 FreePool (Instance
->Dns6CfgData
.DnsServerList
);
989 ZeroMem (&Instance
->Dns6CfgData
, sizeof (EFI_DNS6_CONFIG_DATA
));
991 Instance
->State
= DNS_STATE_UNCONFIGED
;
994 // Configure the parameters for new operation.
996 if (!NetIp6IsUnspecifiedAddr (&DnsConfigData
->StationIp
) && !NetIp6IsValidUnicast (&DnsConfigData
->StationIp
)) {
997 Status
= EFI_INVALID_PARAMETER
;
1001 Status
= Dns6CopyConfigure (&Instance
->Dns6CfgData
, DnsConfigData
);
1002 if (EFI_ERROR (Status
)) {
1006 if (DnsConfigData
->DnsServerCount
== 0 || DnsConfigData
->DnsServerList
== NULL
) {
1007 gBS
->RestoreTPL (OldTpl
);
1010 //The DNS instance will retrieve DNS server from DHCP Server.
1012 Status
= GetDns6ServerFromDhcp6 (
1013 Instance
->Service
->ImageHandle
,
1014 Instance
->Service
->ControllerHandle
,
1018 if (EFI_ERROR (Status
)) {
1022 ASSERT(ServerList
!= NULL
);
1024 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
1026 CopyMem (&Instance
->SessionDnsServer
.v6
, &ServerList
[0], sizeof (EFI_IPv6_ADDRESS
));
1028 CopyMem (&Instance
->SessionDnsServer
.v6
, &DnsConfigData
->DnsServerList
[0], sizeof (EFI_IPv6_ADDRESS
));
1034 Status
= Dns6ConfigUdp (Instance
, Instance
->UdpIo
);
1035 if (EFI_ERROR (Status
)) {
1036 if (Instance
->Dns6CfgData
.DnsServerList
!= NULL
) {
1037 FreePool (Instance
->Dns6CfgData
.DnsServerList
);
1043 // Add configured DNS server used by this instance to ServerList.
1045 Status
= AddDns6ServerIp (&mDriverData
->Dns6ServerList
, Instance
->SessionDnsServer
.v6
);
1046 if (EFI_ERROR (Status
)) {
1047 if (Instance
->Dns6CfgData
.DnsServerList
!= NULL
) {
1048 FreePool (Instance
->Dns6CfgData
.DnsServerList
);
1053 Instance
->State
= DNS_STATE_CONFIGED
;
1057 gBS
->RestoreTPL (OldTpl
);
1062 The function is used to translate the host name to host IP address.
1063 A type AAAA query is used to get the one or more IPv6 addresses for this host.
1065 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1066 @param[in] HostName Pointer to caller-supplied buffer containing Host name to be translated.
1067 This buffer contains 16 bit characters but these are translated to ASCII for use with
1068 DNSv4 server and there is no requirement for driver to support non-ASCII Unicode characters.
1069 @param[in] Token Pointer to the caller-allocated completion token to return at the completion of the process to translate host name to host address.
1071 @retval EFI_SUCCESS The operation completed successfully.
1072 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
1073 @retval EFI_INVALID_PARAMETER This is NULL.
1077 @retval EFI_NO_MAPPING There's no source address is available for use.
1078 @retval EFI_NOT_STARTED This instance has not been started.
1084 IN EFI_DNS6_PROTOCOL
*This
,
1085 IN CHAR16
*HostName
,
1086 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1091 DNS_INSTANCE
*Instance
;
1093 EFI_DNS6_CONFIG_DATA
*ConfigData
;
1102 DNS6_TOKEN_ENTRY
*TokenEntry
;
1107 Status
= EFI_SUCCESS
;
1114 // Validate the parameters
1116 if ((This
== NULL
) || (HostName
== NULL
) || Token
== NULL
) {
1117 return EFI_INVALID_PARAMETER
;
1120 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
1122 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This
);
1124 ConfigData
= &(Instance
->Dns6CfgData
);
1126 Instance
->MaxRetry
= ConfigData
->RetryCount
;
1128 Token
->Status
= EFI_NOT_READY
;
1129 Token
->RetryCount
= 0;
1130 Token
->RetryInterval
= ConfigData
->RetryInterval
;
1132 if (Instance
->State
!= DNS_STATE_CONFIGED
) {
1133 Status
= EFI_NOT_STARTED
;
1138 // Check the MaxRetry and RetryInterval values.
1140 if (Instance
->MaxRetry
== 0) {
1141 Instance
->MaxRetry
= DNS_DEFAULT_RETRY
;
1144 if (Token
->RetryInterval
< DNS_DEFAULT_TIMEOUT
) {
1145 Token
->RetryInterval
= DNS_DEFAULT_TIMEOUT
;
1151 if (ConfigData
->EnableDnsCache
) {
1153 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns6CacheList
) {
1154 Item
= NET_LIST_USER_STRUCT (Entry
, DNS6_CACHE
, AllCacheLink
);
1155 if (StrCmp (HostName
, Item
->DnsCache
.HostName
) == 0) {
1161 Token
->RspData
.H2AData
= AllocatePool (sizeof (DNS6_HOST_TO_ADDR_DATA
));
1162 if (Token
->RspData
.H2AData
== NULL
) {
1163 Status
= EFI_OUT_OF_RESOURCES
;
1167 Token
->RspData
.H2AData
->IpCount
= (UINT32
)Index
;
1168 Token
->RspData
.H2AData
->IpList
= AllocatePool (sizeof (EFI_IPv6_ADDRESS
) * Index
);
1169 if (Token
->RspData
.H2AData
->IpList
== NULL
) {
1170 if (Token
->RspData
.H2AData
!= NULL
) {
1171 FreePool (Token
->RspData
.H2AData
);
1174 Status
= EFI_OUT_OF_RESOURCES
;
1179 NET_LIST_FOR_EACH_SAFE (Entry
, Next
, &mDriverData
->Dns6CacheList
) {
1180 Item
= NET_LIST_USER_STRUCT (Entry
, DNS6_CACHE
, AllCacheLink
);
1181 if ((UINT32
)Index
< Token
->RspData
.H2AData
->IpCount
&& StrCmp (HostName
, Item
->DnsCache
.HostName
) == 0) {
1182 CopyMem ((Token
->RspData
.H2AData
->IpList
) + Index
, Item
->DnsCache
.IpAddress
, sizeof (EFI_IPv6_ADDRESS
));
1187 Token
->Status
= EFI_SUCCESS
;
1189 if (Token
->Event
!= NULL
) {
1190 gBS
->SignalEvent (Token
->Event
);
1194 Status
= Token
->Status
;
1200 // Construct DNS TokenEntry.
1202 TokenEntry
= AllocateZeroPool (sizeof (DNS6_TOKEN_ENTRY
));
1203 if (TokenEntry
== NULL
) {
1204 Status
= EFI_OUT_OF_RESOURCES
;
1208 TokenEntry
->PacketToLive
= Token
->RetryInterval
;
1209 TokenEntry
->QueryHostName
= HostName
;
1210 TokenEntry
->Token
= Token
;
1216 QueryName
= DnsFillinQNameForQueryIp (TokenEntry
->QueryHostName
);
1217 if (QueryName
== NULL
) {
1218 Status
= EFI_OUT_OF_RESOURCES
;
1223 // Construct DNS Query Packet.
1225 Status
= ConstructDNSQuery (Instance
, QueryName
, DNS_TYPE_AAAA
, DNS_CLASS_INET
, &Packet
);
1226 if (EFI_ERROR (Status
)) {
1227 if (TokenEntry
!= NULL
) {
1228 FreePool (TokenEntry
);
1235 // Save the token into the Dns6TxTokens map.
1237 Status
= NetMapInsertTail (&Instance
->Dns6TxTokens
, TokenEntry
, Packet
);
1238 if (EFI_ERROR (Status
)) {
1239 if (TokenEntry
!= NULL
) {
1240 FreePool (TokenEntry
);
1243 NetbufFree (Packet
);
1251 Status
= DoDnsQuery (Instance
, Packet
);
1252 if (EFI_ERROR (Status
)) {
1253 if (TokenEntry
!= NULL
) {
1254 FreePool (TokenEntry
);
1257 NetbufFree (Packet
);
1261 if (QueryName
!= NULL
) {
1262 FreePool (QueryName
);
1265 gBS
->RestoreTPL (OldTpl
);
1270 The function is used to translate the host address to host name.
1271 A type PTR query is used to get the primary name of the host.
1273 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1274 @param[in] IpAddress IP address.
1275 @param[in] Token Pointer to the caller-allocated completion used token to translate host address to host name.
1277 @retval EFI_SUCCESS The operation completed successfully.
1278 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
1279 @retval EFI_INVALID_PARAMETER This is NULL.
1281 Token.Event is NULL.
1282 IpAddress is not valid IP address.
1283 @retval EFI_NO_MAPPING There's no source address is available for use.
1284 @retval EFI_NOT_STARTED This instance has not been started.
1285 @retval EFI_UNSUPPORTED This function is not supported.
1291 IN EFI_DNS6_PROTOCOL
*This
,
1292 IN EFI_IPv6_ADDRESS IpAddress
,
1293 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1296 return EFI_UNSUPPORTED
;
1300 This function retrieves arbitrary information from the DNS.
1301 The caller supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned.
1302 All RR content (e.g., Ttl) was returned.
1303 The caller need parse the returned RR to get required information. This function is optional.
1305 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1306 @param[in] QName Pointer to Query Name.
1307 @param[in] QType Query Type.
1308 @param[in] QClass Query Name.
1309 @param[in] Token Point to the caller-allocated completion token to retrieve arbitrary information.
1311 @retval EFI_SUCCESS The operation completed successfully.
1312 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
1313 @retval EFI_INVALID_PARAMETER This is NULL.
1315 Token.Event is NULL.
1317 @retval EFI_NO_MAPPING There's no source address is available for use.
1318 @retval EFI_NOT_STARTED This instance has not been started.
1319 @retval EFI_UNSUPPORTED This function is not supported. Or the requested QType is not supported
1325 IN EFI_DNS6_PROTOCOL
*This
,
1329 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1334 DNS_INSTANCE
*Instance
;
1336 EFI_DNS6_CONFIG_DATA
*ConfigData
;
1338 DNS6_TOKEN_ENTRY
*TokenEntry
;
1343 Status
= EFI_SUCCESS
;
1348 // Validate the parameters
1350 if ((This
== NULL
) || (QName
== NULL
) || Token
== NULL
) {
1351 return EFI_INVALID_PARAMETER
;
1354 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
1356 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This
);
1358 ConfigData
= &(Instance
->Dns6CfgData
);
1360 Instance
->MaxRetry
= ConfigData
->RetryCount
;
1362 Token
->Status
= EFI_NOT_READY
;
1363 Token
->RetryCount
= 0;
1364 Token
->RetryInterval
= ConfigData
->RetryInterval
;
1366 if (Instance
->State
!= DNS_STATE_CONFIGED
) {
1367 Status
= EFI_NOT_STARTED
;
1372 // Check the MaxRetry and RetryInterval values.
1374 if (Instance
->MaxRetry
== 0) {
1375 Instance
->MaxRetry
= DNS_DEFAULT_RETRY
;
1378 if (Token
->RetryInterval
< DNS_DEFAULT_TIMEOUT
) {
1379 Token
->RetryInterval
= DNS_DEFAULT_TIMEOUT
;
1383 // Construct DNS TokenEntry.
1385 TokenEntry
= AllocateZeroPool (sizeof(DNS6_TOKEN_ENTRY
));
1386 if (TokenEntry
== NULL
) {
1387 Status
= EFI_OUT_OF_RESOURCES
;
1391 TokenEntry
->PacketToLive
= Token
->RetryInterval
;
1392 TokenEntry
->GeneralLookUp
= TRUE
;
1393 TokenEntry
->Token
= Token
;
1396 // Construct DNS Query Packet.
1398 Status
= ConstructDNSQuery (Instance
, QName
, QType
, QClass
, &Packet
);
1399 if (EFI_ERROR (Status
)) {
1400 if (TokenEntry
!= NULL
) {
1401 FreePool (TokenEntry
);
1408 // Save the token into the Dns6TxTokens map.
1410 Status
= NetMapInsertTail (&Instance
->Dns6TxTokens
, TokenEntry
, Packet
);
1411 if (EFI_ERROR (Status
)) {
1412 if (TokenEntry
!= NULL
) {
1413 FreePool (TokenEntry
);
1416 NetbufFree (Packet
);
1424 Status
= DoDnsQuery (Instance
, Packet
);
1425 if (EFI_ERROR (Status
)) {
1426 if (TokenEntry
!= NULL
) {
1427 FreePool (TokenEntry
);
1430 NetbufFree (Packet
);
1434 gBS
->RestoreTPL (OldTpl
);
1439 This function is used to add/delete/modify DNS cache entry.
1440 DNS cache can be normally dynamically updated after the DNS resolve succeeds.
1441 This function provided capability to manually add/delete/modify the DNS cache.
1443 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1444 @param[in] DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
1445 If TRUE, this function will delete matching DNS Cache entry.
1446 @param[in] Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
1447 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
1448 @param[in] DnsCacheEntry Pointer to DNS Cache entry.
1450 @retval EFI_SUCCESS The operation completed successfully.
1451 @retval EFI_INVALID_PARAMETER This is NULL.
1452 DnsCacheEntry.HostName is NULL.
1453 DnsCacheEntry.IpAddress is NULL.
1454 DnsCacheEntry.Timeout is zero.
1455 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is not TRUE.
1460 Dns6UpdateDnsCache (
1461 IN EFI_DNS6_PROTOCOL
*This
,
1462 IN BOOLEAN DeleteFlag
,
1463 IN BOOLEAN Override
,
1464 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
1470 Status
= EFI_SUCCESS
;
1472 if (DnsCacheEntry
.HostName
== NULL
|| DnsCacheEntry
.IpAddress
== NULL
|| DnsCacheEntry
.Timeout
== 0) {
1473 return EFI_INVALID_PARAMETER
;
1476 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
1479 // Update Dns6Cache here.
1481 Status
= UpdateDns6Cache (&mDriverData
->Dns6CacheList
, DeleteFlag
, Override
, DnsCacheEntry
);
1483 gBS
->RestoreTPL (OldTpl
);
1489 This function can be used by network drivers and applications to increase the rate that data packets are moved between
1490 the communications device and the transmit and receive queues. In some systems, the periodic timer event in the managed
1491 network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets
1492 without missing incoming packets or dropping outgoing packets.
1494 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1496 @retval EFI_SUCCESS Incoming or outgoing data was processed.
1497 @retval EFI_INVALID_PARAMETER This is NULL.
1498 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
1499 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
1500 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
1501 Consider increasing the polling rate.
1507 IN EFI_DNS6_PROTOCOL
*This
1510 DNS_INSTANCE
*Instance
;
1511 EFI_UDP6_PROTOCOL
*Udp
;
1514 return EFI_INVALID_PARAMETER
;
1517 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This
);
1519 if (Instance
->State
== DNS_STATE_UNCONFIGED
) {
1520 return EFI_NOT_STARTED
;
1521 } else if (Instance
->State
== DNS_STATE_DESTROY
) {
1522 return EFI_DEVICE_ERROR
;
1525 Udp
= Instance
->UdpIo
->Protocol
.Udp6
;
1527 return Udp
->Poll (Udp
);
1531 This function is used to abort a pending resolution request.
1532 After calling this function, Token.Status will be set to EFI_ABORTED and then Token.
1534 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1535 @param[in] Token Pointer to a token that has been issued by EFI_DNS6_PROTOCOL.HostNameToIp(),
1536 EFI_DNS6_PROTOCOL.IpToHostName() or EFI_DNS6_PROTOCOL.GeneralLookup().
1537 If NULL, all pending tokens are aborted.
1539 @retval EFI_SUCCESS Incoming or outgoing data was processed.
1540 @retval EFI_INVALID_PARAMETER This is NULL.
1541 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
1542 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS operation was not found in the transmit queue.
1543 It was either completed or was not issued by HostNameToIp(), IpToHostName() or GeneralLookup().
1549 IN EFI_DNS6_PROTOCOL
*This
,
1550 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1554 DNS_INSTANCE
*Instance
;
1558 return EFI_INVALID_PARAMETER
;
1561 Instance
= DNS_INSTANCE_FROM_THIS_PROTOCOL6 (This
);
1563 if (Instance
->State
== DNS_STATE_UNCONFIGED
) {
1564 return EFI_NOT_STARTED
;
1567 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
1570 // Cancle the tokens specified by Token for this instance.
1572 Status
= Dns6InstanceCancelToken (Instance
, Token
);
1575 // Dispatch the DPC queued by the NotifyFunction of the canceled token's events.
1579 gBS
->RestoreTPL (OldTpl
);