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 EFI_DNS4_COMPLETION_TOKEN
*Token
;
127 CHAR16
*QueryHostName
;
128 EFI_IPv6_ADDRESS QueryIpAddress
;
129 EFI_DNS6_COMPLETION_TOKEN
*Token
;
146 #define DNS_FLAGS_QR_QUERY 0
147 #define DNS_FLAGS_QR_RESPONSE 1
149 #define DNS_FLAGS_OPCODE_STANDARD 0
150 #define DNS_FLAGS_OPCODE_INVERSE 1
151 #define DNS_FLAGS_OPCODE_SERVER_STATE 2
153 #define DNS_FLAGS_RCODE_NO_ERROR 0
154 #define DNS_FLAGS_RCODE_NAME_ERROR 3
157 UINT16 Identification
;
175 } DNS_ANSWER_SECTION
;
178 #define DNS_TYPE_NS 2
179 #define DNS_TYPE_CNAME 5
180 #define DNS_TYPE_PTR 12
181 #define DNS_TYPE_HINFO 13
182 #define DNS_TYPE_MX 15
183 #define DNS_TYPE_AAAA 28
184 #define DNS_TYPE_SRV_RR 33
185 #define DNS_TYPE_AXFR 252
186 #define DNS_TYPE_ANY 255
188 #define DNS_CLASS_INET 1
190 #define DNS4_DOMAIN L"in-addr.arpa"
191 #define DNS6_DOMAIN L"IP6.ARPA"
197 Remove TokenEntry from TokenMap.
199 @param[in] TokenMap All DNSv4 Token entrys.
200 @param[in] TokenEntry TokenEntry need to be removed.
202 @retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.
203 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
207 Dns4RemoveTokenEntry (
208 IN NET_MAP
*TokenMap
,
209 IN DNS4_TOKEN_ENTRY
*TokenEntry
213 Remove TokenEntry from TokenMap.
215 @param[in] TokenMap All DNSv6 Token entrys.
216 @param[in] TokenEntry TokenEntry need to be removed.
218 @retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.
219 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
223 Dns6RemoveTokenEntry (
224 IN NET_MAP
*TokenMap
,
225 IN DNS6_TOKEN_ENTRY
*TokenEntry
229 This function cancle the token specified by Arg in the Map.
231 @param[in] Map Pointer to the NET_MAP.
232 @param[in] Item Pointer to the NET_MAP_ITEM.
233 @param[in] Arg Pointer to the token to be cancelled. If NULL, all
234 the tokens in this Map will be cancelled.
235 This parameter is optional and may be NULL.
237 @retval EFI_SUCCESS The token is cancelled if Arg is NULL, or the token
238 is not the same as that in the Item, if Arg is not
240 @retval EFI_ABORTED Arg is not NULL, and the token specified by Arg is
248 IN NET_MAP_ITEM
*Item
,
249 IN VOID
*Arg OPTIONAL
253 This function cancle the token specified by Arg in the Map.
255 @param[in] Map Pointer to the NET_MAP.
256 @param[in] Item Pointer to the NET_MAP_ITEM.
257 @param[in] Arg Pointer to the token to be cancelled. If NULL, all
258 the tokens in this Map will be cancelled.
259 This parameter is optional and may be NULL.
261 @retval EFI_SUCCESS The token is cancelled if Arg is NULL, or the token
262 is not the same as that in the Item, if Arg is not
264 @retval EFI_ABORTED Arg is not NULL, and the token specified by Arg is
272 IN NET_MAP_ITEM
*Item
,
273 IN VOID
*Arg OPTIONAL
277 Get the TokenEntry from the TokensMap.
279 @param[in] TokensMap All DNSv4 Token entrys
280 @param[in] Token Pointer to the token to be get.
281 @param[out] TokenEntry Pointer to TokenEntry corresponding Token.
283 @retval EFI_SUCCESS Get the TokenEntry from the TokensMap sucessfully.
284 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
290 IN NET_MAP
*TokensMap
,
291 IN EFI_DNS4_COMPLETION_TOKEN
*Token
,
292 OUT DNS4_TOKEN_ENTRY
**TokenEntry
296 Get the TokenEntry from the TokensMap.
298 @param[in] TokensMap All DNSv6 Token entrys
299 @param[in] Token Pointer to the token to be get.
300 @param[out] TokenEntry Pointer to TokenEntry corresponding Token.
302 @retval EFI_SUCCESS Get the TokenEntry from the TokensMap sucessfully.
303 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.
309 IN NET_MAP
*TokensMap
,
310 IN EFI_DNS6_COMPLETION_TOKEN
*Token
,
311 OUT DNS6_TOKEN_ENTRY
**TokenEntry
315 Cancel DNS4 tokens from the DNS4 instance.
317 @param[in] Instance Pointer to the DNS instance context data.
318 @param[in] Token Pointer to the token to be canceled. If NULL, all
319 tokens in this instance will be cancelled.
320 This parameter is optional and may be NULL.
322 @retval EFI_SUCCESS The Token is cancelled.
323 @retval EFI_NOT_FOUND The Token is not found.
327 Dns4InstanceCancelToken (
328 IN DNS_INSTANCE
*Instance
,
329 IN EFI_DNS4_COMPLETION_TOKEN
*Token
333 Cancel DNS6 tokens from the DNS6 instance.
335 @param[in] Instance Pointer to the DNS instance context data.
336 @param[in] Token Pointer to the token to be canceled. If NULL, all
337 tokens in this instance will be cancelled.
338 This parameter is optional and may be NULL.
340 @retval EFI_SUCCESS The Token is cancelled.
341 @retval EFI_NOT_FOUND The Token is not found.
345 Dns6InstanceCancelToken (
346 IN DNS_INSTANCE
*Instance
,
347 IN EFI_DNS6_COMPLETION_TOKEN
*Token
351 Free the resource related to the configure parameters.
353 @param Config The DNS configure data
358 IN OUT EFI_DNS4_CONFIG_DATA
*Config
362 Free the resource related to the configure parameters.
364 @param Config The DNS configure data
369 IN OUT EFI_DNS6_CONFIG_DATA
*Config
373 Allocate memory for configure parameter such as timeout value for Dst,
374 then copy the configure parameter from Src to Dst.
376 @param[out] Dst The destination DHCP configure data.
377 @param[in] Src The source DHCP configure data.
379 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
380 @retval EFI_SUCCESS The configure is copied.
385 OUT EFI_DNS4_CONFIG_DATA
*Dst
,
386 IN EFI_DNS4_CONFIG_DATA
*Src
390 Allocate memory for configure parameter such as timeout value for Dst,
391 then copy the configure parameter from Src to Dst.
393 @param[out] Dst The destination DHCP configure data.
394 @param[in] Src The source DHCP configure data.
396 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
397 @retval EFI_SUCCESS The configure is copied.
402 OUT EFI_DNS6_CONFIG_DATA
*Dst
,
403 IN EFI_DNS6_CONFIG_DATA
*Src
407 Callback of Dns packet. Does nothing.
409 @param Arg The context.
419 Poll the UDP to get the IP4 default address, which may be retrieved
422 The default time out value is 5 seconds. If IP has retrieved the default address,
423 the UDP is reconfigured.
425 @param Instance The DNS instance
426 @param UdpIo The UDP_IO to poll
427 @param UdpCfgData The UDP configure data to reconfigure the UDP_IO
429 @retval TRUE The default address is retrieved and UDP is reconfigured.
430 @retval FALSE Some error occured.
435 IN DNS_INSTANCE
*Instance
,
437 IN EFI_UDP4_CONFIG_DATA
*UdpCfgData
441 Configure the opened Udp6 instance until the corresponding Ip6 instance
444 @param Instance The DNS instance
445 @param UdpIo The UDP_IO to poll
446 @param UdpCfgData The UDP configure data to reconfigure the UDP_IO
448 @retval TRUE Configure the Udp6 instance successfully.
449 @retval FALSE Some error occured.
454 IN DNS_INSTANCE
*Instance
,
456 IN EFI_UDP6_CONFIG_DATA
*UdpCfgData
462 @param Instance The DNS session
463 @param UdpIo The UDP_IO instance
465 @retval EFI_SUCCESS The UDP is successfully configured for the
471 IN DNS_INSTANCE
*Instance
,
478 @param Instance The DNS session
479 @param UdpIo The UDP_IO instance
481 @retval EFI_SUCCESS The UDP is successfully configured for the
487 IN DNS_INSTANCE
*Instance
,
492 Update Dns4 cache to shared list of caches of all DNSv4 instances.
494 @param Dns4CacheList All Dns4 cache list.
495 @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
496 If TRUE, this function will delete matching DNS Cache entry.
497 @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
498 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
499 @param DnsCacheEntry Entry Pointer to DNS Cache entry.
501 @retval EFI_SUCCESS Update Dns4 cache successfully.
502 @retval Others Failed to update Dns4 cache.
508 IN LIST_ENTRY
*Dns4CacheList
,
509 IN BOOLEAN DeleteFlag
,
511 IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry
515 Update Dns6 cache to shared list of caches of all DNSv6 instances.
517 @param Dns6CacheList All Dns6 cache list.
518 @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
519 If TRUE, this function will delete matching DNS Cache entry.
520 @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
521 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
522 @param DnsCacheEntry Entry Pointer to DNS Cache entry.
524 @retval EFI_SUCCESS Update Dns6 cache successfully.
525 @retval Others Failed to update Dns6 cache.
530 IN LIST_ENTRY
*Dns6CacheList
,
531 IN BOOLEAN DeleteFlag
,
533 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
537 Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.
539 @param Dns4ServerList Common list of addresses of all configured DNSv4 server.
540 @param ServerIp DNS server Ip.
542 @retval EFI_SUCCESS Add Dns4 ServerIp to common list successfully.
543 @retval Others Failed to add Dns4 ServerIp to common list.
549 IN LIST_ENTRY
*Dns4ServerList
,
550 IN EFI_IPv4_ADDRESS ServerIp
554 Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.
556 @param Dns6ServerList Common list of addresses of all configured DNSv6 server.
557 @param ServerIp DNS server Ip.
559 @retval EFI_SUCCESS Add Dns6 ServerIp to common list successfully.
560 @retval Others Failed to add Dns6 ServerIp to common list.
566 IN LIST_ENTRY
*Dns6ServerList
,
567 IN EFI_IPv6_ADDRESS ServerIp
571 Find out whether the response is valid or invalid.
573 @param TokensMap All DNS transmittal Tokens entry.
574 @param Identification Identification for queried packet.
575 @param Type Type for queried packet.
576 @param Item Return corresponding Token entry.
578 @retval TRUE The response is valid.
579 @retval FALSE The response is invalid.
584 IN NET_MAP
*TokensMap
,
585 IN UINT16 Identification
,
587 OUT NET_MAP_ITEM
**Item
593 @param Instance The DNS instance
594 @param RxString Received buffer.
595 @param Completed Flag to indicate that Dns response is valid.
597 @retval EFI_SUCCESS Parse Dns Response successfully.
598 @retval Others Failed to parse Dns Response.
603 IN OUT DNS_INSTANCE
*Instance
,
605 OUT BOOLEAN
*Completed
609 Parse response packet.
611 @param Packet The packets received.
612 @param EndPoint The local/remote UDP access point
613 @param IoStatus The status of the UDP receive
614 @param Context The opaque parameter to the function.
619 DnsOnPacketReceived (
621 UDP_END_POINT
*EndPoint
,
627 Release the net buffer when packet is sent.
629 @param Packet The packets received.
630 @param EndPoint The local/remote UDP access point
631 @param IoStatus The status of the UDP receive
632 @param Context The opaque parameter to the function.
639 UDP_END_POINT
*EndPoint
,
645 Query request information.
647 @param Instance The DNS instance
648 @param Packet The packet for querying request information.
650 @retval EFI_SUCCESS Query request information successfully.
651 @retval Others Failed to query request information.
656 IN DNS_INSTANCE
*Instance
,
661 Construct the Packet to query Ip.
663 @param Instance The DNS instance
664 @param HostName Queried HostName
665 @param Type DNS query Type
666 @param Packet The packet for querying Ip
668 @retval EFI_SUCCESS The packet is constructed.
669 @retval Others Failed to construct the Packet.
673 ConstructDNSQueryIp (
674 IN DNS_INSTANCE
*Instance
,
681 Retransmit the packet.
683 @param Instance The DNS instance
684 @param Packet Retransmit the packet
686 @retval EFI_SUCCESS The packet is retransmitted.
687 @retval Others Failed to retransmit.
692 IN DNS_INSTANCE
*Instance
,
697 The timer ticking function for the DNS service.
699 @param Event The ticking event
700 @param Context The DNS service instance
705 DnsOnTimerRetransmit (
711 The timer ticking function for the DNS driver.
713 @param Event The ticking event
726 This function is used to retrieve DNS mode data for this DNS instance.
728 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
729 @param[out] DnsModeData Pointer to the caller-allocated storage for the EFI_DNS4_MODE_DATA structure.
731 @retval EFI_SUCCESS The operation completed successfully.
732 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data is
733 available because this instance has not been configured.
734 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
735 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
741 IN EFI_DNS4_PROTOCOL
*This
,
742 OUT EFI_DNS4_MODE_DATA
*DnsModeData
746 This function is used to configure DNS configuration data for this DNS instance.
748 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
749 @param[in] DnsConfigData Pointer to caller-allocated buffer containing EFI_DNS4_CONFIG_DATA structure.
750 If NULL, the driver will reinitialize the protocol instance to the unconfigured state.
752 @retval EFI_SUCCESS The operation completed successfully.
753 @retval EFI_UNSUPPORTED The designated protocol is not supported.
754 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
755 @retval EFI_INVALID_PARAMETER This is NULL.
756 The StationIp address provided in DnsConfigData is not a valid unicast.
757 DnsServerList is NULL while DnsServerListCount is not equal to Zero.
758 DnsServerListCount is Zero while DnsServerListCount is not equal to NULL.
759 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI DNSv4 Protocol instance is not configured.
765 IN EFI_DNS4_PROTOCOL
*This
,
766 IN EFI_DNS4_CONFIG_DATA
*DnsConfigData
770 The function is used to translate the host name to host IP address.
771 A type A query is used to get the one or more IP addresses for this host.
773 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
774 @param[in] HostName Pointer to caller-supplied buffer containing Host name to be translated.
775 This buffer contains 16 bit characters but these are translated to ASCII for use with
776 DNSv4 server and there is no requirement for driver to support non-ASCII Unicode characters.
777 @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.
779 @retval EFI_SUCCESS The operation completed successfully.
780 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
781 @retval EFI_INVALID_PARAMETER This is NULL.
785 @retval EFI_NO_MAPPING There's no source address is available for use.
786 @retval EFI_NOT_STARTED This instance has not been started.
792 IN EFI_DNS4_PROTOCOL
*This
,
794 IN EFI_DNS4_COMPLETION_TOKEN
*Token
798 The function is used to translate the host address to host name.
799 A type PTR query is used to get the primary name of the host.
801 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
802 @param[in] IpAddress IP address.
803 @param[in] Token Pointer to the caller-allocated completion used token to translate host address to host name.
805 @retval EFI_SUCCESS The operation completed successfully.
806 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
807 @retval EFI_INVALID_PARAMETER This is NULL.
810 IpAddress is not valid IP address.
811 @retval EFI_NO_MAPPING There's no source address is available for use.
812 @retval EFI_NOT_STARTED This instance has not been started.
813 @retval EFI_UNSUPPORTED This function is not supported.
819 IN EFI_DNS4_PROTOCOL
*This
,
820 IN EFI_IPv4_ADDRESS IpAddress
,
821 IN EFI_DNS4_COMPLETION_TOKEN
*Token
825 This function retrieves arbitrary information from the DNS.
826 The caller supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned.
827 All RR content (e.g., Ttl) was returned.
828 The caller need parse the returned RR to get required information. This function is optional.
830 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
831 @param[in] QName Pointer to Query Name.
832 @param[in] QType Query Type.
833 @param[in] QClass Query Name.
834 @param[in] Token Point to the caller-allocated completion token to retrieve arbitrary information.
836 @retval EFI_SUCCESS The operation completed successfully.
837 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
838 @retval EFI_INVALID_PARAMETER This is NULL.
842 @retval EFI_NO_MAPPING There's no source address is available for use.
843 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.
844 @retval EFI_UNSUPPORTED This function is not supported. Or the requested QType is not supported
850 IN EFI_DNS4_PROTOCOL
*This
,
854 IN EFI_DNS4_COMPLETION_TOKEN
*Token
858 This function is used to add/delete/modify DNS cache entry.
859 DNS cache can be normally dynamically updated after the DNS resolve succeeds.
860 This function provided capability to manually add/delete/modify the DNS cache.
862 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
863 @param[in] DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
864 If TRUE, this function will delete matching DNS Cache entry.
865 @param[in] Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
866 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
867 @param[in] DnsCacheEntry Pointer to DNS Cache entry.
869 @retval EFI_SUCCESS The operation completed successfully.
870 @retval EFI_INVALID_PARAMETER This is NULL.
871 DnsCacheEntry.HostName is NULL.
872 DnsCacheEntry.IpAddress is NULL.
873 DnsCacheEntry.Timeout is zero.
874 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is not TRUE.
880 IN EFI_DNS4_PROTOCOL
*This
,
881 IN BOOLEAN DeleteFlag
,
883 IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry
887 This function can be used by network drivers and applications to increase the rate that data packets are moved between
888 the communications device and the transmit and receive queues. In some systems, the periodic timer event in the managed
889 network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets
890 without missing incoming packets or dropping outgoing packets.
892 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
894 @retval EFI_SUCCESS Incoming or outgoing data was processed.
895 @retval EFI_INVALID_PARAMETER This is NULL.
896 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
897 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
898 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
899 Consider increasing the polling rate.
905 IN EFI_DNS4_PROTOCOL
*This
909 This function is used to abort a pending resolution request.
910 After calling this function, Token.Status will be set to EFI_ABORTED and then Token.
912 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.
913 @param[in] Token Pointer to a token that has been issued by EFI_DNS4_PROTOCOL.HostNameToIp(),
914 EFI_DNS4_PROTOCOL.IpToHostName() or EFI_DNS4_PROTOCOL.GeneralLookup().
915 If NULL, all pending tokens are aborted.
917 @retval EFI_SUCCESS Incoming or outgoing data was processed.
918 @retval EFI_INVALID_PARAMETER This is NULL.
919 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
920 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS operation was not found in the transmit queue.
921 It was either completed or was not issued by HostNameToIp(), IpToHostName() or GeneralLookup().
927 IN EFI_DNS4_PROTOCOL
*This
,
928 IN EFI_DNS4_COMPLETION_TOKEN
*Token
933 This function is used to retrieve DNS mode data for this DNS instance.
935 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
936 @param[out] DnsModeData Pointer to the caller-allocated storage for the EFI_DNS6_MODE_DATA structure.
938 @retval EFI_SUCCESS The operation completed successfully.
939 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data is
940 available because this instance has not been configured.
941 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
942 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
948 IN EFI_DNS6_PROTOCOL
*This
,
949 OUT EFI_DNS6_MODE_DATA
*DnsModeData
953 The function is used to set and change the configuration data for this EFI DNSv6 Protocol driver instance.
954 Reset the DNS instance if DnsConfigData is NULL.
956 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
957 @param[in] DnsConfigData Pointer to the configuration data structure.
958 All associated storage to be allocated and released by caller.
960 @retval EFI_SUCCESS The operation completed successfully.
961 @retval EFI_UNSUPPORTED The designated protocol is not supported.
962 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
963 @retval EFI_INVALID_PARAMETER This is NULL.
964 The StationIp address provided in DnsConfigData is not a valid unicast.
965 DnsServerList is NULL while DnsServerListCount is not equal to Zero.
966 DnsServerListCount is Zero while DnsServerList is not equal to NULL.
967 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI DNSv6 Protocol instance is not configured.
973 IN EFI_DNS6_PROTOCOL
*This
,
974 IN EFI_DNS6_CONFIG_DATA
*DnsConfigData
978 The function is used to translate the host name to host IP address.
979 A type AAAA query is used to get the one or more IPv6 addresses for this host.
981 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
982 @param[in] HostName Pointer to caller-supplied buffer containing Host name to be translated.
983 This buffer contains 16 bit characters but these are translated to ASCII for use with
984 DNSv4 server and there is no requirement for driver to support non-ASCII Unicode characters.
985 @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.
987 @retval EFI_SUCCESS The operation completed successfully.
988 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
989 @retval EFI_INVALID_PARAMETER This is NULL.
993 @retval EFI_NO_MAPPING There's no source address is available for use.
994 @retval EFI_NOT_STARTED This instance has not been started.
1000 IN EFI_DNS6_PROTOCOL
*This
,
1001 IN CHAR16
*HostName
,
1002 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1006 The function is used to translate the host address to host name.
1007 A type PTR query is used to get the primary name of the host.
1009 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1010 @param[in] IpAddress IP address.
1011 @param[in] Token Pointer to the caller-allocated completion used token to translate host address to host name.
1013 @retval EFI_SUCCESS The operation completed successfully.
1014 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
1015 @retval EFI_INVALID_PARAMETER This is NULL.
1017 Token.Event is NULL.
1018 IpAddress is not valid IP address.
1019 @retval EFI_NO_MAPPING There's no source address is available for use.
1020 @retval EFI_NOT_STARTED This instance has not been started.
1021 @retval EFI_UNSUPPORTED This function is not supported.
1027 IN EFI_DNS6_PROTOCOL
*This
,
1028 IN EFI_IPv6_ADDRESS IpAddress
,
1029 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1033 This function retrieves arbitrary information from the DNS.
1034 The caller supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned.
1035 All RR content (e.g., Ttl) was returned.
1036 The caller need parse the returned RR to get required information. This function is optional.
1038 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1039 @param[in] QName Pointer to Query Name.
1040 @param[in] QType Query Type.
1041 @param[in] QClass Query Name.
1042 @param[in] Token Point to the caller-allocated completion token to retrieve arbitrary information.
1044 @retval EFI_SUCCESS The operation completed successfully.
1045 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
1046 @retval EFI_INVALID_PARAMETER This is NULL.
1048 Token.Event is NULL.
1050 @retval EFI_NO_MAPPING There's no source address is available for use.
1051 @retval EFI_NOT_STARTED This instance has not been started.
1052 @retval EFI_UNSUPPORTED This function is not supported. Or the requested QType is not supported
1058 IN EFI_DNS6_PROTOCOL
*This
,
1062 IN EFI_DNS6_COMPLETION_TOKEN
*Token
1066 This function is used to add/delete/modify DNS cache entry.
1067 DNS cache can be normally dynamically updated after the DNS resolve succeeds.
1068 This function provided capability to manually add/delete/modify the DNS cache.
1070 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1071 @param[in] DeleteFlag If FALSE, this function is to add one entry to the DNS Cache.
1072 If TRUE, this function will delete matching DNS Cache entry.
1073 @param[in] Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter.
1074 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.
1075 @param[in] DnsCacheEntry Pointer to DNS Cache entry.
1077 @retval EFI_SUCCESS The operation completed successfully.
1078 @retval EFI_INVALID_PARAMETER This is NULL.
1079 DnsCacheEntry.HostName is NULL.
1080 DnsCacheEntry.IpAddress is NULL.
1081 DnsCacheEntry.Timeout is zero.
1082 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is not TRUE.
1087 Dns6UpdateDnsCache (
1088 IN EFI_DNS6_PROTOCOL
*This
,
1089 IN BOOLEAN DeleteFlag
,
1090 IN BOOLEAN Override
,
1091 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
1095 This function can be used by network drivers and applications to increase the rate that data packets are moved between
1096 the communications device and the transmit and receive queues. In some systems, the periodic timer event in the managed
1097 network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets
1098 without missing incoming packets or dropping outgoing packets.
1100 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1102 @retval EFI_SUCCESS Incoming or outgoing data was processed.
1103 @retval EFI_INVALID_PARAMETER This is NULL.
1104 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
1105 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
1106 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
1107 Consider increasing the polling rate.
1113 IN EFI_DNS6_PROTOCOL
*This
1117 This function is used to abort a pending resolution request.
1118 After calling this function, Token.Status will be set to EFI_ABORTED and then Token.
1120 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
1121 @param[in] Token Pointer to a token that has been issued by EFI_DNS6_PROTOCOL.HostNameToIp(),
1122 EFI_DNS6_PROTOCOL.IpToHostName() or EFI_DNS6_PROTOCOL.GeneralLookup().
1123 If NULL, all pending tokens are aborted.
1125 @retval EFI_SUCCESS Incoming or outgoing data was processed.
1126 @retval EFI_INVALID_PARAMETER This is NULL.
1127 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
1128 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS operation was not found in the transmit queue.
1129 It was either completed or was not issued by HostNameToIp(), IpToHostName() or GeneralLookup().
1135 IN EFI_DNS6_PROTOCOL
*This
,
1136 IN EFI_DNS6_COMPLETION_TOKEN
*Token