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