]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/DnsDxe/DnsImpl.h
NetworkPkg: Remove TokenEntry from Token list before freed
[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
564 @param Item Return corresponding Token entry.\r
565\r
566 @retval TRUE The response is valid.\r
567 @retval FALSE The response is invalid.\r
568 \r
569**/ \r
570BOOLEAN\r
571IsValidDnsResponse (\r
572 IN NET_MAP *TokensMap,\r
573 IN UINT16 Identification,\r
574 IN UINT16 Type,\r
575 OUT NET_MAP_ITEM **Item\r
576 );\r
577\r
578/**\r
579 Parse Dns Response.\r
580\r
581 @param Instance The DNS instance\r
582 @param RxString Received buffer.\r
583 @param Completed Flag to indicate that Dns response is valid. \r
584 \r
585 @retval EFI_SUCCESS Parse Dns Response successfully.\r
586 @retval Others Failed to parse Dns Response.\r
587 \r
588**/ \r
589EFI_STATUS\r
590ParseDnsResponse (\r
591 IN OUT DNS_INSTANCE *Instance,\r
592 IN UINT8 *RxString,\r
593 OUT BOOLEAN *Completed\r
594 );\r
595\r
596/**\r
597 Parse response packet.\r
598\r
599 @param Packet The packets received.\r
600 @param EndPoint The local/remote UDP access point\r
601 @param IoStatus The status of the UDP receive\r
602 @param Context The opaque parameter to the function.\r
603\r
604**/ \r
605VOID\r
606EFIAPI\r
607DnsOnPacketReceived (\r
608 NET_BUF *Packet,\r
609 UDP_END_POINT *EndPoint,\r
610 EFI_STATUS IoStatus,\r
611 VOID *Context\r
612 );\r
613\r
614/**\r
615 Release the net buffer when packet is sent.\r
616\r
617 @param Packet The packets received.\r
618 @param EndPoint The local/remote UDP access point\r
619 @param IoStatus The status of the UDP receive\r
620 @param Context The opaque parameter to the function.\r
621\r
622**/\r
623VOID\r
624EFIAPI\r
625DnsOnPacketSent (\r
626 NET_BUF *Packet,\r
627 UDP_END_POINT *EndPoint,\r
628 EFI_STATUS IoStatus,\r
629 VOID *Context\r
630 );\r
631\r
632/**\r
633 Query request information.\r
634\r
635 @param Instance The DNS instance\r
636 @param Packet The packet for querying request information.\r
637\r
638 @retval EFI_SUCCESS Query request information successfully.\r
639 @retval Others Failed to query request information.\r
640\r
641**/\r
642EFI_STATUS\r
643DoDnsQuery (\r
644 IN DNS_INSTANCE *Instance,\r
645 IN NET_BUF *Packet\r
646 );\r
647\r
648/**\r
fcae1a99 649 Construct the Packet according query section.\r
99c048ef 650\r
651 @param Instance The DNS instance\r
fcae1a99
JW
652 @param QueryName Queried Name \r
653 @param Type Queried Type \r
654 @param Class Queried Class \r
655 @param Packet The packet for query\r
99c048ef 656\r
657 @retval EFI_SUCCESS The packet is constructed.\r
658 @retval Others Failed to construct the Packet.\r
659\r
660**/\r
661EFI_STATUS\r
fcae1a99 662ConstructDNSQuery (\r
99c048ef 663 IN DNS_INSTANCE *Instance,\r
fcae1a99 664 IN CHAR8 *QueryName,\r
99c048ef 665 IN UINT16 Type,\r
fcae1a99 666 IN UINT16 Class,\r
99c048ef 667 OUT NET_BUF **Packet\r
668 );\r
669\r
670/**\r
671 Retransmit the packet.\r
672\r
673 @param Instance The DNS instance\r
674 @param Packet Retransmit the packet \r
675\r
676 @retval EFI_SUCCESS The packet is retransmitted.\r
677 @retval Others Failed to retransmit.\r
678\r
679**/\r
680EFI_STATUS\r
681DnsRetransmit (\r
682 IN DNS_INSTANCE *Instance,\r
683 IN NET_BUF *Packet\r
684 );\r
685\r
686/**\r
687 The timer ticking function for the DNS service.\r
688\r
689 @param Event The ticking event\r
690 @param Context The DNS service instance\r
691\r
692**/\r
693VOID\r
694EFIAPI\r
695DnsOnTimerRetransmit (\r
696 IN EFI_EVENT Event,\r
697 IN VOID *Context\r
698 );\r
699\r
700/**\r
701 The timer ticking function for the DNS driver.\r
702\r
703 @param Event The ticking event\r
704 @param Context NULL\r
705\r
706**/\r
707VOID\r
708EFIAPI\r
709DnsOnTimerUpdate (\r
710 IN EFI_EVENT Event,\r
711 IN VOID *Context\r
712 );\r
713\r
714\r
715/**\r
0f4e123f 716 Retrieve mode data of this DNS instance.\r
99c048ef 717\r
0f4e123f 718 This function is used to retrieve DNS mode data for this DNS instance.\r
99c048ef 719\r
0f4e123f
JW
720 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
721 @param[out] DnsModeData Point to the mode data.\r
99c048ef 722\r
0f4e123f
JW
723 @retval EFI_SUCCESS The operation completed successfully.\r
724 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data\r
725 is available because this instance has not been\r
726 configured.\r
727 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.\r
728 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 729**/\r
730EFI_STATUS\r
731EFIAPI\r
732Dns4GetModeData (\r
733 IN EFI_DNS4_PROTOCOL *This,\r
734 OUT EFI_DNS4_MODE_DATA *DnsModeData\r
735 );\r
736\r
737/**\r
0f4e123f
JW
738 Configure this DNS instance.\r
739\r
740 This function is used to configure DNS mode data for this DNS instance.\r
741\r
742 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
743 @param[in] DnsConfigData Point to the Configuration data.\r
744\r
745 @retval EFI_SUCCESS The operation completed successfully.\r
746 @retval EFI_UNSUPPORTED The designated protocol is not supported.\r
747 @retval EFI_INVALID_PARAMTER Thisis NULL.\r
748 The StationIp address provided in DnsConfigData is not a \r
749 valid unicast.\r
750 DnsServerList is NULL while DnsServerListCount\r
751 is not ZERO.\r
752 DnsServerListCount is ZERO while DnsServerList\r
753 is not NULL\r
754 @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be\r
755 allocated.\r
756 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
757 EFI DNSv4 Protocol instance is not configured.\r
758 @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
759 reconfigure the instance the caller must call Configure() \r
760 with NULL first to return driver to unconfigured state.\r
99c048ef 761**/\r
762EFI_STATUS\r
763EFIAPI\r
764Dns4Configure (\r
765 IN EFI_DNS4_PROTOCOL *This,\r
766 IN EFI_DNS4_CONFIG_DATA *DnsConfigData\r
767 );\r
768\r
769/**\r
0f4e123f
JW
770 Host name to host address translation.\r
771\r
772 The HostNameToIp () function is used to translate the host name to host IP address. A\r
773 type A query is used to get the one or more IP addresses for this host.\r
774\r
775 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
776 @param[in] HostName Host name.\r
777 @param[in] Token Point to the completion token to translate host name\r
778 to host address.\r
779\r
780 @retval EFI_SUCCESS The operation completed successfully.\r
781 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
782 This is NULL.\r
783 Token is NULL.\r
784 Token.Event is NULL.\r
785 HostName is NULL. HostName string is unsupported format.\r
786 @retval EFI_NO_MAPPING There's no source address is available for use.\r
787 @retval EFI_NOT_STARTED This instance has not been started.\r
99c048ef 788**/\r
789EFI_STATUS\r
790EFIAPI\r
791Dns4HostNameToIp (\r
792 IN EFI_DNS4_PROTOCOL *This,\r
793 IN CHAR16 *HostName,\r
794 IN EFI_DNS4_COMPLETION_TOKEN *Token\r
795 );\r
796\r
797/**\r
0f4e123f
JW
798 IPv4 address to host name translation also known as Reverse DNS lookup.\r
799\r
800 The IpToHostName() function is used to translate the host address to host name. A type PTR \r
801 query is used to get the primary name of the host. Support of this function is optional.\r
802\r
803 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
804 @param[in] IpAddress Ip Address.\r
805 @param[in] Token Point to the completion token to translate host\r
806 address to host name.\r
807\r
808 @retval EFI_SUCCESS The operation completed successfully.\r
809 @retval EFI_UNSUPPORTED This function is not supported.\r
810 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
811 This is NULL.\r
812 Token is NULL.\r
813 Token.Event is NULL.\r
814 IpAddress is not valid IP address .\r
815 @retval EFI_NO_MAPPING There's no source address is available for use.\r
816 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r
817 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 818**/\r
819EFI_STATUS\r
820EFIAPI\r
821Dns4IpToHostName (\r
822 IN EFI_DNS4_PROTOCOL *This,\r
823 IN EFI_IPv4_ADDRESS IpAddress,\r
824 IN EFI_DNS4_COMPLETION_TOKEN *Token\r
825 );\r
826\r
827/**\r
0f4e123f
JW
828 Retrieve arbitrary information from the DNS server. \r
829\r
830 This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r
831 supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r
832 RR content (e.g., TTL) was returned. The caller need parse the returned RR to get\r
833 required information. The function is optional.\r
834\r
835 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
836 @param[in] QName Pointer to Query Name.\r
837 @param[in] QType Query Type.\r
838 @param[in] QClass Query Name.\r
839 @param[in] Token Point to the completion token to retrieve arbitrary\r
840 information.\r
841\r
842 @retval EFI_SUCCESS The operation completed successfully.\r
843 @retval EFI_UNSUPPORTED This function is not supported. Or the requested\r
844 QType is not supported\r
845 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
846 This is NULL.\r
847 Token is NULL.\r
848 Token.Event is NULL.\r
849 QName is NULL.\r
850 @retval EFI_NO_MAPPING There's no source address is available for use.\r
851 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r
852 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 853**/\r
854EFI_STATUS\r
855EFIAPI\r
856Dns4GeneralLookUp (\r
857 IN EFI_DNS4_PROTOCOL *This,\r
858 IN CHAR8 *QName,\r
859 IN UINT16 QType, \r
860 IN UINT16 QClass,\r
861 IN EFI_DNS4_COMPLETION_TOKEN *Token\r
862 );\r
863\r
864/**\r
0f4e123f
JW
865 This function is to update the DNS Cache.\r
866\r
867 The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache\r
868 can be normally dynamically updated after the DNS resolve succeeds. This function\r
869 provided capability to manually add/delete/modify the DNS cache.\r
870\r
871 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
872 @param[in] DeleteFlag If FALSE, this function is to add one entry to the\r
873 DNS Cahce. If TRUE, this function will delete\r
874 matching DNS Cache entry.\r
875 @param[in] Override If TRUE, the maching DNS cache entry will be\r
876 overwritten with the supplied parameter. If FALSE,\r
877 EFI_ACCESS_DENIED will be returned if the entry to\r
878 be added is already existed.\r
879 @param[in] DnsCacheEntry Pointer to DNS Cache entry.\r
880\r
881 @retval EFI_SUCCESS The operation completed successfully.\r
882 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
883 This is NULL.\r
884 DnsCacheEntry.HostName is NULL.\r
885 DnsCacheEntry.IpAddress is NULL.\r
886 DnsCacheEntry.Timeout is zero.\r
887 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is\r
888 not TRUE.\r
99c048ef 889**/\r
890EFI_STATUS\r
891EFIAPI\r
892Dns4UpdateDnsCache (\r
893 IN EFI_DNS4_PROTOCOL *This,\r
894 IN BOOLEAN DeleteFlag,\r
895 IN BOOLEAN Override,\r
896 IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry\r
897 );\r
898\r
899/**\r
0f4e123f
JW
900 Polls for incoming data packets and processes outgoing data packets.\r
901\r
902 The Poll() function can be used by network drivers and applications to increase the\r
903 rate that data packets are moved between the communications device and the transmit\r
904 and receive queues.\r
905 In some systems, the periodic timer event in the managed network driver may not poll\r
906 the underlying communications device fast enough to transmit and/or receive all data\r
907 packets without missing incoming packets or dropping outgoing packets. Drivers and\r
908 applications that are experiencing packet loss should try calling the Poll()\r
909 function more often.\r
910\r
911 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
912\r
913 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
914 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.\r
915 @retval EFI_INVALID_PARAMETER This is NULL.\r
916 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
917 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive\r
918 queue. Consider increasing the polling rate.\r
99c048ef 919**/\r
920EFI_STATUS\r
921EFIAPI\r
922Dns4Poll (\r
923 IN EFI_DNS4_PROTOCOL *This\r
924 );\r
925\r
926/**\r
0f4e123f
JW
927 Abort an asynchronous DNS operation, including translation between IP and Host, and\r
928 general look up behavior.\r
929\r
930 The Cancel() function is used to abort a pending resolution request. After calling\r
931 this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be\r
932 signaled. If the token is not in one of the queues, which usually means that the\r
933 asynchronous operation has completed, this function will not signal the token and\r
934 EFI_NOT_FOUND is returned.\r
935\r
936 @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r
937 @param[in] Token Pointer to a token that has been issued by\r
938 EFI_DNS4_PROTOCOL.HostNameToIp (),\r
939 EFI_DNS4_PROTOCOL.IpToHostName() or\r
940 EFI_DNS4_PROTOCOL.GeneralLookup().\r
941 If NULL, all pending tokens are aborted.\r
942\r
943 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
944 @retval EFI_NOT_STARTED This EFI DNS4 Protocol instance has not been started.\r
945 @retval EFI_INVALID_PARAMETER This is NULL.\r
946 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS\r
947 operation was not found in the transmit queue. It\r
948 was either completed or was not issued by\r
949 HostNameToIp(), IpToHostName() or GeneralLookup().\r
99c048ef 950**/\r
951EFI_STATUS\r
952EFIAPI\r
953Dns4Cancel (\r
954 IN EFI_DNS4_PROTOCOL *This,\r
955 IN EFI_DNS4_COMPLETION_TOKEN *Token\r
956 );\r
957\r
958\r
959/**\r
0f4e123f 960 Retrieve mode data of this DNS instance.\r
99c048ef 961\r
0f4e123f 962 This function is used to retrieve DNS mode data for this DNS instance.\r
99c048ef 963\r
0f4e123f
JW
964 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
965 @param[out] DnsModeData Pointer to the caller-allocated storage for the \r
966 EFI_DNS6_MODE_DATA data.\r
99c048ef 967\r
0f4e123f
JW
968 @retval EFI_SUCCESS The operation completed successfully.\r
969 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data\r
970 is available because this instance has not been\r
971 configured.\r
972 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.\r
973 @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.\r
99c048ef 974**/\r
975EFI_STATUS\r
976EFIAPI\r
977Dns6GetModeData (\r
978 IN EFI_DNS6_PROTOCOL *This,\r
979 OUT EFI_DNS6_MODE_DATA *DnsModeData\r
980 );\r
981\r
982/**\r
0f4e123f
JW
983 Configure this DNS instance.\r
984\r
985 The Configure() function is used to set and change the configuration data for this\r
986 EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.\r
987\r
988 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
989 @param[in] DnsConfigData Pointer to the configuration data structure. All associated \r
990 storage to be allocated and released by caller.\r
991\r
992 @retval EFI_SUCCESS The operation completed successfully.\r
993 @retval EFI_INVALID_PARAMTER This is NULL.\r
994 The StationIp address provided in DnsConfigData is not zero and not a valid unicast.\r
995 DnsServerList is NULL while DnsServerList Count is not ZERO.\r
996 DnsServerList Count is ZERO while DnsServerList is not NULL.\r
997 @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be allocated.\r
998 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r
999 EFI DNSv6 Protocol instance is not configured.\r
1000 @retval EFI_UNSUPPORTED The designated protocol is not supported.\r
1001 @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To \r
1002 reconfigure the instance the caller must call Configure() with \r
1003 NULL first to return driver to unconfigured state.\r
99c048ef 1004**/\r
1005EFI_STATUS\r
1006EFIAPI\r
1007Dns6Configure (\r
1008 IN EFI_DNS6_PROTOCOL *This,\r
1009 IN EFI_DNS6_CONFIG_DATA *DnsConfigData\r
1010 );\r
1011\r
1012/**\r
0f4e123f
JW
1013 Host name to host address translation.\r
1014\r
1015 The HostNameToIp () function is used to translate the host name to host IP address. A\r
1016 type AAAA query is used to get the one or more IPv6 addresses for this host.\r
1017\r
1018 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1019 @param[in] HostName Host name.\r
1020 @param[in] Token Point to the completion token to translate host name\r
1021 to host address.\r
1022\r
1023 @retval EFI_SUCCESS The operation completed successfully.\r
1024 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
1025 This is NULL.\r
1026 Token is NULL.\r
1027 Token.Event is NULL.\r
1028 HostName is NULL or buffer contained unsupported characters.\r
1029 @retval EFI_NO_MAPPING There's no source address is available for use.\r
1030 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r
1031 @retval EFI_NOT_STARTED This instance has not been started.\r
1032 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 1033**/\r
1034EFI_STATUS\r
1035EFIAPI\r
1036Dns6HostNameToIp (\r
1037 IN EFI_DNS6_PROTOCOL *This,\r
1038 IN CHAR16 *HostName,\r
1039 IN EFI_DNS6_COMPLETION_TOKEN *Token\r
1040 );\r
1041\r
1042/**\r
0f4e123f
JW
1043 Host address to host name translation.\r
1044\r
1045 The IpToHostName () function is used to translate the host address to host name. A\r
1046 type PTR query is used to get the primary name of the host. Implementation can choose\r
1047 to support this function or not.\r
1048\r
1049 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1050 @param[in] IpAddress Ip Address.\r
1051 @param[in] Token Point to the completion token to translate host\r
1052 address to host name.\r
1053\r
1054 @retval EFI_SUCCESS The operation completed successfully.\r
1055 @retval EFI_UNSUPPORTED This function is not supported.\r
1056 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
1057 This is NULL.\r
1058 Token is NULL.\r
1059 Token.Event is NULL.\r
1060 IpAddress is not valid IP address.\r
1061 @retval EFI_NO_MAPPING There's no source address is available for use.\r
1062 @retval EFI_NOT_STARTED This instance has not been started.\r
1063 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 1064**/\r
1065EFI_STATUS\r
1066EFIAPI\r
1067Dns6IpToHostName (\r
1068 IN EFI_DNS6_PROTOCOL *This,\r
1069 IN EFI_IPv6_ADDRESS IpAddress,\r
1070 IN EFI_DNS6_COMPLETION_TOKEN *Token\r
1071 );\r
1072\r
1073/**\r
0f4e123f
JW
1074 This function provides capability to retrieve arbitrary information from the DNS\r
1075 server.\r
1076\r
1077 This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r
1078 supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r
1079 RR content (e.g., TTL) was returned. The caller need parse the returned RR to get\r
1080 required information. The function is optional. Implementation can choose to support\r
1081 it or not.\r
1082\r
1083 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1084 @param[in] QName Pointer to Query Name.\r
1085 @param[in] QType Query Type.\r
1086 @param[in] QClass Query Name.\r
1087 @param[in] Token Point to the completion token to retrieve arbitrary\r
1088 information.\r
1089\r
1090 @retval EFI_SUCCESS The operation completed successfully.\r
1091 @retval EFI_UNSUPPORTED This function is not supported. Or the requested\r
1092 QType is not supported\r
1093 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
1094 This is NULL.\r
1095 Token is NULL.\r
1096 Token.Event is NULL.\r
1097 QName is NULL.\r
1098 @retval EFI_NO_MAPPING There's no source address is available for use.\r
1099 @retval EFI_NOT_STARTED This instance has not been started.\r
1100 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r
99c048ef 1101**/\r
1102EFI_STATUS\r
1103EFIAPI\r
1104Dns6GeneralLookUp (\r
1105 IN EFI_DNS6_PROTOCOL *This,\r
1106 IN CHAR8 *QName,\r
1107 IN UINT16 QType, \r
1108 IN UINT16 QClass,\r
1109 IN EFI_DNS6_COMPLETION_TOKEN *Token\r
1110 );\r
1111\r
1112/**\r
0f4e123f
JW
1113 This function is to update the DNS Cache.\r
1114\r
1115 The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache\r
1116 can be normally dynamically updated after the DNS resolve succeeds. This function\r
1117 provided capability to manually add/delete/modify the DNS cache.\r
1118\r
1119 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1120 @param[in] DeleteFlag If FALSE, this function is to add one entry to the\r
1121 DNS Cahce. If TRUE, this function will delete\r
1122 matching DNS Cache entry.\r
1123 @param[in] Override If TRUE, the maching DNS cache entry will be\r
1124 overwritten with the supplied parameter. If FALSE,\r
1125 EFI_ACCESS_DENIED will be returned if the entry to\r
1126 be added is already existed.\r
1127 @param[in] DnsCacheEntry Pointer to DNS Cache entry.\r
1128\r
1129 @retval EFI_SUCCESS The operation completed successfully.\r
1130 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
1131 This is NULL.\r
1132 DnsCacheEntry.HostName is NULL.\r
1133 DnsCacheEntry.IpAddress is NULL.\r
1134 DnsCacheEntry.Timeout is zero.\r
1135 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is\r
1136 not TRUE.\r
1137 @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.\r
99c048ef 1138**/\r
1139EFI_STATUS\r
1140EFIAPI\r
1141Dns6UpdateDnsCache (\r
1142 IN EFI_DNS6_PROTOCOL *This,\r
1143 IN BOOLEAN DeleteFlag,\r
1144 IN BOOLEAN Override,\r
1145 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry\r
1146 );\r
1147\r
1148/**\r
0f4e123f
JW
1149 Polls for incoming data packets and processes outgoing data packets.\r
1150\r
1151 The Poll() function can be used by network drivers and applications to increase the\r
1152 rate that data packets are moved between the communications device and the transmit\r
1153 and receive queues.\r
1154\r
1155 In some systems, the periodic timer event in the managed network driver may not poll\r
1156 the underlying communications device fast enough to transmit and/or receive all data\r
1157 packets without missing incoming packets or dropping outgoing packets. Drivers and\r
1158 applications that are experiencing packet loss should try calling the Poll()\r
1159 function more often.\r
1160\r
1161 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1162\r
1163 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
1164 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.\r
1165 @retval EFI_INVALID_PARAMETER This is NULL.\r
1166 @retval EFI_NO_MAPPING There is no source address is available for use.\r
1167 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
1168 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive\r
1169 queue. Consider increasing the polling rate.\r
99c048ef 1170**/\r
1171EFI_STATUS\r
1172EFIAPI\r
1173Dns6Poll (\r
1174 IN EFI_DNS6_PROTOCOL *This\r
1175 );\r
1176\r
1177/**\r
0f4e123f
JW
1178 Abort an asynchronous DNS operation, including translation between IP and Host, and\r
1179 general look up behavior.\r
1180\r
1181 The Cancel() function is used to abort a pending resolution request. After calling\r
1182 this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be\r
1183 signaled. If the token is not in one of the queues, which usually means that the\r
1184 asynchronous operation has completed, this function will not signal the token and\r
1185 EFI_NOT_FOUND is returned.\r
1186\r
1187 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r
1188 @param[in] Token Pointer to a token that has been issued by\r
1189 EFI_DNS6_PROTOCOL.HostNameToIp (),\r
1190 EFI_DNS6_PROTOCOL.IpToHostName() or\r
1191 EFI_DNS6_PROTOCOL.GeneralLookup().\r
1192 If NULL, all pending tokens are aborted.\r
1193\r
1194 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
1195 @retval EFI_NOT_STARTED This EFI DNS6 Protocol instance has not been started.\r
1196 @retval EFI_INVALID_PARAMETER This is NULL.\r
1197 @retval EFI_NO_MAPPING There's no source address is available for use.\r
1198 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS\r
1199 operation was not found in the transmit queue. It\r
1200 was either completed or was not issued by\r
1201 HostNameToIp(), IpToHostName() or GeneralLookup().\r
99c048ef 1202**/\r
1203EFI_STATUS\r
1204EFIAPI\r
1205Dns6Cancel (\r
1206 IN EFI_DNS6_PROTOCOL *This,\r
1207 IN EFI_DNS6_COMPLETION_TOKEN *Token\r
1208 );\r
1209\r
1210#endif\r