]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/DnsDxe/DnsImpl.h
NetworkPkg: Fix potential ASSERT if NetIp4IsUnicast is called
[mirror_edk2.git] / NetworkPkg / DnsDxe / DnsImpl.h
CommitLineData
99c048ef 1/** @file\r
2DnsDxe support functions implementation.\r
3 \r
a74f05d9 4Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
99c048ef 5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __EFI_DNS_IMPL_H_\r
16#define __EFI_DNS_IMPL_H_\r
17\r
18#include <Uefi.h>\r
19\r
20//\r
21// Libraries classes\r
22//\r
23#include <Library/BaseLib.h>\r
24#include <Library/UefiLib.h>\r
25#include <Library/UefiBootServicesTableLib.h>\r
26#include <Library/UefiDriverEntryPoint.h>\r
27#include <Library/UefiRuntimeServicesTableLib.h>\r
28#include <Library/BaseMemoryLib.h>\r
29#include <Library/MemoryAllocationLib.h>\r
30#include <Library/NetLib.h>\r
31#include <Library/DebugLib.h>\r
32#include <Library/DpcLib.h>\r
33#include <Library/PrintLib.h>\r
34#include <Library/UdpIoLib.h>\r
35\r
36//\r
37// UEFI Driver Model Protocols\r
38//\r
39#include <Protocol/DriverBinding.h>\r
40#include <Protocol/ComponentName2.h>\r
41#include <Protocol/ComponentName.h>\r
42\r
43#include <Protocol/Udp4.h>\r
44#include <Protocol/Dhcp4.h>\r
45#include <Protocol/Dns4.h>\r
46\r
47#include <Protocol/Udp6.h>\r
48#include <Protocol/Dhcp6.h>\r
49#include <Protocol/Dns6.h>\r
50\r
51#include <Protocol/Ip4Config2.h>\r
52\r
53#include "DnsDriver.h"\r
54#include "DnsDhcp.h"\r
55\r
56//\r
57// Driver Version\r
58//\r
59#define DNS_VERSION 0x00000000\r
60\r
61//\r
62// Protocol instances\r
63//\r
64extern EFI_COMPONENT_NAME_PROTOCOL gDnsComponentName;\r
65extern EFI_COMPONENT_NAME2_PROTOCOL gDnsComponentName2;\r
66extern EFI_UNICODE_STRING_TABLE *gDnsControllerNameTable;\r
67\r
68extern EFI_DRIVER_BINDING_PROTOCOL gDns4DriverBinding;\r
69extern EFI_SERVICE_BINDING_PROTOCOL mDns4ServiceBinding;\r
70extern EFI_DNS4_PROTOCOL mDns4Protocol;\r
71\r
72extern EFI_DRIVER_BINDING_PROTOCOL gDns6DriverBinding;\r
73extern EFI_SERVICE_BINDING_PROTOCOL mDns6ServiceBinding;\r
74extern EFI_DNS6_PROTOCOL mDns6Protocol;\r
75\r
76//\r
77// DNS related\r
78//\r
79#define DNS_SERVER_PORT 53\r
80\r
81#define DNS_PROTOCOL_UDP EFI_IP_PROTO_UDP\r
82#define DNS_PROTOCOL_TCP EFI_IP_PROTO_TCP\r
83\r
84#define DNS_STATE_UNCONFIGED 0\r
85#define DNS_STATE_CONFIGED 1\r
86#define DNS_STATE_DESTROY 2\r
87\r
88#define DNS_DEFAULT_TIMEOUT 2\r
89#define DNS_DEFAULT_RETRY 3\r
99c048ef 90\r
91#define DNS_TIME_TO_GETMAP 5\r
92\r
93#pragma pack(1)\r
94\r
95typedef union _DNS_FLAGS DNS_FLAGS;\r
96\r
97typedef struct {\r
98 LIST_ENTRY AllCacheLink;\r
99 EFI_DNS4_CACHE_ENTRY DnsCache; \r
100} DNS4_CACHE;\r
101\r
102typedef struct {\r
103 LIST_ENTRY AllCacheLink;\r
104 EFI_DNS6_CACHE_ENTRY DnsCache; \r
105} DNS6_CACHE;\r
106\r
107typedef struct {\r
108 LIST_ENTRY AllServerLink;\r
109 EFI_IPv4_ADDRESS Dns4ServerIp; \r
110} DNS4_SERVER_IP;\r
111\r
112typedef struct {\r
113 LIST_ENTRY AllServerLink;\r
114 EFI_IPv6_ADDRESS Dns6ServerIp; \r
115} DNS6_SERVER_IP;\r
116\r
117typedef struct {\r
118 UINT32 PacketToLive;\r
119 CHAR16 *QueryHostName;\r
120 EFI_IPv4_ADDRESS QueryIpAddress;\r
fcae1a99 121 BOOLEAN GeneralLookUp;\r
99c048ef 122 EFI_DNS4_COMPLETION_TOKEN *Token;\r
123} DNS4_TOKEN_ENTRY;\r
124\r
125typedef struct {\r
126 UINT32 PacketToLive;\r
127 CHAR16 *QueryHostName;\r
128 EFI_IPv6_ADDRESS QueryIpAddress;\r
fcae1a99 129 BOOLEAN GeneralLookUp;\r
99c048ef 130 EFI_DNS6_COMPLETION_TOKEN *Token;\r
131} DNS6_TOKEN_ENTRY;\r
132\r
133union _DNS_FLAGS{\r
134 struct {\r
135 UINT16 RCode:4;\r
136 UINT16 Zero:3;\r
137 UINT16 RA:1;\r
138 UINT16 RD:1;\r
139 UINT16 TC:1;\r
140 UINT16 AA:1;\r
141 UINT16 OpCode:4;\r
142 UINT16 QR:1;\r
143 } Bits;\r
144 UINT16 Uint16;\r
145};\r
146\r
147#define DNS_FLAGS_QR_QUERY 0\r
148#define DNS_FLAGS_QR_RESPONSE 1\r
149\r
150#define DNS_FLAGS_OPCODE_STANDARD 0\r
151#define DNS_FLAGS_OPCODE_INVERSE 1\r
152#define DNS_FLAGS_OPCODE_SERVER_STATE 2\r
153\r
154#define DNS_FLAGS_RCODE_NO_ERROR 0\r
155#define DNS_FLAGS_RCODE_NAME_ERROR 3\r
156\r
157typedef struct {\r
158 UINT16 Identification;\r
159 DNS_FLAGS Flags;\r
160 UINT16 QuestionsNum;\r
161 UINT16 AnswersNum;\r
162 UINT16 AuthorityNum;\r
163 UINT16 AditionalNum;\r
164} DNS_HEADER;\r
165\r
166typedef struct {\r
167 UINT16 Type;\r
168 UINT16 Class;\r
169} DNS_QUERY_SECTION;\r
170\r
171typedef struct {\r
172 UINT16 Type;\r
173 UINT16 Class;\r
174 UINT32 Ttl;\r
175 UINT16 DataLength;\r
176} DNS_ANSWER_SECTION;\r
177\r
99c048ef 178#define DNS4_DOMAIN L"in-addr.arpa"\r
179#define DNS6_DOMAIN L"IP6.ARPA"\r
180\r
181\r
182#pragma pack()\r
183\r
184/**\r
185 Remove TokenEntry from TokenMap.\r
186\r
187 @param[in] TokenMap All DNSv4 Token entrys.\r
188 @param[in] TokenEntry TokenEntry need to be removed.\r
189\r
190 @retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.\r
191 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.\r
192\r
193**/\r
194EFI_STATUS\r
195Dns4RemoveTokenEntry (\r
196 IN NET_MAP *TokenMap,\r
197 IN DNS4_TOKEN_ENTRY *TokenEntry\r
198 );\r
199\r
200/**\r
201 Remove TokenEntry from TokenMap.\r
202\r
203 @param[in] TokenMap All DNSv6 Token entrys.\r
204 @param[in] TokenEntry TokenEntry need to be removed.\r
205\r
206 @retval EFI_SUCCESS Remove TokenEntry from TokenMap sucessfully.\r
207 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.\r
208 \r
209**/\r
210EFI_STATUS\r
211Dns6RemoveTokenEntry (\r
212 IN NET_MAP *TokenMap,\r
213 IN DNS6_TOKEN_ENTRY *TokenEntry\r
214 );\r
215\r
216/**\r
217 This function cancle the token specified by Arg in the Map.\r
218\r
219 @param[in] Map Pointer to the NET_MAP.\r
220 @param[in] Item Pointer to the NET_MAP_ITEM.\r
221 @param[in] Arg Pointer to the token to be cancelled. If NULL, all\r
222 the tokens in this Map will be cancelled.\r
223 This parameter is optional and may be NULL.\r
224\r
225 @retval EFI_SUCCESS The token is cancelled if Arg is NULL, or the token\r
226 is not the same as that in the Item, if Arg is not\r
227 NULL.\r
228 @retval EFI_ABORTED Arg is not NULL, and the token specified by Arg is\r
229 cancelled.\r
230\r
231**/\r
232EFI_STATUS\r
233EFIAPI\r
234Dns4CancelTokens (\r
235 IN NET_MAP *Map,\r
236 IN NET_MAP_ITEM *Item,\r
237 IN VOID *Arg OPTIONAL\r
238 );\r
239\r
240/**\r
241 This function cancle the token specified by Arg in the Map.\r
242\r
243 @param[in] Map Pointer to the NET_MAP.\r
244 @param[in] Item Pointer to the NET_MAP_ITEM.\r
245 @param[in] Arg Pointer to the token to be cancelled. If NULL, all\r
246 the tokens in this Map will be cancelled.\r
247 This parameter is optional and may be NULL.\r
248\r
249 @retval EFI_SUCCESS The token is cancelled if Arg is NULL, or the token\r
250 is not the same as that in the Item, if Arg is not\r
251 NULL.\r
252 @retval EFI_ABORTED Arg is not NULL, and the token specified by Arg is\r
253 cancelled.\r
254\r
255**/\r
256EFI_STATUS\r
257EFIAPI\r
258Dns6CancelTokens (\r
259 IN NET_MAP *Map,\r
260 IN NET_MAP_ITEM *Item,\r
261 IN VOID *Arg OPTIONAL\r
262 );\r
263\r
264/**\r
265 Get the TokenEntry from the TokensMap.\r
266\r
267 @param[in] TokensMap All DNSv4 Token entrys\r
268 @param[in] Token Pointer to the token to be get.\r
269 @param[out] TokenEntry Pointer to TokenEntry corresponding Token.\r
270\r
271 @retval EFI_SUCCESS Get the TokenEntry from the TokensMap sucessfully.\r
272 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.\r
273\r
274**/\r
275EFI_STATUS\r
276EFIAPI\r
277GetDns4TokenEntry (\r
278 IN NET_MAP *TokensMap,\r
279 IN EFI_DNS4_COMPLETION_TOKEN *Token, \r
280 OUT DNS4_TOKEN_ENTRY **TokenEntry\r
281 );\r
282\r
283/**\r
284 Get the TokenEntry from the TokensMap.\r
285\r
286 @param[in] TokensMap All DNSv6 Token entrys\r
287 @param[in] Token Pointer to the token to be get.\r
288 @param[out] TokenEntry Pointer to TokenEntry corresponding Token.\r
289\r
290 @retval EFI_SUCCESS Get the TokenEntry from the TokensMap sucessfully.\r
291 @retval EFI_NOT_FOUND TokenEntry is not found in TokenMap.\r
292\r
293**/\r
294EFI_STATUS\r
295EFIAPI\r
296GetDns6TokenEntry (\r
297 IN NET_MAP *TokensMap,\r
298 IN EFI_DNS6_COMPLETION_TOKEN *Token, \r
299 OUT DNS6_TOKEN_ENTRY **TokenEntry\r
300 );\r
301\r
302/**\r
303 Cancel DNS4 tokens from the DNS4 instance.\r
304\r
305 @param[in] Instance Pointer to the DNS instance context data.\r
306 @param[in] Token Pointer to the token to be canceled. If NULL, all\r
307 tokens in this instance will be cancelled.\r
308 This parameter is optional and may be NULL.\r
309\r
310 @retval EFI_SUCCESS The Token is cancelled.\r
311 @retval EFI_NOT_FOUND The Token is not found.\r
312\r
313**/\r
314EFI_STATUS\r
315Dns4InstanceCancelToken (\r
316 IN DNS_INSTANCE *Instance,\r
317 IN EFI_DNS4_COMPLETION_TOKEN *Token\r
318 );\r
319\r
320/**\r
321 Cancel DNS6 tokens from the DNS6 instance.\r
322\r
323 @param[in] Instance Pointer to the DNS instance context data.\r
324 @param[in] Token Pointer to the token to be canceled. If NULL, all\r
325 tokens in this instance will be cancelled.\r
326 This parameter is optional and may be NULL.\r
327\r
328 @retval EFI_SUCCESS The Token is cancelled.\r
329 @retval EFI_NOT_FOUND The Token is not found.\r
330\r
331**/\r
332EFI_STATUS\r
333Dns6InstanceCancelToken (\r
334 IN DNS_INSTANCE *Instance,\r
335 IN EFI_DNS6_COMPLETION_TOKEN *Token\r
336 );\r
337\r
338/**\r
339 Free the resource related to the configure parameters.\r
340\r
341 @param Config The DNS configure data\r
342\r
343**/\r
344VOID\r
345Dns4CleanConfigure (\r
346 IN OUT EFI_DNS4_CONFIG_DATA *Config\r
347 );\r
348\r
349/**\r
350 Free the resource related to the configure parameters.\r
351\r
352 @param Config The DNS configure data\r
353\r
354**/\r
355VOID\r
356Dns6CleanConfigure (\r
357 IN OUT EFI_DNS6_CONFIG_DATA *Config\r
358 );\r
359\r
360/**\r
361 Allocate memory for configure parameter such as timeout value for Dst,\r
362 then copy the configure parameter from Src to Dst.\r
363\r
364 @param[out] Dst The destination DHCP configure data.\r
365 @param[in] Src The source DHCP configure data.\r
366\r
367 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
368 @retval EFI_SUCCESS The configure is copied.\r
369\r
370**/\r
371EFI_STATUS\r
372Dns4CopyConfigure (\r
373 OUT EFI_DNS4_CONFIG_DATA *Dst,\r
374 IN EFI_DNS4_CONFIG_DATA *Src\r
375 );\r
376\r
377/**\r
378 Allocate memory for configure parameter such as timeout value for Dst,\r
379 then copy the configure parameter from Src to Dst.\r
380\r
381 @param[out] Dst The destination DHCP configure data.\r
382 @param[in] Src The source DHCP configure data.\r
383\r
384 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
385 @retval EFI_SUCCESS The configure is copied.\r
386\r
387**/\r
388EFI_STATUS\r
389Dns6CopyConfigure (\r
390 OUT EFI_DNS6_CONFIG_DATA *Dst,\r
391 IN EFI_DNS6_CONFIG_DATA *Src\r
392 );\r
393\r
394/**\r
395 Callback of Dns packet. Does nothing.\r
396\r
397 @param Arg The context.\r
398\r
399**/\r
400VOID\r
401EFIAPI\r
402DnsDummyExtFree (\r
403 IN VOID *Arg\r
404 );\r
405\r
406/**\r
407 Poll the UDP to get the IP4 default address, which may be retrieved\r
408 by DHCP. \r
409 \r
410 The default time out value is 5 seconds. If IP has retrieved the default address, \r
411 the UDP is reconfigured.\r
412\r
413 @param Instance The DNS instance\r
414 @param UdpIo The UDP_IO to poll\r
415 @param UdpCfgData The UDP configure data to reconfigure the UDP_IO\r
416\r
417 @retval TRUE The default address is retrieved and UDP is reconfigured.\r
418 @retval FALSE Some error occured.\r
419\r
420**/\r
421BOOLEAN\r
422Dns4GetMapping (\r
423 IN DNS_INSTANCE *Instance,\r
424 IN UDP_IO *UdpIo,\r
425 IN EFI_UDP4_CONFIG_DATA *UdpCfgData\r
426 );\r
427\r
428/**\r
429 Configure the opened Udp6 instance until the corresponding Ip6 instance\r
430 has been configured.\r
431\r
432 @param Instance The DNS instance\r
433 @param UdpIo The UDP_IO to poll\r
434 @param UdpCfgData The UDP configure data to reconfigure the UDP_IO\r
435\r
436 @retval TRUE Configure the Udp6 instance successfully.\r
437 @retval FALSE Some error occured.\r
438\r
439**/\r
440BOOLEAN\r
441Dns6GetMapping (\r
442 IN DNS_INSTANCE *Instance,\r
443 IN UDP_IO *UdpIo,\r
444 IN EFI_UDP6_CONFIG_DATA *UdpCfgData\r
445 );\r
446\r
447/**\r
448 Configure the UDP.\r
449 \r
450 @param Instance The DNS session\r
451 @param UdpIo The UDP_IO instance\r
452 \r
453 @retval EFI_SUCCESS The UDP is successfully configured for the\r
454 session.\r
455\r
456**/\r
457EFI_STATUS\r
458Dns4ConfigUdp (\r
459 IN DNS_INSTANCE *Instance,\r
460 IN UDP_IO *UdpIo\r
461 );\r
462\r
463/**\r
464 Configure the UDP.\r
465 \r
466 @param Instance The DNS session\r
467 @param UdpIo The UDP_IO instance\r
468\r
469 @retval EFI_SUCCESS The UDP is successfully configured for the\r
470 session.\r
471\r
472**/\r
473EFI_STATUS\r
474Dns6ConfigUdp (\r
475 IN DNS_INSTANCE *Instance,\r
476 IN UDP_IO *UdpIo\r
477 );\r
478\r
479/**\r
480 Update Dns4 cache to shared list of caches of all DNSv4 instances.\r
481 \r
482 @param Dns4CacheList All Dns4 cache list.\r
483 @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache. \r
484 If TRUE, this function will delete matching DNS Cache entry. \r
485 @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter. \r
486 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.\r
487 @param DnsCacheEntry Entry Pointer to DNS Cache entry.\r
488\r
489 @retval EFI_SUCCESS Update Dns4 cache successfully.\r
490 @retval Others Failed to update Dns4 cache. \r
491 \r
492**/\r
493EFI_STATUS\r
494EFIAPI\r
495UpdateDns4Cache (\r
496 IN LIST_ENTRY *Dns4CacheList,\r
497 IN BOOLEAN DeleteFlag,\r
498 IN BOOLEAN Override,\r
499 IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry\r
500 );\r
501\r
502/**\r
503 Update Dns6 cache to shared list of caches of all DNSv6 instances. \r
504\r
505 @param Dns6CacheList All Dns6 cache list.\r
506 @param DeleteFlag If FALSE, this function is to add one entry to the DNS Cache. \r
507 If TRUE, this function will delete matching DNS Cache entry. \r
508 @param Override If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter. \r
509 If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists.\r
510 @param DnsCacheEntry Entry Pointer to DNS Cache entry.\r
511 \r
512 @retval EFI_SUCCESS Update Dns6 cache successfully.\r
513 @retval Others Failed to update Dns6 cache.\r
514**/ \r
515EFI_STATUS\r
516EFIAPI\r
517UpdateDns6Cache (\r
518 IN LIST_ENTRY *Dns6CacheList,\r
519 IN BOOLEAN DeleteFlag,\r
520 IN BOOLEAN Override,\r
521 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry\r
522 );\r
523\r
524/**\r
525 Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server. \r
526\r
527 @param Dns4ServerList Common list of addresses of all configured DNSv4 server. \r
528 @param ServerIp DNS server Ip. \r
529\r
530 @retval EFI_SUCCESS Add Dns4 ServerIp to common list successfully.\r
531 @retval Others Failed to add Dns4 ServerIp to common list.\r
532 \r
533**/\r
534EFI_STATUS\r
535EFIAPI\r
536AddDns4ServerIp (\r
537 IN LIST_ENTRY *Dns4ServerList,\r
538 IN EFI_IPv4_ADDRESS ServerIp\r
539 );\r
540\r
541/**\r
542 Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server. \r
543\r
544 @param Dns6ServerList Common list of addresses of all configured DNSv6 server. \r
545 @param ServerIp DNS server Ip. \r
546\r
547 @retval EFI_SUCCESS Add Dns6 ServerIp to common list successfully.\r
548 @retval Others Failed to add Dns6 ServerIp to common list.\r
549 \r
550**/ \r
551EFI_STATUS\r
552EFIAPI\r
553AddDns6ServerIp (\r
554 IN LIST_ENTRY *Dns6ServerList,\r
555 IN EFI_IPv6_ADDRESS ServerIp\r
556 );\r
557\r
558/**\r
559 Find out whether the response is valid or invalid.\r
560\r
561 @param TokensMap All DNS transmittal Tokens entry. \r
562 @param Identification Identification for queried packet. \r
563 @param Type Type for queried packet.\r
3900a743 564 @param Class Class for queried packet.\r
99c048ef 565 @param Item Return corresponding Token entry.\r
566\r
567 @retval TRUE The response is valid.\r
568 @retval FALSE The response is invalid.\r
569 \r
570**/ \r
571BOOLEAN\r
572IsValidDnsResponse (\r
573 IN NET_MAP *TokensMap,\r
574 IN UINT16 Identification,\r
575 IN UINT16 Type,\r
3900a743 576 IN UINT16 Class,\r
99c048ef 577 OUT NET_MAP_ITEM **Item\r
578 );\r
579\r
580/**\r
581 Parse Dns Response.\r
582\r
583 @param Instance The DNS instance\r
584 @param RxString Received buffer.\r
585 @param Completed Flag to indicate that Dns response is valid. \r
586 \r
587 @retval EFI_SUCCESS Parse Dns Response successfully.\r
588 @retval Others Failed to parse Dns Response.\r
589 \r
590**/ \r
591EFI_STATUS\r
592ParseDnsResponse (\r
593 IN OUT DNS_INSTANCE *Instance,\r
594 IN UINT8 *RxString,\r
595 OUT BOOLEAN *Completed\r
596 );\r
597\r
598/**\r
599 Parse response packet.\r
600\r
601 @param Packet The packets received.\r
602 @param EndPoint The local/remote UDP access point\r
603 @param IoStatus The status of the UDP receive\r
604 @param Context The opaque parameter to the function.\r
605\r
606**/ \r
607VOID\r
608EFIAPI\r
609DnsOnPacketReceived (\r
610 NET_BUF *Packet,\r
611 UDP_END_POINT *EndPoint,\r
612 EFI_STATUS IoStatus,\r
613 VOID *Context\r
614 );\r
615\r
616/**\r
617 Release the net buffer when packet is sent.\r
618\r
619 @param Packet The packets received.\r
620 @param EndPoint The local/remote UDP access point\r
621 @param IoStatus The status of the UDP receive\r
622 @param Context The opaque parameter to the function.\r
623\r
624**/\r
625VOID\r
626EFIAPI\r
627DnsOnPacketSent (\r
628 NET_BUF *Packet,\r
629 UDP_END_POINT *EndPoint,\r
630 EFI_STATUS IoStatus,\r
631 VOID *Context\r
632 );\r
633\r
634/**\r
635 Query request information.\r
636\r
637 @param Instance The DNS instance\r
638 @param Packet The packet for querying request information.\r
639\r
640 @retval EFI_SUCCESS Query request information successfully.\r
641 @retval Others Failed to query request information.\r
642\r
643**/\r
644EFI_STATUS\r
645DoDnsQuery (\r
646 IN DNS_INSTANCE *Instance,\r
647 IN NET_BUF *Packet\r
648 );\r
649\r
650/**\r
fcae1a99 651 Construct the Packet according query section.\r
99c048ef 652\r
653 @param Instance The DNS instance\r
fcae1a99
JW
654 @param QueryName Queried Name \r
655 @param Type Queried Type \r
656 @param Class Queried Class \r
657 @param Packet The packet for query\r
99c048ef 658\r
659 @retval EFI_SUCCESS The packet is constructed.\r
660 @retval Others Failed to construct the Packet.\r
661\r
662**/\r
663EFI_STATUS\r
fcae1a99 664ConstructDNSQuery (\r
99c048ef 665 IN DNS_INSTANCE *Instance,\r
fcae1a99 666 IN CHAR8 *QueryName,\r
99c048ef 667 IN UINT16 Type,\r
fcae1a99 668 IN UINT16 Class,\r
99c048ef 669 OUT NET_BUF **Packet\r
670 );\r
671\r
672/**\r
673 Retransmit the packet.\r
674\r
675 @param Instance The DNS instance\r
676 @param Packet Retransmit the packet \r
677\r
678 @retval EFI_SUCCESS The packet is retransmitted.\r
679 @retval Others Failed to retransmit.\r
680\r
681**/\r
682EFI_STATUS\r
683DnsRetransmit (\r
684 IN DNS_INSTANCE *Instance,\r
685 IN NET_BUF *Packet\r
686 );\r
687\r
688/**\r
689 The timer ticking function for the DNS service.\r
690\r
691 @param Event The ticking event\r
692 @param Context The DNS service instance\r
693\r
694**/\r
695VOID\r
696EFIAPI\r
697DnsOnTimerRetransmit (\r
698 IN EFI_EVENT Event,\r
699 IN VOID *Context\r
700 );\r
701\r
702/**\r
703 The timer ticking function for the DNS driver.\r
704\r
705 @param Event The ticking event\r
706 @param Context NULL\r
707\r
708**/\r
709VOID\r
710EFIAPI\r
711DnsOnTimerUpdate (\r
712 IN EFI_EVENT Event,\r
713 IN VOID *Context\r
714 );\r
715\r
716\r
717/**\r
0f4e123f 718 Retrieve mode data of this DNS instance.\r
99c048ef 719\r
0f4e123f 720 This function is used to retrieve DNS mode data for this DNS instance.\r
99c048ef 721\r
0f4e123f
JW
722 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
723 @param[out] DnsModeData Point to the mode data.\r
99c048ef 724\r
0f4e123f
JW
725 @retval EFI_SUCCESS The operation completed successfully.\r
726 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data\r
727 is available because this instance has not been\r
728 configured.\r
729 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.\r
730 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 731**/\r
732EFI_STATUS\r
733EFIAPI\r
734Dns4GetModeData (\r
735 IN EFI_DNS4_PROTOCOL *This,\r
736 OUT EFI_DNS4_MODE_DATA *DnsModeData\r
737 );\r
738\r
739/**\r
0f4e123f
JW
740 Configure this DNS instance.\r
741\r
742 This function is used to configure DNS mode data for this DNS instance.\r
743\r
744 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
745 @param[in] DnsConfigData Point to the Configuration data.\r
746\r
747 @retval EFI_SUCCESS The operation completed successfully.\r
748 @retval EFI_UNSUPPORTED The designated protocol is not supported.\r
749 @retval EFI_INVALID_PARAMTER Thisis NULL.\r
750 The StationIp address provided in DnsConfigData is not a \r
751 valid unicast.\r
752 DnsServerList is NULL while DnsServerListCount\r
753 is not ZERO.\r
754 DnsServerListCount is ZERO while DnsServerList\r
755 is not NULL\r
756 @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be\r
757 allocated.\r
758 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
759 EFI DNSv4 Protocol instance is not configured.\r
760 @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
761 reconfigure the instance the caller must call Configure() \r
762 with NULL first to return driver to unconfigured state.\r
99c048ef 763**/\r
764EFI_STATUS\r
765EFIAPI\r
766Dns4Configure (\r
767 IN EFI_DNS4_PROTOCOL *This,\r
768 IN EFI_DNS4_CONFIG_DATA *DnsConfigData\r
769 );\r
770\r
771/**\r
0f4e123f
JW
772 Host name to host address translation.\r
773\r
774 The HostNameToIp () function is used to translate the host name to host IP address. A\r
775 type A query is used to get the one or more IP addresses for this host.\r
776\r
777 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
778 @param[in] HostName Host name.\r
779 @param[in] Token Point to the completion token to translate host name\r
780 to host address.\r
781\r
782 @retval EFI_SUCCESS The operation completed successfully.\r
783 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
784 This is NULL.\r
785 Token is NULL.\r
786 Token.Event is NULL.\r
787 HostName is NULL. HostName string is unsupported format.\r
788 @retval EFI_NO_MAPPING There's no source address is available for use.\r
789 @retval EFI_NOT_STARTED This instance has not been started.\r
99c048ef 790**/\r
791EFI_STATUS\r
792EFIAPI\r
793Dns4HostNameToIp (\r
794 IN EFI_DNS4_PROTOCOL *This,\r
795 IN CHAR16 *HostName,\r
796 IN EFI_DNS4_COMPLETION_TOKEN *Token\r
797 );\r
798\r
799/**\r
0f4e123f
JW
800 IPv4 address to host name translation also known as Reverse DNS lookup.\r
801\r
802 The IpToHostName() function is used to translate the host address to host name. A type PTR \r
803 query is used to get the primary name of the host. Support of this function is optional.\r
804\r
805 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
806 @param[in] IpAddress Ip Address.\r
807 @param[in] Token Point to the completion token to translate host\r
808 address to host name.\r
809\r
810 @retval EFI_SUCCESS The operation completed successfully.\r
811 @retval EFI_UNSUPPORTED This function is not supported.\r
812 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
813 This is NULL.\r
814 Token is NULL.\r
815 Token.Event is NULL.\r
816 IpAddress is not valid IP address .\r
817 @retval EFI_NO_MAPPING There's no source address is available for use.\r
818 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r
819 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 820**/\r
821EFI_STATUS\r
822EFIAPI\r
823Dns4IpToHostName (\r
824 IN EFI_DNS4_PROTOCOL *This,\r
825 IN EFI_IPv4_ADDRESS IpAddress,\r
826 IN EFI_DNS4_COMPLETION_TOKEN *Token\r
827 );\r
828\r
829/**\r
0f4e123f
JW
830 Retrieve arbitrary information from the DNS server. \r
831\r
832 This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r
833 supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r
834 RR content (e.g., TTL) was returned. The caller need parse the returned RR to get\r
835 required information. The function is optional.\r
836\r
837 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
838 @param[in] QName Pointer to Query Name.\r
839 @param[in] QType Query Type.\r
840 @param[in] QClass Query Name.\r
841 @param[in] Token Point to the completion token to retrieve arbitrary\r
842 information.\r
843\r
844 @retval EFI_SUCCESS The operation completed successfully.\r
845 @retval EFI_UNSUPPORTED This function is not supported. Or the requested\r
846 QType is not supported\r
847 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
848 This is NULL.\r
849 Token is NULL.\r
850 Token.Event is NULL.\r
851 QName is NULL.\r
852 @retval EFI_NO_MAPPING There's no source address is available for use.\r
853 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r
854 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 855**/\r
856EFI_STATUS\r
857EFIAPI\r
858Dns4GeneralLookUp (\r
859 IN EFI_DNS4_PROTOCOL *This,\r
860 IN CHAR8 *QName,\r
861 IN UINT16 QType, \r
862 IN UINT16 QClass,\r
863 IN EFI_DNS4_COMPLETION_TOKEN *Token\r
864 );\r
865\r
866/**\r
0f4e123f
JW
867 This function is to update the DNS Cache.\r
868\r
869 The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache\r
870 can be normally dynamically updated after the DNS resolve succeeds. This function\r
871 provided capability to manually add/delete/modify the DNS cache.\r
872\r
873 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
874 @param[in] DeleteFlag If FALSE, this function is to add one entry to the\r
875 DNS Cahce. If TRUE, this function will delete\r
876 matching DNS Cache entry.\r
877 @param[in] Override If TRUE, the maching DNS cache entry will be\r
878 overwritten with the supplied parameter. If FALSE,\r
879 EFI_ACCESS_DENIED will be returned if the entry to\r
880 be added is already existed.\r
881 @param[in] DnsCacheEntry Pointer to DNS Cache entry.\r
882\r
883 @retval EFI_SUCCESS The operation completed successfully.\r
884 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
885 This is NULL.\r
886 DnsCacheEntry.HostName is NULL.\r
887 DnsCacheEntry.IpAddress is NULL.\r
888 DnsCacheEntry.Timeout is zero.\r
889 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is\r
890 not TRUE.\r
99c048ef 891**/\r
892EFI_STATUS\r
893EFIAPI\r
894Dns4UpdateDnsCache (\r
895 IN EFI_DNS4_PROTOCOL *This,\r
896 IN BOOLEAN DeleteFlag,\r
897 IN BOOLEAN Override,\r
898 IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry\r
899 );\r
900\r
901/**\r
0f4e123f
JW
902 Polls for incoming data packets and processes outgoing data packets.\r
903\r
904 The Poll() function can be used by network drivers and applications to increase the\r
905 rate that data packets are moved between the communications device and the transmit\r
906 and receive queues.\r
907 In some systems, the periodic timer event in the managed network driver may not poll\r
908 the underlying communications device fast enough to transmit and/or receive all data\r
909 packets without missing incoming packets or dropping outgoing packets. Drivers and\r
910 applications that are experiencing packet loss should try calling the Poll()\r
911 function more often.\r
912\r
913 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
914\r
915 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
916 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.\r
917 @retval EFI_INVALID_PARAMETER This is NULL.\r
918 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
919 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive\r
920 queue. Consider increasing the polling rate.\r
99c048ef 921**/\r
922EFI_STATUS\r
923EFIAPI\r
924Dns4Poll (\r
925 IN EFI_DNS4_PROTOCOL *This\r
926 );\r
927\r
928/**\r
0f4e123f
JW
929 Abort an asynchronous DNS operation, including translation between IP and Host, and\r
930 general look up behavior.\r
931\r
932 The Cancel() function is used to abort a pending resolution request. After calling\r
933 this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be\r
934 signaled. If the token is not in one of the queues, which usually means that the\r
935 asynchronous operation has completed, this function will not signal the token and\r
936 EFI_NOT_FOUND is returned.\r
937\r
938 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
939 @param[in] Token Pointer to a token that has been issued by\r
940 EFI_DNS4_PROTOCOL.HostNameToIp (),\r
941 EFI_DNS4_PROTOCOL.IpToHostName() or\r
942 EFI_DNS4_PROTOCOL.GeneralLookup().\r
943 If NULL, all pending tokens are aborted.\r
944\r
945 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
946 @retval EFI_NOT_STARTED This EFI DNS4 Protocol instance has not been started.\r
947 @retval EFI_INVALID_PARAMETER This is NULL.\r
948 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS\r
949 operation was not found in the transmit queue. It\r
950 was either completed or was not issued by\r
951 HostNameToIp(), IpToHostName() or GeneralLookup().\r
99c048ef 952**/\r
953EFI_STATUS\r
954EFIAPI\r
955Dns4Cancel (\r
956 IN EFI_DNS4_PROTOCOL *This,\r
957 IN EFI_DNS4_COMPLETION_TOKEN *Token\r
958 );\r
959\r
960\r
961/**\r
0f4e123f 962 Retrieve mode data of this DNS instance.\r
99c048ef 963\r
0f4e123f 964 This function is used to retrieve DNS mode data for this DNS instance.\r
99c048ef 965\r
0f4e123f
JW
966 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
967 @param[out] DnsModeData Pointer to the caller-allocated storage for the \r
968 EFI_DNS6_MODE_DATA data.\r
99c048ef 969\r
0f4e123f
JW
970 @retval EFI_SUCCESS The operation completed successfully.\r
971 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data\r
972 is available because this instance has not been\r
973 configured.\r
974 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.\r
975 @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.\r
99c048ef 976**/\r
977EFI_STATUS\r
978EFIAPI\r
979Dns6GetModeData (\r
980 IN EFI_DNS6_PROTOCOL *This,\r
981 OUT EFI_DNS6_MODE_DATA *DnsModeData\r
982 );\r
983\r
984/**\r
0f4e123f
JW
985 Configure this DNS instance.\r
986\r
987 The Configure() function is used to set and change the configuration data for this\r
988 EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.\r
989\r
990 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
991 @param[in] DnsConfigData Pointer to the configuration data structure. All associated \r
992 storage to be allocated and released by caller.\r
993\r
994 @retval EFI_SUCCESS The operation completed successfully.\r
995 @retval EFI_INVALID_PARAMTER This is NULL.\r
996 The StationIp address provided in DnsConfigData is not zero and not a valid unicast.\r
997 DnsServerList is NULL while DnsServerList Count is not ZERO.\r
998 DnsServerList Count is ZERO while DnsServerList is not NULL.\r
999 @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be allocated.\r
1000 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
1001 EFI DNSv6 Protocol instance is not configured.\r
1002 @retval EFI_UNSUPPORTED The designated protocol is not supported.\r
1003 @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
1004 reconfigure the instance the caller must call Configure() with \r
1005 NULL first to return driver to unconfigured state.\r
99c048ef 1006**/\r
1007EFI_STATUS\r
1008EFIAPI\r
1009Dns6Configure (\r
1010 IN EFI_DNS6_PROTOCOL *This,\r
1011 IN EFI_DNS6_CONFIG_DATA *DnsConfigData\r
1012 );\r
1013\r
1014/**\r
0f4e123f
JW
1015 Host name to host address translation.\r
1016\r
1017 The HostNameToIp () function is used to translate the host name to host IP address. A\r
1018 type AAAA query is used to get the one or more IPv6 addresses for this host.\r
1019\r
1020 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1021 @param[in] HostName Host name.\r
1022 @param[in] Token Point to the completion token to translate host name\r
1023 to host address.\r
1024\r
1025 @retval EFI_SUCCESS The operation completed successfully.\r
1026 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
1027 This is NULL.\r
1028 Token is NULL.\r
1029 Token.Event is NULL.\r
1030 HostName is NULL or buffer contained unsupported characters.\r
1031 @retval EFI_NO_MAPPING There's no source address is available for use.\r
1032 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r
1033 @retval EFI_NOT_STARTED This instance has not been started.\r
1034 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 1035**/\r
1036EFI_STATUS\r
1037EFIAPI\r
1038Dns6HostNameToIp (\r
1039 IN EFI_DNS6_PROTOCOL *This,\r
1040 IN CHAR16 *HostName,\r
1041 IN EFI_DNS6_COMPLETION_TOKEN *Token\r
1042 );\r
1043\r
1044/**\r
0f4e123f
JW
1045 Host address to host name translation.\r
1046\r
1047 The IpToHostName () function is used to translate the host address to host name. A\r
1048 type PTR query is used to get the primary name of the host. Implementation can choose\r
1049 to support this function or not.\r
1050\r
1051 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1052 @param[in] IpAddress Ip Address.\r
1053 @param[in] Token Point to the completion token to translate host\r
1054 address to host name.\r
1055\r
1056 @retval EFI_SUCCESS The operation completed successfully.\r
1057 @retval EFI_UNSUPPORTED This function is not supported.\r
1058 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
1059 This is NULL.\r
1060 Token is NULL.\r
1061 Token.Event is NULL.\r
1062 IpAddress is not valid IP address.\r
1063 @retval EFI_NO_MAPPING There's no source address is available for use.\r
1064 @retval EFI_NOT_STARTED This instance has not been started.\r
1065 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 1066**/\r
1067EFI_STATUS\r
1068EFIAPI\r
1069Dns6IpToHostName (\r
1070 IN EFI_DNS6_PROTOCOL *This,\r
1071 IN EFI_IPv6_ADDRESS IpAddress,\r
1072 IN EFI_DNS6_COMPLETION_TOKEN *Token\r
1073 );\r
1074\r
1075/**\r
0f4e123f
JW
1076 This function provides capability to retrieve arbitrary information from the DNS\r
1077 server.\r
1078\r
1079 This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r
1080 supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r
1081 RR content (e.g., TTL) was returned. The caller need parse the returned RR to get\r
1082 required information. The function is optional. Implementation can choose to support\r
1083 it or not.\r
1084\r
1085 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1086 @param[in] QName Pointer to Query Name.\r
1087 @param[in] QType Query Type.\r
1088 @param[in] QClass Query Name.\r
1089 @param[in] Token Point to the completion token to retrieve arbitrary\r
1090 information.\r
1091\r
1092 @retval EFI_SUCCESS The operation completed successfully.\r
1093 @retval EFI_UNSUPPORTED This function is not supported. Or the requested\r
1094 QType is not supported\r
1095 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
1096 This is NULL.\r
1097 Token is NULL.\r
1098 Token.Event is NULL.\r
1099 QName is NULL.\r
1100 @retval EFI_NO_MAPPING There's no source address is available for use.\r
1101 @retval EFI_NOT_STARTED This instance has not been started.\r
1102 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 1103**/\r
1104EFI_STATUS\r
1105EFIAPI\r
1106Dns6GeneralLookUp (\r
1107 IN EFI_DNS6_PROTOCOL *This,\r
1108 IN CHAR8 *QName,\r
1109 IN UINT16 QType, \r
1110 IN UINT16 QClass,\r
1111 IN EFI_DNS6_COMPLETION_TOKEN *Token\r
1112 );\r
1113\r
1114/**\r
0f4e123f
JW
1115 This function is to update the DNS Cache.\r
1116\r
1117 The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache\r
1118 can be normally dynamically updated after the DNS resolve succeeds. This function\r
1119 provided capability to manually add/delete/modify the DNS cache.\r
1120\r
1121 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1122 @param[in] DeleteFlag If FALSE, this function is to add one entry to the\r
1123 DNS Cahce. If TRUE, this function will delete\r
1124 matching DNS Cache entry.\r
1125 @param[in] Override If TRUE, the maching DNS cache entry will be\r
1126 overwritten with the supplied parameter. If FALSE,\r
1127 EFI_ACCESS_DENIED will be returned if the entry to\r
1128 be added is already existed.\r
1129 @param[in] DnsCacheEntry Pointer to DNS Cache entry.\r
1130\r
1131 @retval EFI_SUCCESS The operation completed successfully.\r
1132 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
1133 This is NULL.\r
1134 DnsCacheEntry.HostName is NULL.\r
1135 DnsCacheEntry.IpAddress is NULL.\r
1136 DnsCacheEntry.Timeout is zero.\r
1137 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is\r
1138 not TRUE.\r
1139 @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.\r
99c048ef 1140**/\r
1141EFI_STATUS\r
1142EFIAPI\r
1143Dns6UpdateDnsCache (\r
1144 IN EFI_DNS6_PROTOCOL *This,\r
1145 IN BOOLEAN DeleteFlag,\r
1146 IN BOOLEAN Override,\r
1147 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry\r
1148 );\r
1149\r
1150/**\r
0f4e123f
JW
1151 Polls for incoming data packets and processes outgoing data packets.\r
1152\r
1153 The Poll() function can be used by network drivers and applications to increase the\r
1154 rate that data packets are moved between the communications device and the transmit\r
1155 and receive queues.\r
1156\r
1157 In some systems, the periodic timer event in the managed network driver may not poll\r
1158 the underlying communications device fast enough to transmit and/or receive all data\r
1159 packets without missing incoming packets or dropping outgoing packets. Drivers and\r
1160 applications that are experiencing packet loss should try calling the Poll()\r
1161 function more often.\r
1162\r
1163 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1164\r
1165 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
1166 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.\r
1167 @retval EFI_INVALID_PARAMETER This is NULL.\r
1168 @retval EFI_NO_MAPPING There is no source address is available for use.\r
1169 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
1170 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive\r
1171 queue. Consider increasing the polling rate.\r
99c048ef 1172**/\r
1173EFI_STATUS\r
1174EFIAPI\r
1175Dns6Poll (\r
1176 IN EFI_DNS6_PROTOCOL *This\r
1177 );\r
1178\r
1179/**\r
0f4e123f
JW
1180 Abort an asynchronous DNS operation, including translation between IP and Host, and\r
1181 general look up behavior.\r
1182\r
1183 The Cancel() function is used to abort a pending resolution request. After calling\r
1184 this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be\r
1185 signaled. If the token is not in one of the queues, which usually means that the\r
1186 asynchronous operation has completed, this function will not signal the token and\r
1187 EFI_NOT_FOUND is returned.\r
1188\r
1189 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1190 @param[in] Token Pointer to a token that has been issued by\r
1191 EFI_DNS6_PROTOCOL.HostNameToIp (),\r
1192 EFI_DNS6_PROTOCOL.IpToHostName() or\r
1193 EFI_DNS6_PROTOCOL.GeneralLookup().\r
1194 If NULL, all pending tokens are aborted.\r
1195\r
1196 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
1197 @retval EFI_NOT_STARTED This EFI DNS6 Protocol instance has not been started.\r
1198 @retval EFI_INVALID_PARAMETER This is NULL.\r
1199 @retval EFI_NO_MAPPING There's no source address is available for use.\r
1200 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS\r
1201 operation was not found in the transmit queue. It\r
1202 was either completed or was not issued by\r
1203 HostNameToIp(), IpToHostName() or GeneralLookup().\r
99c048ef 1204**/\r
1205EFI_STATUS\r
1206EFIAPI\r
1207Dns6Cancel (\r
1208 IN EFI_DNS6_PROTOCOL *This,\r
1209 IN EFI_DNS6_COMPLETION_TOKEN *Token\r
1210 );\r
1211\r
1212#endif\r