2 DnsDxe support functions implementation.
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.
15 #ifndef __EFI_DNS_IMPL_H_
16 #define __EFI_DNS_IMPL_H_
23 #include <Library/BaseLib.h>
24 #include <Library/UefiLib.h>
25 #include <Library/UefiBootServicesTableLib.h>
26 #include <Library/UefiDriverEntryPoint.h>
27 #include <Library/UefiRuntimeServicesTableLib.h>
28 #include <Library/BaseMemoryLib.h>
29 #include <Library/MemoryAllocationLib.h>
30 #include <Library/NetLib.h>
31 #include <Library/DebugLib.h>
32 #include <Library/DpcLib.h>
33 #include <Library/PrintLib.h>
34 #include <Library/UdpIoLib.h>
37 // UEFI Driver Model Protocols
39 #include <Protocol/DriverBinding.h>
40 #include <Protocol/ComponentName2.h>
41 #include <Protocol/ComponentName.h>
43 #include <Protocol/Udp4.h>
44 #include <Protocol/Dhcp4.h>
45 #include <Protocol/Dns4.h>
47 #include <Protocol/Udp6.h>
48 #include <Protocol/Dhcp6.h>
49 #include <Protocol/Dns6.h>
51 #include <Protocol/Ip4Config2.h>
53 #include "DnsDriver.h"
59 #define DNS_VERSION 0x00000000
64 extern EFI_COMPONENT_NAME_PROTOCOL gDnsComponentName
;
65 extern EFI_COMPONENT_NAME2_PROTOCOL gDnsComponentName2
;
66 extern EFI_UNICODE_STRING_TABLE
*gDnsControllerNameTable
;
68 extern EFI_DRIVER_BINDING_PROTOCOL gDns4DriverBinding
;
69 extern EFI_SERVICE_BINDING_PROTOCOL mDns4ServiceBinding
;
70 extern EFI_DNS4_PROTOCOL mDns4Protocol
;
72 extern EFI_DRIVER_BINDING_PROTOCOL gDns6DriverBinding
;
73 extern EFI_SERVICE_BINDING_PROTOCOL mDns6ServiceBinding
;
74 extern EFI_DNS6_PROTOCOL mDns6Protocol
;
79 #define DNS_SERVER_PORT 53
81 #define DNS_PROTOCOL_UDP EFI_IP_PROTO_UDP
82 #define DNS_PROTOCOL_TCP EFI_IP_PROTO_TCP
84 #define DNS_STATE_UNCONFIGED 0
85 #define DNS_STATE_CONFIGED 1
86 #define DNS_STATE_DESTROY 2
88 #define DNS_DEFAULT_TIMEOUT 2
89 #define DNS_DEFAULT_RETRY 3
90 #define DNS_DEFAULT_BLKSIZE 512
92 #define DNS_TIME_TO_GETMAP 5
96 typedef union _DNS_FLAGS DNS_FLAGS
;
99 LIST_ENTRY AllCacheLink
;
100 EFI_DNS4_CACHE_ENTRY DnsCache
;
104 LIST_ENTRY AllCacheLink
;
105 EFI_DNS6_CACHE_ENTRY DnsCache
;
109 LIST_ENTRY AllServerLink
;
110 EFI_IPv4_ADDRESS Dns4ServerIp
;
114 LIST_ENTRY AllServerLink
;
115 EFI_IPv6_ADDRESS Dns6ServerIp
;
120 CHAR16
*QueryHostName
;
121 EFI_IPv4_ADDRESS QueryIpAddress
;
122 BOOLEAN GeneralLookUp
;
123 EFI_DNS4_COMPLETION_TOKEN
*Token
;
128 CHAR16
*QueryHostName
;
129 EFI_IPv6_ADDRESS QueryIpAddress
;
130 BOOLEAN GeneralLookUp
;
131 EFI_DNS6_COMPLETION_TOKEN
*Token
;
148 #define DNS_FLAGS_QR_QUERY 0
149 #define DNS_FLAGS_QR_RESPONSE 1
151 #define DNS_FLAGS_OPCODE_STANDARD 0
152 #define DNS_FLAGS_OPCODE_INVERSE 1
153 #define DNS_FLAGS_OPCODE_SERVER_STATE 2
155 #define DNS_FLAGS_RCODE_NO_ERROR 0
156 #define DNS_FLAGS_RCODE_NAME_ERROR 3
159 UINT16 Identification
;
177 } DNS_ANSWER_SECTION
;
180 #define DNS_TYPE_NS 2
181 #define DNS_TYPE_CNAME 5
182 #define DNS_TYPE_PTR 12
183 #define DNS_TYPE_HINFO 13
184 #define DNS_TYPE_MX 15
185 #define DNS_TYPE_AAAA 28
186 #define DNS_TYPE_SRV_RR 33
187 #define DNS_TYPE_AXFR 252
188 #define DNS_TYPE_ANY 255
190 #define DNS_CLASS_INET 1
192 #define DNS4_DOMAIN L"in-addr.arpa"
193 #define DNS6_DOMAIN L"IP6.ARPA"
199 Remove TokenEntry from TokenMap.
201 @param[in] TokenMap All DNSv4 Token entrys.
202 @param[in] TokenEntry TokenEntry need to be removed.
204 @retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.
205 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
209 Dns4RemoveTokenEntry (
210 IN NET_MAP
*TokenMap
,
211 IN DNS4_TOKEN_ENTRY
*TokenEntry
215 Remove TokenEntry from TokenMap.
217 @param[in] TokenMap All DNSv6 Token entrys.
218 @param[in] TokenEntry TokenEntry need to be removed.
220 @retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.
221 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
225 Dns6RemoveTokenEntry (
226 IN NET_MAP
*TokenMap
,
227 IN DNS6_TOKEN_ENTRY
*TokenEntry
231 This function cancle the token specified by Arg in the Map.
233 @param[in] Map Pointer to the NET_MAP.
234 @param[in] Item Pointer to the NET_MAP_ITEM.
235 @param[in] Arg Pointer to the token to be cancelled. If NULL, all
236 the tokens in this Map will be cancelled.
237 This parameter is optional and may be NULL.
239 @retval EFI_SUCCESS The token is cancelled if Arg is NULL, or the token
240 is not the same as that in the Item, if Arg is not
242 @retval EFI_ABORTED Arg is not NULL, and the token specified by Arg is
250 IN NET_MAP_ITEM
*Item
,
251 IN VOID
*Arg OPTIONAL
255 This function cancle the token specified by Arg in the Map.
257 @param[in] Map Pointer to the NET_MAP.
258 @param[in] Item Pointer to the NET_MAP_ITEM.
259 @param[in] Arg Pointer to the token to be cancelled. If NULL, all
260 the tokens in this Map will be cancelled.
261 This parameter is optional and may be NULL.
263 @retval EFI_SUCCESS The token is cancelled if Arg is NULL, or the token
264 is not the same as that in the Item, if Arg is not
266 @retval EFI_ABORTED Arg is not NULL, and the token specified by Arg is
274 IN NET_MAP_ITEM
*Item
,
275 IN VOID
*Arg OPTIONAL
279 Get the TokenEntry from the TokensMap.
281 @param[in] TokensMap All DNSv4 Token entrys
282 @param[in] Token Pointer to the token to be get.
283 @param[out] TokenEntry Pointer to TokenEntry corresponding Token.
285 @retval EFI_SUCCESS Get the TokenEntry from the TokensMap sucessfully.
286 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
292 IN NET_MAP
*TokensMap
,
293 IN EFI_DNS4_COMPLETION_TOKEN
*Token
,
294 OUT DNS4_TOKEN_ENTRY
**TokenEntry
298 Get the TokenEntry from the TokensMap.
300 @param[in] TokensMap All DNSv6 Token entrys
301 @param[in] Token Pointer to the token to be get.
302 @param[out] TokenEntry Pointer to TokenEntry corresponding Token.
304 @retval EFI_SUCCESS Get the TokenEntry from the TokensMap sucessfully.
305 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
311 IN NET_MAP
*TokensMap
,
312 IN EFI_DNS6_COMPLETION_TOKEN
*Token
,
313 OUT DNS6_TOKEN_ENTRY
**TokenEntry
317 Cancel DNS4 tokens from the DNS4 instance.
319 @param[in] Instance Pointer to the DNS instance context data.
320 @param[in] Token Pointer to the token to be canceled. If NULL, all
321 tokens in this instance will be cancelled.
322 This parameter is optional and may be NULL.
324 @retval EFI_SUCCESS The Token is cancelled.
325 @retval EFI_NOT_FOUND The Token is not found.
329 Dns4InstanceCancelToken (
330 IN DNS_INSTANCE
*Instance
,
331 IN EFI_DNS4_COMPLETION_TOKEN
*Token
335 Cancel DNS6 tokens from the DNS6 instance.
337 @param[in] Instance Pointer to the DNS instance context data.
338 @param[in] Token Pointer to the token to be canceled. If NULL, all
339 tokens in this instance will be cancelled.
340 This parameter is optional and may be NULL.
342 @retval EFI_SUCCESS The Token is cancelled.
343 @retval EFI_NOT_FOUND The Token is not found.
347 Dns6InstanceCancelToken (
348 IN DNS_INSTANCE
*Instance
,
349 IN EFI_DNS6_COMPLETION_TOKEN
*Token
353 Free the resource related to the configure parameters.
355 @param Config The DNS configure data
360 IN OUT EFI_DNS4_CONFIG_DATA
*Config
364 Free the resource related to the configure parameters.
366 @param Config The DNS configure data
371 IN OUT EFI_DNS6_CONFIG_DATA
*Config
375 Allocate memory for configure parameter such as timeout value for Dst,
376 then copy the configure parameter from Src to Dst.
378 @param[out] Dst The destination DHCP configure data.
379 @param[in] Src The source DHCP configure data.
381 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
382 @retval EFI_SUCCESS The configure is copied.
387 OUT EFI_DNS4_CONFIG_DATA
*Dst
,
388 IN EFI_DNS4_CONFIG_DATA
*Src
392 Allocate memory for configure parameter such as timeout value for Dst,
393 then copy the configure parameter from Src to Dst.
395 @param[out] Dst The destination DHCP configure data.
396 @param[in] Src The source DHCP configure data.
398 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
399 @retval EFI_SUCCESS The configure is copied.
404 OUT EFI_DNS6_CONFIG_DATA
*Dst
,
405 IN EFI_DNS6_CONFIG_DATA
*Src
409 Callback of Dns packet. Does nothing.
411 @param Arg The context.
421 Poll the UDP to get the IP4 default address, which may be retrieved
424 The default time out value is 5 seconds. If IP has retrieved the default address,
425 the UDP is reconfigured.
427 @param Instance The DNS instance
428 @param UdpIo The UDP_IO to poll
429 @param UdpCfgData The UDP configure data to reconfigure the UDP_IO
431 @retval TRUE The default address is retrieved and UDP is reconfigured.
432 @retval FALSE Some error occured.
437 IN DNS_INSTANCE
*Instance
,
439 IN EFI_UDP4_CONFIG_DATA
*UdpCfgData
443 Configure the opened Udp6 instance until the corresponding Ip6 instance
446 @param Instance The DNS instance
447 @param UdpIo The UDP_IO to poll
448 @param UdpCfgData The UDP configure data to reconfigure the UDP_IO
450 @retval TRUE Configure the Udp6 instance successfully.
451 @retval FALSE Some error occured.
456 IN DNS_INSTANCE
*Instance
,
458 IN EFI_UDP6_CONFIG_DATA
*UdpCfgData
464 @param Instance The DNS session
465 @param UdpIo The UDP_IO instance
467 @retval EFI_SUCCESS The UDP is successfully configured for the
473 IN DNS_INSTANCE
*Instance
,
480 @param Instance The DNS session
481 @param UdpIo The UDP_IO instance
483 @retval EFI_SUCCESS The UDP is successfully configured for the
489 IN DNS_INSTANCE
*Instance
,
494 Update Dns4 cache to shared list of caches of all DNSv4 instances.
496 @param Dns4CacheList All Dns4 cache list.
497 @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
498 If TRUE, this function will delete matching DNS Cache entry.
499 @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
500 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
501 @param DnsCacheEntry Entry Pointer to DNS Cache entry.
503 @retval EFI_SUCCESS Update Dns4 cache successfully.
504 @retval Others Failed to update Dns4 cache.
510 IN LIST_ENTRY
*Dns4CacheList
,
511 IN BOOLEAN DeleteFlag
,
513 IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry
517 Update Dns6 cache to shared list of caches of all DNSv6 instances.
519 @param Dns6CacheList All Dns6 cache list.
520 @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
521 If TRUE, this function will delete matching DNS Cache entry.
522 @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
523 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
524 @param DnsCacheEntry Entry Pointer to DNS Cache entry.
526 @retval EFI_SUCCESS Update Dns6 cache successfully.
527 @retval Others Failed to update Dns6 cache.
532 IN LIST_ENTRY
*Dns6CacheList
,
533 IN BOOLEAN DeleteFlag
,
535 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
539 Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.
541 @param Dns4ServerList Common list of addresses of all configured DNSv4 server.
542 @param ServerIp DNS server Ip.
544 @retval EFI_SUCCESS Add Dns4 ServerIp to common list successfully.
545 @retval Others Failed to add Dns4 ServerIp to common list.
551 IN LIST_ENTRY
*Dns4ServerList
,
552 IN EFI_IPv4_ADDRESS ServerIp
556 Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.
558 @param Dns6ServerList Common list of addresses of all configured DNSv6 server.
559 @param ServerIp DNS server Ip.
561 @retval EFI_SUCCESS Add Dns6 ServerIp to common list successfully.
562 @retval Others Failed to add Dns6 ServerIp to common list.
568 IN LIST_ENTRY
*Dns6ServerList
,
569 IN EFI_IPv6_ADDRESS ServerIp
573 Fill QName for IP querying. QName is a domain name represented as
574 a sequence of labels, where each label consists of a length octet
575 followed by that number of octets. The domain name terminates with
576 the zero length octet for the null label of the root.
578 @param HostName Queried HostName
580 @retval NULL Failed to fill QName.
581 @return QName filled successfully.
586 DnsFillinQNameForQueryIp (
591 Find out whether the response is valid or invalid.
593 @param TokensMap All DNS transmittal Tokens entry.
594 @param Identification Identification for queried packet.
595 @param Type Type for queried packet.
596 @param Item Return corresponding Token entry.
598 @retval TRUE The response is valid.
599 @retval FALSE The response is invalid.
604 IN NET_MAP
*TokensMap
,
605 IN UINT16 Identification
,
607 OUT NET_MAP_ITEM
**Item
613 @param Instance The DNS instance
614 @param RxString Received buffer.
615 @param Completed Flag to indicate that Dns response is valid.
617 @retval EFI_SUCCESS Parse Dns Response successfully.
618 @retval Others Failed to parse Dns Response.
623 IN OUT DNS_INSTANCE
*Instance
,
625 OUT BOOLEAN
*Completed
629 Parse response packet.
631 @param Packet The packets received.
632 @param EndPoint The local/remote UDP access point
633 @param IoStatus The status of the UDP receive
634 @param Context The opaque parameter to the function.
639 DnsOnPacketReceived (
641 UDP_END_POINT
*EndPoint
,
647 Release the net buffer when packet is sent.
649 @param Packet The packets received.
650 @param EndPoint The local/remote UDP access point
651 @param IoStatus The status of the UDP receive
652 @param Context The opaque parameter to the function.
659 UDP_END_POINT
*EndPoint
,
665 Query request information.
667 @param Instance The DNS instance
668 @param Packet The packet for querying request information.
670 @retval EFI_SUCCESS Query request information successfully.
671 @retval Others Failed to query request information.
676 IN DNS_INSTANCE
*Instance
,
681 Construct the Packet according query section.
683 @param Instance The DNS instance
684 @param QueryName Queried Name
685 @param Type Queried Type
686 @param Class Queried Class
687 @param Packet The packet for query
689 @retval EFI_SUCCESS The packet is constructed.
690 @retval Others Failed to construct the Packet.
695 IN DNS_INSTANCE
*Instance
,
703 Retransmit the packet.
705 @param Instance The DNS instance
706 @param Packet Retransmit the packet
708 @retval EFI_SUCCESS The packet is retransmitted.
709 @retval Others Failed to retransmit.
714 IN DNS_INSTANCE
*Instance
,
719 The timer ticking function for the DNS service.
721 @param Event The ticking event
722 @param Context The DNS service instance
727 DnsOnTimerRetransmit (
733 The timer ticking function for the DNS driver.
735 @param Event The ticking event
748 This function is used to retrieve DNS mode data for this DNS instance.
750 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
751 @param[out] DnsModeData Pointer to the caller-allocated storage for the EFI_DNS4_MODE_DATA structure.
753 @retval EFI_SUCCESS The operation completed successfully.
754 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data is
755 available because this instance has not been configured.
756 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
757 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
763 IN EFI_DNS4_PROTOCOL
*This
,
764 OUT EFI_DNS4_MODE_DATA
*DnsModeData
768 This function is used to configure DNS configuration data for this DNS instance.
770 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
771 @param[in] DnsConfigData Pointer to caller-allocated buffer containing EFI_DNS4_CONFIG_DATA structure.
772 If NULL, the driver will reinitialize the protocol instance to the unconfigured state.
774 @retval EFI_SUCCESS The operation completed successfully.
775 @retval EFI_UNSUPPORTED The designated protocol is not supported.
776 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
777 @retval EFI_INVALID_PARAMETER This is NULL.
778 The StationIp address provided in DnsConfigData is not a valid unicast.
779 DnsServerList is NULL while DnsServerListCount is not equal to Zero.
780 DnsServerListCount is Zero while DnsServerListCount is not equal to NULL.
781 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI DNSv4 Protocol instance is not configured.
787 IN EFI_DNS4_PROTOCOL
*This
,
788 IN EFI_DNS4_CONFIG_DATA
*DnsConfigData
792 The function is used to translate the host name to host IP address.
793 A type A query is used to get the one or more IP addresses for this host.
795 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
796 @param[in] HostName Pointer to caller-supplied buffer containing Host name to be translated.
797 This buffer contains 16 bit characters but these are translated to ASCII for use with
798 DNSv4 server and there is no requirement for driver to support non-ASCII Unicode characters.
799 @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.
801 @retval EFI_SUCCESS The operation completed successfully.
802 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
803 @retval EFI_INVALID_PARAMETER This is NULL.
807 @retval EFI_NO_MAPPING There's no source address is available for use.
808 @retval EFI_NOT_STARTED This instance has not been started.
814 IN EFI_DNS4_PROTOCOL
*This
,
816 IN EFI_DNS4_COMPLETION_TOKEN
*Token
820 The function is used to translate the host address to host name.
821 A type PTR query is used to get the primary name of the host.
823 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
824 @param[in] IpAddress IP address.
825 @param[in] Token Pointer to the caller-allocated completion used token to translate host address to host name.
827 @retval EFI_SUCCESS The operation completed successfully.
828 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
829 @retval EFI_INVALID_PARAMETER This is NULL.
832 IpAddress is not valid IP address.
833 @retval EFI_NO_MAPPING There's no source address is available for use.
834 @retval EFI_NOT_STARTED This instance has not been started.
835 @retval EFI_UNSUPPORTED This function is not supported.
841 IN EFI_DNS4_PROTOCOL
*This
,
842 IN EFI_IPv4_ADDRESS IpAddress
,
843 IN EFI_DNS4_COMPLETION_TOKEN
*Token
847 This function retrieves arbitrary information from the DNS.
848 The caller supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned.
849 All RR content (e.g., Ttl) was returned.
850 The caller need parse the returned RR to get required information. This function is optional.
852 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
853 @param[in] QName Pointer to Query Name.
854 @param[in] QType Query Type.
855 @param[in] QClass Query Name.
856 @param[in] Token Point to the caller-allocated completion token to retrieve arbitrary information.
858 @retval EFI_SUCCESS The operation completed successfully.
859 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
860 @retval EFI_INVALID_PARAMETER This is NULL.
864 @retval EFI_NO_MAPPING There's no source address is available for use.
865 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.
866 @retval EFI_UNSUPPORTED This function is not supported. Or the requested QType is not supported
872 IN EFI_DNS4_PROTOCOL
*This
,
876 IN EFI_DNS4_COMPLETION_TOKEN
*Token
880 This function is used to add/delete/modify DNS cache entry.
881 DNS cache can be normally dynamically updated after the DNS resolve succeeds.
882 This function provided capability to manually add/delete/modify the DNS cache.
884 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
885 @param[in] DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
886 If TRUE, this function will delete matching DNS Cache entry.
887 @param[in] Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
888 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
889 @param[in] DnsCacheEntry Pointer to DNS Cache entry.
891 @retval EFI_SUCCESS The operation completed successfully.
892 @retval EFI_INVALID_PARAMETER This is NULL.
893 DnsCacheEntry.HostName is NULL.
894 DnsCacheEntry.IpAddress is NULL.
895 DnsCacheEntry.Timeout is zero.
896 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is not TRUE.
902 IN EFI_DNS4_PROTOCOL
*This
,
903 IN BOOLEAN DeleteFlag
,
905 IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry
909 This function can be used by network drivers and applications to increase the rate that data packets are moved between
910 the communications device and the transmit and receive queues. In some systems, the periodic timer event in the managed
911 network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets
912 without missing incoming packets or dropping outgoing packets.
914 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
916 @retval EFI_SUCCESS Incoming or outgoing data was processed.
917 @retval EFI_INVALID_PARAMETER This is NULL.
918 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
919 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
920 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
921 Consider increasing the polling rate.
927 IN EFI_DNS4_PROTOCOL
*This
931 This function is used to abort a pending resolution request.
932 After calling this function, Token.Status will be set to EFI_ABORTED and then Token.
934 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
935 @param[in] Token Pointer to a token that has been issued by EFI_DNS4_PROTOCOL.HostNameToIp(),
936 EFI_DNS4_PROTOCOL.IpToHostName() or EFI_DNS4_PROTOCOL.GeneralLookup().
937 If NULL, all pending tokens are aborted.
939 @retval EFI_SUCCESS Incoming or outgoing data was processed.
940 @retval EFI_INVALID_PARAMETER This is NULL.
941 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
942 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS operation was not found in the transmit queue.
943 It was either completed or was not issued by HostNameToIp(), IpToHostName() or GeneralLookup().
949 IN EFI_DNS4_PROTOCOL
*This
,
950 IN EFI_DNS4_COMPLETION_TOKEN
*Token
955 This function is used to retrieve DNS mode data for this DNS instance.
957 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
958 @param[out] DnsModeData Pointer to the caller-allocated storage for the EFI_DNS6_MODE_DATA structure.
960 @retval EFI_SUCCESS The operation completed successfully.
961 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data is
962 available because this instance has not been configured.
963 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
964 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
970 IN EFI_DNS6_PROTOCOL
*This
,
971 OUT EFI_DNS6_MODE_DATA
*DnsModeData
975 The function is used to set and change the configuration data for this EFI DNSv6 Protocol driver instance.
976 Reset the DNS instance if DnsConfigData is NULL.
978 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
979 @param[in] DnsConfigData Pointer to the configuration data structure.
980 All associated storage to be allocated and released by caller.
982 @retval EFI_SUCCESS The operation completed successfully.
983 @retval EFI_UNSUPPORTED The designated protocol is not supported.
984 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
985 @retval EFI_INVALID_PARAMETER This is NULL.
986 The StationIp address provided in DnsConfigData is not a valid unicast.
987 DnsServerList is NULL while DnsServerListCount is not equal to Zero.
988 DnsServerListCount is Zero while DnsServerList is not equal to NULL.
989 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI DNSv6 Protocol instance is not configured.
995 IN EFI_DNS6_PROTOCOL
*This
,
996 IN EFI_DNS6_CONFIG_DATA
*DnsConfigData
1000 The function is used to translate the host name to host IP address.
1001 A type AAAA query is used to get the one or more IPv6 addresses for this host.
1003 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1004 @param[in] HostName Pointer to caller-supplied buffer containing Host name to be translated.
1005 This buffer contains 16 bit characters but these are translated to ASCII for use with
1006 DNSv4 server and there is no requirement for driver to support non-ASCII Unicode characters.
1007 @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.
1009 @retval EFI_SUCCESS The operation completed successfully.
1010 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
1011 @retval EFI_INVALID_PARAMETER This is NULL.
1015 @retval EFI_NO_MAPPING There's no source address is available for use.
1016 @retval EFI_NOT_STARTED This instance has not been started.
1022 IN EFI_DNS6_PROTOCOL
*This
,
1023 IN CHAR16
*HostName
,
1024 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1028 The function is used to translate the host address to host name.
1029 A type PTR query is used to get the primary name of the host.
1031 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1032 @param[in] IpAddress IP address.
1033 @param[in] Token Pointer to the caller-allocated completion used token to translate host address to host name.
1035 @retval EFI_SUCCESS The operation completed successfully.
1036 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
1037 @retval EFI_INVALID_PARAMETER This is NULL.
1039 Token.Event is NULL.
1040 IpAddress is not valid IP address.
1041 @retval EFI_NO_MAPPING There's no source address is available for use.
1042 @retval EFI_NOT_STARTED This instance has not been started.
1043 @retval EFI_UNSUPPORTED This function is not supported.
1049 IN EFI_DNS6_PROTOCOL
*This
,
1050 IN EFI_IPv6_ADDRESS IpAddress
,
1051 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1055 This function retrieves arbitrary information from the DNS.
1056 The caller supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned.
1057 All RR content (e.g., Ttl) was returned.
1058 The caller need parse the returned RR to get required information. This function is optional.
1060 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1061 @param[in] QName Pointer to Query Name.
1062 @param[in] QType Query Type.
1063 @param[in] QClass Query Name.
1064 @param[in] Token Point to the caller-allocated completion token to retrieve arbitrary information.
1066 @retval EFI_SUCCESS The operation completed successfully.
1067 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
1068 @retval EFI_INVALID_PARAMETER This is NULL.
1070 Token.Event is NULL.
1072 @retval EFI_NO_MAPPING There's no source address is available for use.
1073 @retval EFI_NOT_STARTED This instance has not been started.
1074 @retval EFI_UNSUPPORTED This function is not supported. Or the requested QType is not supported
1080 IN EFI_DNS6_PROTOCOL
*This
,
1084 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1088 This function is used to add/delete/modify DNS cache entry.
1089 DNS cache can be normally dynamically updated after the DNS resolve succeeds.
1090 This function provided capability to manually add/delete/modify the DNS cache.
1092 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1093 @param[in] DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
1094 If TRUE, this function will delete matching DNS Cache entry.
1095 @param[in] Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
1096 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
1097 @param[in] DnsCacheEntry Pointer to DNS Cache entry.
1099 @retval EFI_SUCCESS The operation completed successfully.
1100 @retval EFI_INVALID_PARAMETER This is NULL.
1101 DnsCacheEntry.HostName is NULL.
1102 DnsCacheEntry.IpAddress is NULL.
1103 DnsCacheEntry.Timeout is zero.
1104 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is not TRUE.
1109 Dns6UpdateDnsCache (
1110 IN EFI_DNS6_PROTOCOL
*This
,
1111 IN BOOLEAN DeleteFlag
,
1112 IN BOOLEAN Override
,
1113 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
1117 This function can be used by network drivers and applications to increase the rate that data packets are moved between
1118 the communications device and the transmit and receive queues. In some systems, the periodic timer event in the managed
1119 network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets
1120 without missing incoming packets or dropping outgoing packets.
1122 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1124 @retval EFI_SUCCESS Incoming or outgoing data was processed.
1125 @retval EFI_INVALID_PARAMETER This is NULL.
1126 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
1127 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
1128 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
1129 Consider increasing the polling rate.
1135 IN EFI_DNS6_PROTOCOL
*This
1139 This function is used to abort a pending resolution request.
1140 After calling this function, Token.Status will be set to EFI_ABORTED and then Token.
1142 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1143 @param[in] Token Pointer to a token that has been issued by EFI_DNS6_PROTOCOL.HostNameToIp(),
1144 EFI_DNS6_PROTOCOL.IpToHostName() or EFI_DNS6_PROTOCOL.GeneralLookup().
1145 If NULL, all pending tokens are aborted.
1147 @retval EFI_SUCCESS Incoming or outgoing data was processed.
1148 @retval EFI_INVALID_PARAMETER This is NULL.
1149 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
1150 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS operation was not found in the transmit queue.
1151 It was either completed or was not issued by HostNameToIp(), IpToHostName() or GeneralLookup().
1157 IN EFI_DNS6_PROTOCOL
*This
,
1158 IN EFI_DNS6_COMPLETION_TOKEN
*Token