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