]>
Commit | Line | Data |
---|---|---|
99c048ef | 1 | /** @file\r |
2 | DnsDxe support functions implementation.\r | |
f75a7f56 LG |
3 | \r |
4 | Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
99c048ef | 5 | This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT 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 | |
64 | extern EFI_COMPONENT_NAME_PROTOCOL gDnsComponentName;\r | |
65 | extern EFI_COMPONENT_NAME2_PROTOCOL gDnsComponentName2;\r | |
66 | extern EFI_UNICODE_STRING_TABLE *gDnsControllerNameTable;\r | |
67 | \r | |
68 | extern EFI_DRIVER_BINDING_PROTOCOL gDns4DriverBinding;\r | |
69 | extern EFI_SERVICE_BINDING_PROTOCOL mDns4ServiceBinding;\r | |
70 | extern EFI_DNS4_PROTOCOL mDns4Protocol;\r | |
71 | \r | |
72 | extern EFI_DRIVER_BINDING_PROTOCOL gDns6DriverBinding;\r | |
73 | extern EFI_SERVICE_BINDING_PROTOCOL mDns6ServiceBinding;\r | |
74 | extern 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 | |
99c048ef | 89 | \r |
90 | #define DNS_TIME_TO_GETMAP 5\r | |
91 | \r | |
92 | #pragma pack(1)\r | |
93 | \r | |
94 | typedef union _DNS_FLAGS DNS_FLAGS;\r | |
95 | \r | |
96 | typedef struct {\r | |
97 | LIST_ENTRY AllCacheLink;\r | |
f75a7f56 | 98 | EFI_DNS4_CACHE_ENTRY DnsCache;\r |
99c048ef | 99 | } DNS4_CACHE;\r |
100 | \r | |
101 | typedef struct {\r | |
102 | LIST_ENTRY AllCacheLink;\r | |
f75a7f56 | 103 | EFI_DNS6_CACHE_ENTRY DnsCache;\r |
99c048ef | 104 | } DNS6_CACHE;\r |
105 | \r | |
106 | typedef struct {\r | |
107 | LIST_ENTRY AllServerLink;\r | |
f75a7f56 | 108 | EFI_IPv4_ADDRESS Dns4ServerIp;\r |
99c048ef | 109 | } DNS4_SERVER_IP;\r |
110 | \r | |
111 | typedef struct {\r | |
112 | LIST_ENTRY AllServerLink;\r | |
f75a7f56 | 113 | EFI_IPv6_ADDRESS Dns6ServerIp;\r |
99c048ef | 114 | } DNS6_SERVER_IP;\r |
115 | \r | |
116 | typedef struct {\r | |
cd2a6240 | 117 | UINT32 RetryCounting;\r |
99c048ef | 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 | |
125 | typedef struct {\r | |
cd2a6240 | 126 | UINT32 RetryCounting;\r |
99c048ef | 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 | |
134 | union _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 | |
158 | typedef 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 | |
167 | typedef struct {\r | |
168 | UINT16 Type;\r | |
169 | UINT16 Class;\r | |
170 | } DNS_QUERY_SECTION;\r | |
171 | \r | |
172 | typedef 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 | |
195 | EFI_STATUS\r | |
196 | Dns4RemoveTokenEntry (\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 | |
f75a7f56 | 209 | \r |
99c048ef | 210 | **/\r |
211 | EFI_STATUS\r | |
212 | Dns6RemoveTokenEntry (\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 | |
233 | EFI_STATUS\r | |
234 | EFIAPI\r | |
235 | Dns4CancelTokens (\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 | |
257 | EFI_STATUS\r | |
258 | EFIAPI\r | |
259 | Dns6CancelTokens (\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 | |
276 | EFI_STATUS\r | |
277 | EFIAPI\r | |
278 | GetDns4TokenEntry (\r | |
279 | IN NET_MAP *TokensMap,\r | |
f75a7f56 | 280 | IN EFI_DNS4_COMPLETION_TOKEN *Token,\r |
99c048ef | 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 | |
295 | EFI_STATUS\r | |
296 | EFIAPI\r | |
297 | GetDns6TokenEntry (\r | |
298 | IN NET_MAP *TokensMap,\r | |
f75a7f56 | 299 | IN EFI_DNS6_COMPLETION_TOKEN *Token,\r |
99c048ef | 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 | |
315 | EFI_STATUS\r | |
316 | Dns4InstanceCancelToken (\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 | |
333 | EFI_STATUS\r | |
334 | Dns6InstanceCancelToken (\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 | |
345 | VOID\r | |
346 | Dns4CleanConfigure (\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 | |
356 | VOID\r | |
357 | Dns6CleanConfigure (\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 | |
372 | EFI_STATUS\r | |
373 | Dns4CopyConfigure (\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 | |
389 | EFI_STATUS\r | |
390 | Dns6CopyConfigure (\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 | |
401 | VOID\r | |
402 | EFIAPI\r | |
403 | DnsDummyExtFree (\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 | |
f75a7f56 LG |
409 | by DHCP.\r |
410 | \r | |
411 | The default time out value is 5 seconds. If IP has retrieved the default address,\r | |
99c048ef | 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 | |
422 | BOOLEAN\r | |
423 | Dns4GetMapping (\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 | |
441 | BOOLEAN\r | |
442 | Dns6GetMapping (\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 | |
f75a7f56 | 450 | \r |
99c048ef | 451 | @param Instance The DNS session\r |
452 | @param UdpIo The UDP_IO instance\r | |
f75a7f56 | 453 | \r |
99c048ef | 454 | @retval EFI_SUCCESS The UDP is successfully configured for the\r |
455 | session.\r | |
456 | \r | |
457 | **/\r | |
458 | EFI_STATUS\r | |
459 | Dns4ConfigUdp (\r | |
460 | IN DNS_INSTANCE *Instance,\r | |
461 | IN UDP_IO *UdpIo\r | |
462 | );\r | |
463 | \r | |
464 | /**\r | |
465 | Configure the UDP.\r | |
f75a7f56 | 466 | \r |
99c048ef | 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 | |
474 | EFI_STATUS\r | |
475 | Dns6ConfigUdp (\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 | |
f75a7f56 | 482 | \r |
99c048ef | 483 | @param Dns4CacheList All Dns4 cache list.\r |
f75a7f56 LG |
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 | |
99c048ef | 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 | |
f75a7f56 LG |
491 | @retval Others Failed to update Dns4 cache.\r |
492 | \r | |
99c048ef | 493 | **/\r |
494 | EFI_STATUS\r | |
495 | EFIAPI\r | |
496 | UpdateDns4Cache (\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 | |
f75a7f56 | 504 | Update Dns6 cache to shared list of caches of all DNSv6 instances.\r |
99c048ef | 505 | \r |
506 | @param Dns6CacheList All Dns6 cache list.\r | |
f75a7f56 LG |
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 | |
99c048ef | 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 | |
f75a7f56 | 512 | \r |
99c048ef | 513 | @retval EFI_SUCCESS Update Dns6 cache successfully.\r |
514 | @retval Others Failed to update Dns6 cache.\r | |
f75a7f56 | 515 | **/\r |
99c048ef | 516 | EFI_STATUS\r |
517 | EFIAPI\r | |
518 | UpdateDns6Cache (\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 | |
f75a7f56 | 526 | Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.\r |
99c048ef | 527 | \r |
f75a7f56 LG |
528 | @param Dns4ServerList Common list of addresses of all configured DNSv4 server.\r |
529 | @param ServerIp DNS server Ip.\r | |
99c048ef | 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 | |
f75a7f56 | 533 | \r |
99c048ef | 534 | **/\r |
535 | EFI_STATUS\r | |
536 | EFIAPI\r | |
537 | AddDns4ServerIp (\r | |
538 | IN LIST_ENTRY *Dns4ServerList,\r | |
539 | IN EFI_IPv4_ADDRESS ServerIp\r | |
540 | );\r | |
541 | \r | |
542 | /**\r | |
f75a7f56 | 543 | Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.\r |
99c048ef | 544 | \r |
f75a7f56 LG |
545 | @param Dns6ServerList Common list of addresses of all configured DNSv6 server.\r |
546 | @param ServerIp DNS server Ip.\r | |
99c048ef | 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 | |
f75a7f56 LG |
550 | \r |
551 | **/\r | |
99c048ef | 552 | EFI_STATUS\r |
553 | EFIAPI\r | |
554 | AddDns6ServerIp (\r | |
555 | IN LIST_ENTRY *Dns6ServerList,\r | |
556 | IN EFI_IPv6_ADDRESS ServerIp\r | |
557 | );\r | |
558 | \r | |
559 | /**\r | |
560 | Find out whether the response is valid or invalid.\r | |
561 | \r | |
f75a7f56 LG |
562 | @param TokensMap All DNS transmittal Tokens entry.\r |
563 | @param Identification Identification for queried packet.\r | |
99c048ef | 564 | @param Type Type for queried packet.\r |
3900a743 | 565 | @param Class Class for queried packet.\r |
99c048ef | 566 | @param Item Return corresponding Token entry.\r |
567 | \r | |
568 | @retval TRUE The response is valid.\r | |
569 | @retval FALSE The response is invalid.\r | |
f75a7f56 LG |
570 | \r |
571 | **/\r | |
99c048ef | 572 | BOOLEAN\r |
573 | IsValidDnsResponse (\r | |
574 | IN NET_MAP *TokensMap,\r | |
575 | IN UINT16 Identification,\r | |
576 | IN UINT16 Type,\r | |
3900a743 | 577 | IN UINT16 Class,\r |
99c048ef | 578 | OUT NET_MAP_ITEM **Item\r |
579 | );\r | |
580 | \r | |
581 | /**\r | |
582 | Parse Dns Response.\r | |
583 | \r | |
584 | @param Instance The DNS instance\r | |
585 | @param RxString Received buffer.\r | |
84110bbe | 586 | @param Length Received buffer length.\r |
f75a7f56 LG |
587 | @param Completed Flag to indicate that Dns response is valid.\r |
588 | \r | |
99c048ef | 589 | @retval EFI_SUCCESS Parse Dns Response successfully.\r |
590 | @retval Others Failed to parse Dns Response.\r | |
f75a7f56 LG |
591 | \r |
592 | **/\r | |
99c048ef | 593 | EFI_STATUS\r |
594 | ParseDnsResponse (\r | |
595 | IN OUT DNS_INSTANCE *Instance,\r | |
596 | IN UINT8 *RxString,\r | |
84110bbe | 597 | IN UINT32 Length,\r |
99c048ef | 598 | OUT BOOLEAN *Completed\r |
599 | );\r | |
600 | \r | |
601 | /**\r | |
602 | Parse response packet.\r | |
603 | \r | |
604 | @param Packet The packets received.\r | |
605 | @param EndPoint The local/remote UDP access point\r | |
606 | @param IoStatus The status of the UDP receive\r | |
607 | @param Context The opaque parameter to the function.\r | |
608 | \r | |
f75a7f56 | 609 | **/\r |
99c048ef | 610 | VOID\r |
611 | EFIAPI\r | |
612 | DnsOnPacketReceived (\r | |
613 | NET_BUF *Packet,\r | |
614 | UDP_END_POINT *EndPoint,\r | |
615 | EFI_STATUS IoStatus,\r | |
616 | VOID *Context\r | |
617 | );\r | |
618 | \r | |
619 | /**\r | |
620 | Release the net buffer when packet is sent.\r | |
621 | \r | |
622 | @param Packet The packets received.\r | |
623 | @param EndPoint The local/remote UDP access point\r | |
624 | @param IoStatus The status of the UDP receive\r | |
625 | @param Context The opaque parameter to the function.\r | |
626 | \r | |
627 | **/\r | |
628 | VOID\r | |
629 | EFIAPI\r | |
630 | DnsOnPacketSent (\r | |
631 | NET_BUF *Packet,\r | |
632 | UDP_END_POINT *EndPoint,\r | |
633 | EFI_STATUS IoStatus,\r | |
634 | VOID *Context\r | |
635 | );\r | |
636 | \r | |
637 | /**\r | |
638 | Query request information.\r | |
639 | \r | |
640 | @param Instance The DNS instance\r | |
641 | @param Packet The packet for querying request information.\r | |
642 | \r | |
643 | @retval EFI_SUCCESS Query request information successfully.\r | |
644 | @retval Others Failed to query request information.\r | |
645 | \r | |
646 | **/\r | |
647 | EFI_STATUS\r | |
648 | DoDnsQuery (\r | |
649 | IN DNS_INSTANCE *Instance,\r | |
650 | IN NET_BUF *Packet\r | |
651 | );\r | |
652 | \r | |
653 | /**\r | |
fcae1a99 | 654 | Construct the Packet according query section.\r |
99c048ef | 655 | \r |
656 | @param Instance The DNS instance\r | |
f75a7f56 LG |
657 | @param QueryName Queried Name\r |
658 | @param Type Queried Type\r | |
659 | @param Class Queried Class\r | |
fcae1a99 | 660 | @param Packet The packet for query\r |
99c048ef | 661 | \r |
662 | @retval EFI_SUCCESS The packet is constructed.\r | |
663 | @retval Others Failed to construct the Packet.\r | |
664 | \r | |
665 | **/\r | |
666 | EFI_STATUS\r | |
fcae1a99 | 667 | ConstructDNSQuery (\r |
99c048ef | 668 | IN DNS_INSTANCE *Instance,\r |
fcae1a99 | 669 | IN CHAR8 *QueryName,\r |
99c048ef | 670 | IN UINT16 Type,\r |
fcae1a99 | 671 | IN UINT16 Class,\r |
99c048ef | 672 | OUT NET_BUF **Packet\r |
673 | );\r | |
674 | \r | |
675 | /**\r | |
676 | Retransmit the packet.\r | |
677 | \r | |
678 | @param Instance The DNS instance\r | |
f75a7f56 | 679 | @param Packet Retransmit the packet\r |
99c048ef | 680 | \r |
681 | @retval EFI_SUCCESS The packet is retransmitted.\r | |
682 | @retval Others Failed to retransmit.\r | |
683 | \r | |
684 | **/\r | |
685 | EFI_STATUS\r | |
686 | DnsRetransmit (\r | |
687 | IN DNS_INSTANCE *Instance,\r | |
688 | IN NET_BUF *Packet\r | |
689 | );\r | |
690 | \r | |
691 | /**\r | |
692 | The timer ticking function for the DNS service.\r | |
693 | \r | |
694 | @param Event The ticking event\r | |
695 | @param Context The DNS service instance\r | |
696 | \r | |
697 | **/\r | |
698 | VOID\r | |
699 | EFIAPI\r | |
700 | DnsOnTimerRetransmit (\r | |
701 | IN EFI_EVENT Event,\r | |
702 | IN VOID *Context\r | |
703 | );\r | |
704 | \r | |
705 | /**\r | |
706 | The timer ticking function for the DNS driver.\r | |
707 | \r | |
708 | @param Event The ticking event\r | |
709 | @param Context NULL\r | |
710 | \r | |
711 | **/\r | |
712 | VOID\r | |
713 | EFIAPI\r | |
714 | DnsOnTimerUpdate (\r | |
715 | IN EFI_EVENT Event,\r | |
716 | IN VOID *Context\r | |
717 | );\r | |
718 | \r | |
719 | \r | |
720 | /**\r | |
0f4e123f | 721 | Retrieve mode data of this DNS instance.\r |
99c048ef | 722 | \r |
0f4e123f | 723 | This function is used to retrieve DNS mode data for this DNS instance.\r |
99c048ef | 724 | \r |
0f4e123f JW |
725 | @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r |
726 | @param[out] DnsModeData Point to the mode data.\r | |
99c048ef | 727 | \r |
0f4e123f JW |
728 | @retval EFI_SUCCESS The operation completed successfully.\r |
729 | @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data\r | |
730 | is available because this instance has not been\r | |
731 | configured.\r | |
732 | @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.\r | |
733 | @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r | |
99c048ef | 734 | **/\r |
735 | EFI_STATUS\r | |
736 | EFIAPI\r | |
737 | Dns4GetModeData (\r | |
738 | IN EFI_DNS4_PROTOCOL *This,\r | |
739 | OUT EFI_DNS4_MODE_DATA *DnsModeData\r | |
740 | );\r | |
741 | \r | |
742 | /**\r | |
0f4e123f JW |
743 | Configure this DNS instance.\r |
744 | \r | |
745 | This function is used to configure DNS mode data for this DNS instance.\r | |
746 | \r | |
747 | @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r | |
748 | @param[in] DnsConfigData Point to the Configuration data.\r | |
749 | \r | |
750 | @retval EFI_SUCCESS The operation completed successfully.\r | |
751 | @retval EFI_UNSUPPORTED The designated protocol is not supported.\r | |
752 | @retval EFI_INVALID_PARAMTER Thisis NULL.\r | |
f75a7f56 | 753 | The StationIp address provided in DnsConfigData is not a\r |
0f4e123f JW |
754 | valid unicast.\r |
755 | DnsServerList is NULL while DnsServerListCount\r | |
756 | is not ZERO.\r | |
757 | DnsServerListCount is ZERO while DnsServerList\r | |
758 | is not NULL\r | |
759 | @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be\r | |
760 | allocated.\r | |
761 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r | |
762 | EFI DNSv4 Protocol instance is not configured.\r | |
f75a7f56 LG |
763 | @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To\r |
764 | reconfigure the instance the caller must call Configure()\r | |
0f4e123f | 765 | with NULL first to return driver to unconfigured state.\r |
99c048ef | 766 | **/\r |
767 | EFI_STATUS\r | |
768 | EFIAPI\r | |
769 | Dns4Configure (\r | |
770 | IN EFI_DNS4_PROTOCOL *This,\r | |
771 | IN EFI_DNS4_CONFIG_DATA *DnsConfigData\r | |
772 | );\r | |
773 | \r | |
774 | /**\r | |
0f4e123f JW |
775 | Host name to host address translation.\r |
776 | \r | |
777 | The HostNameToIp () function is used to translate the host name to host IP address. A\r | |
778 | type A query is used to get the one or more IP addresses for this host.\r | |
779 | \r | |
780 | @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r | |
781 | @param[in] HostName Host name.\r | |
782 | @param[in] Token Point to the completion token to translate host name\r | |
783 | to host address.\r | |
784 | \r | |
785 | @retval EFI_SUCCESS The operation completed successfully.\r | |
786 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
787 | This is NULL.\r | |
788 | Token is NULL.\r | |
789 | Token.Event is NULL.\r | |
790 | HostName is NULL. HostName string is unsupported format.\r | |
791 | @retval EFI_NO_MAPPING There's no source address is available for use.\r | |
792 | @retval EFI_NOT_STARTED This instance has not been started.\r | |
99c048ef | 793 | **/\r |
794 | EFI_STATUS\r | |
795 | EFIAPI\r | |
796 | Dns4HostNameToIp (\r | |
797 | IN EFI_DNS4_PROTOCOL *This,\r | |
798 | IN CHAR16 *HostName,\r | |
799 | IN EFI_DNS4_COMPLETION_TOKEN *Token\r | |
800 | );\r | |
801 | \r | |
802 | /**\r | |
0f4e123f JW |
803 | IPv4 address to host name translation also known as Reverse DNS lookup.\r |
804 | \r | |
f75a7f56 | 805 | The IpToHostName() function is used to translate the host address to host name. A type PTR\r |
0f4e123f JW |
806 | query is used to get the primary name of the host. Support of this function is optional.\r |
807 | \r | |
808 | @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r | |
809 | @param[in] IpAddress Ip Address.\r | |
810 | @param[in] Token Point to the completion token to translate host\r | |
811 | address to host name.\r | |
812 | \r | |
813 | @retval EFI_SUCCESS The operation completed successfully.\r | |
814 | @retval EFI_UNSUPPORTED This function is not supported.\r | |
815 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
816 | This is NULL.\r | |
817 | Token is NULL.\r | |
818 | Token.Event is NULL.\r | |
819 | IpAddress is not valid IP address .\r | |
820 | @retval EFI_NO_MAPPING There's no source address is available for use.\r | |
821 | @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r | |
822 | @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r | |
99c048ef | 823 | **/\r |
824 | EFI_STATUS\r | |
825 | EFIAPI\r | |
826 | Dns4IpToHostName (\r | |
827 | IN EFI_DNS4_PROTOCOL *This,\r | |
828 | IN EFI_IPv4_ADDRESS IpAddress,\r | |
829 | IN EFI_DNS4_COMPLETION_TOKEN *Token\r | |
830 | );\r | |
831 | \r | |
832 | /**\r | |
f75a7f56 | 833 | Retrieve arbitrary information from the DNS server.\r |
0f4e123f JW |
834 | \r |
835 | This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r | |
836 | supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r | |
837 | RR content (e.g., TTL) was returned. The caller need parse the returned RR to get\r | |
838 | required information. The function is optional.\r | |
839 | \r | |
840 | @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r | |
841 | @param[in] QName Pointer to Query Name.\r | |
842 | @param[in] QType Query Type.\r | |
843 | @param[in] QClass Query Name.\r | |
844 | @param[in] Token Point to the completion token to retrieve arbitrary\r | |
845 | information.\r | |
846 | \r | |
847 | @retval EFI_SUCCESS The operation completed successfully.\r | |
848 | @retval EFI_UNSUPPORTED This function is not supported. Or the requested\r | |
849 | QType is not supported\r | |
850 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
851 | This is NULL.\r | |
852 | Token is NULL.\r | |
853 | Token.Event is NULL.\r | |
854 | QName is NULL.\r | |
855 | @retval EFI_NO_MAPPING There's no source address is available for use.\r | |
856 | @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r | |
857 | @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r | |
99c048ef | 858 | **/\r |
859 | EFI_STATUS\r | |
860 | EFIAPI\r | |
861 | Dns4GeneralLookUp (\r | |
862 | IN EFI_DNS4_PROTOCOL *This,\r | |
863 | IN CHAR8 *QName,\r | |
f75a7f56 | 864 | IN UINT16 QType,\r |
99c048ef | 865 | IN UINT16 QClass,\r |
866 | IN EFI_DNS4_COMPLETION_TOKEN *Token\r | |
867 | );\r | |
868 | \r | |
869 | /**\r | |
0f4e123f JW |
870 | This function is to update the DNS Cache.\r |
871 | \r | |
872 | The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache\r | |
873 | can be normally dynamically updated after the DNS resolve succeeds. This function\r | |
874 | provided capability to manually add/delete/modify the DNS cache.\r | |
875 | \r | |
876 | @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r | |
877 | @param[in] DeleteFlag If FALSE, this function is to add one entry to the\r | |
878 | DNS Cahce. If TRUE, this function will delete\r | |
879 | matching DNS Cache entry.\r | |
880 | @param[in] Override If TRUE, the maching DNS cache entry will be\r | |
881 | overwritten with the supplied parameter. If FALSE,\r | |
882 | EFI_ACCESS_DENIED will be returned if the entry to\r | |
883 | be added is already existed.\r | |
884 | @param[in] DnsCacheEntry Pointer to DNS Cache entry.\r | |
885 | \r | |
886 | @retval EFI_SUCCESS The operation completed successfully.\r | |
887 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
888 | This is NULL.\r | |
889 | DnsCacheEntry.HostName is NULL.\r | |
890 | DnsCacheEntry.IpAddress is NULL.\r | |
891 | DnsCacheEntry.Timeout is zero.\r | |
892 | @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is\r | |
893 | not TRUE.\r | |
99c048ef | 894 | **/\r |
895 | EFI_STATUS\r | |
896 | EFIAPI\r | |
897 | Dns4UpdateDnsCache (\r | |
898 | IN EFI_DNS4_PROTOCOL *This,\r | |
899 | IN BOOLEAN DeleteFlag,\r | |
900 | IN BOOLEAN Override,\r | |
901 | IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry\r | |
902 | );\r | |
903 | \r | |
904 | /**\r | |
0f4e123f JW |
905 | Polls for incoming data packets and processes outgoing data packets.\r |
906 | \r | |
907 | The Poll() function can be used by network drivers and applications to increase the\r | |
908 | rate that data packets are moved between the communications device and the transmit\r | |
909 | and receive queues.\r | |
910 | In some systems, the periodic timer event in the managed network driver may not poll\r | |
911 | the underlying communications device fast enough to transmit and/or receive all data\r | |
912 | packets without missing incoming packets or dropping outgoing packets. Drivers and\r | |
913 | applications that are experiencing packet loss should try calling the Poll()\r | |
914 | function more often.\r | |
915 | \r | |
916 | @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r | |
917 | \r | |
918 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
919 | @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.\r | |
920 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
921 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
922 | @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive\r | |
923 | queue. Consider increasing the polling rate.\r | |
99c048ef | 924 | **/\r |
925 | EFI_STATUS\r | |
926 | EFIAPI\r | |
927 | Dns4Poll (\r | |
928 | IN EFI_DNS4_PROTOCOL *This\r | |
929 | );\r | |
930 | \r | |
931 | /**\r | |
0f4e123f JW |
932 | Abort an asynchronous DNS operation, including translation between IP and Host, and\r |
933 | general look up behavior.\r | |
934 | \r | |
935 | The Cancel() function is used to abort a pending resolution request. After calling\r | |
936 | this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be\r | |
937 | signaled. If the token is not in one of the queues, which usually means that the\r | |
938 | asynchronous operation has completed, this function will not signal the token and\r | |
939 | EFI_NOT_FOUND is returned.\r | |
940 | \r | |
941 | @param[in] This Pointer to EFI_DNS4_PROTOCOL instance.\r | |
942 | @param[in] Token Pointer to a token that has been issued by\r | |
943 | EFI_DNS4_PROTOCOL.HostNameToIp (),\r | |
944 | EFI_DNS4_PROTOCOL.IpToHostName() or\r | |
945 | EFI_DNS4_PROTOCOL.GeneralLookup().\r | |
946 | If NULL, all pending tokens are aborted.\r | |
947 | \r | |
948 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
949 | @retval EFI_NOT_STARTED This EFI DNS4 Protocol instance has not been started.\r | |
950 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
951 | @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS\r | |
952 | operation was not found in the transmit queue. It\r | |
953 | was either completed or was not issued by\r | |
954 | HostNameToIp(), IpToHostName() or GeneralLookup().\r | |
99c048ef | 955 | **/\r |
956 | EFI_STATUS\r | |
957 | EFIAPI\r | |
958 | Dns4Cancel (\r | |
959 | IN EFI_DNS4_PROTOCOL *This,\r | |
960 | IN EFI_DNS4_COMPLETION_TOKEN *Token\r | |
961 | );\r | |
962 | \r | |
963 | \r | |
964 | /**\r | |
0f4e123f | 965 | Retrieve mode data of this DNS instance.\r |
99c048ef | 966 | \r |
0f4e123f | 967 | This function is used to retrieve DNS mode data for this DNS instance.\r |
99c048ef | 968 | \r |
0f4e123f | 969 | @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r |
f75a7f56 | 970 | @param[out] DnsModeData Pointer to the caller-allocated storage for the\r |
0f4e123f | 971 | EFI_DNS6_MODE_DATA data.\r |
99c048ef | 972 | \r |
0f4e123f JW |
973 | @retval EFI_SUCCESS The operation completed successfully.\r |
974 | @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data\r | |
975 | is available because this instance has not been\r | |
976 | configured.\r | |
977 | @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.\r | |
978 | @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.\r | |
99c048ef | 979 | **/\r |
980 | EFI_STATUS\r | |
981 | EFIAPI\r | |
982 | Dns6GetModeData (\r | |
983 | IN EFI_DNS6_PROTOCOL *This,\r | |
984 | OUT EFI_DNS6_MODE_DATA *DnsModeData\r | |
985 | );\r | |
986 | \r | |
987 | /**\r | |
0f4e123f JW |
988 | Configure this DNS instance.\r |
989 | \r | |
990 | The Configure() function is used to set and change the configuration data for this\r | |
991 | EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.\r | |
992 | \r | |
993 | @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r | |
f75a7f56 | 994 | @param[in] DnsConfigData Pointer to the configuration data structure. All associated\r |
0f4e123f JW |
995 | storage to be allocated and released by caller.\r |
996 | \r | |
997 | @retval EFI_SUCCESS The operation completed successfully.\r | |
998 | @retval EFI_INVALID_PARAMTER This is NULL.\r | |
999 | The StationIp address provided in DnsConfigData is not zero and not a valid unicast.\r | |
1000 | DnsServerList is NULL while DnsServerList Count is not ZERO.\r | |
1001 | DnsServerList Count is ZERO while DnsServerList is not NULL.\r | |
1002 | @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be allocated.\r | |
1003 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The\r | |
1004 | EFI DNSv6 Protocol instance is not configured.\r | |
1005 | @retval EFI_UNSUPPORTED The designated protocol is not supported.\r | |
f75a7f56 LG |
1006 | @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To\r |
1007 | reconfigure the instance the caller must call Configure() with\r | |
0f4e123f | 1008 | NULL first to return driver to unconfigured state.\r |
99c048ef | 1009 | **/\r |
1010 | EFI_STATUS\r | |
1011 | EFIAPI\r | |
1012 | Dns6Configure (\r | |
1013 | IN EFI_DNS6_PROTOCOL *This,\r | |
1014 | IN EFI_DNS6_CONFIG_DATA *DnsConfigData\r | |
1015 | );\r | |
1016 | \r | |
1017 | /**\r | |
0f4e123f JW |
1018 | Host name to host address translation.\r |
1019 | \r | |
1020 | The HostNameToIp () function is used to translate the host name to host IP address. A\r | |
1021 | type AAAA query is used to get the one or more IPv6 addresses for this host.\r | |
1022 | \r | |
1023 | @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r | |
1024 | @param[in] HostName Host name.\r | |
1025 | @param[in] Token Point to the completion token to translate host name\r | |
1026 | to host address.\r | |
1027 | \r | |
1028 | @retval EFI_SUCCESS The operation completed successfully.\r | |
1029 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
1030 | This is NULL.\r | |
1031 | Token is NULL.\r | |
1032 | Token.Event is NULL.\r | |
1033 | HostName is NULL or buffer contained unsupported characters.\r | |
1034 | @retval EFI_NO_MAPPING There's no source address is available for use.\r | |
1035 | @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.\r | |
1036 | @retval EFI_NOT_STARTED This instance has not been started.\r | |
1037 | @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r | |
99c048ef | 1038 | **/\r |
1039 | EFI_STATUS\r | |
1040 | EFIAPI\r | |
1041 | Dns6HostNameToIp (\r | |
1042 | IN EFI_DNS6_PROTOCOL *This,\r | |
1043 | IN CHAR16 *HostName,\r | |
1044 | IN EFI_DNS6_COMPLETION_TOKEN *Token\r | |
1045 | );\r | |
1046 | \r | |
1047 | /**\r | |
0f4e123f JW |
1048 | Host address to host name translation.\r |
1049 | \r | |
1050 | The IpToHostName () function is used to translate the host address to host name. A\r | |
1051 | type PTR query is used to get the primary name of the host. Implementation can choose\r | |
1052 | to support this function or not.\r | |
1053 | \r | |
1054 | @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r | |
1055 | @param[in] IpAddress Ip Address.\r | |
1056 | @param[in] Token Point to the completion token to translate host\r | |
1057 | address to host name.\r | |
1058 | \r | |
1059 | @retval EFI_SUCCESS The operation completed successfully.\r | |
1060 | @retval EFI_UNSUPPORTED This function is not supported.\r | |
1061 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
1062 | This is NULL.\r | |
1063 | Token is NULL.\r | |
1064 | Token.Event is NULL.\r | |
1065 | IpAddress is not valid IP address.\r | |
1066 | @retval EFI_NO_MAPPING There's no source address is available for use.\r | |
1067 | @retval EFI_NOT_STARTED This instance has not been started.\r | |
1068 | @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r | |
99c048ef | 1069 | **/\r |
1070 | EFI_STATUS\r | |
1071 | EFIAPI\r | |
1072 | Dns6IpToHostName (\r | |
1073 | IN EFI_DNS6_PROTOCOL *This,\r | |
1074 | IN EFI_IPv6_ADDRESS IpAddress,\r | |
1075 | IN EFI_DNS6_COMPLETION_TOKEN *Token\r | |
1076 | );\r | |
1077 | \r | |
1078 | /**\r | |
0f4e123f JW |
1079 | This function provides capability to retrieve arbitrary information from the DNS\r |
1080 | server.\r | |
1081 | \r | |
1082 | This GeneralLookup() function retrieves arbitrary information from the DNS. The caller\r | |
1083 | supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All\r | |
1084 | RR content (e.g., TTL) was returned. The caller need parse the returned RR to get\r | |
1085 | required information. The function is optional. Implementation can choose to support\r | |
1086 | it or not.\r | |
1087 | \r | |
1088 | @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r | |
1089 | @param[in] QName Pointer to Query Name.\r | |
1090 | @param[in] QType Query Type.\r | |
1091 | @param[in] QClass Query Name.\r | |
1092 | @param[in] Token Point to the completion token to retrieve arbitrary\r | |
1093 | information.\r | |
1094 | \r | |
1095 | @retval EFI_SUCCESS The operation completed successfully.\r | |
1096 | @retval EFI_UNSUPPORTED This function is not supported. Or the requested\r | |
1097 | QType is not supported\r | |
1098 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
1099 | This is NULL.\r | |
1100 | Token is NULL.\r | |
1101 | Token.Event is NULL.\r | |
1102 | QName is NULL.\r | |
1103 | @retval EFI_NO_MAPPING There's no source address is available for use.\r | |
1104 | @retval EFI_NOT_STARTED This instance has not been started.\r | |
1105 | @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.\r | |
99c048ef | 1106 | **/\r |
1107 | EFI_STATUS\r | |
1108 | EFIAPI\r | |
1109 | Dns6GeneralLookUp (\r | |
1110 | IN EFI_DNS6_PROTOCOL *This,\r | |
1111 | IN CHAR8 *QName,\r | |
f75a7f56 | 1112 | IN UINT16 QType,\r |
99c048ef | 1113 | IN UINT16 QClass,\r |
1114 | IN EFI_DNS6_COMPLETION_TOKEN *Token\r | |
1115 | );\r | |
1116 | \r | |
1117 | /**\r | |
0f4e123f JW |
1118 | This function is to update the DNS Cache.\r |
1119 | \r | |
1120 | The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache\r | |
1121 | can be normally dynamically updated after the DNS resolve succeeds. This function\r | |
1122 | provided capability to manually add/delete/modify the DNS cache.\r | |
1123 | \r | |
1124 | @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r | |
1125 | @param[in] DeleteFlag If FALSE, this function is to add one entry to the\r | |
1126 | DNS Cahce. If TRUE, this function will delete\r | |
1127 | matching DNS Cache entry.\r | |
1128 | @param[in] Override If TRUE, the maching DNS cache entry will be\r | |
1129 | overwritten with the supplied parameter. If FALSE,\r | |
1130 | EFI_ACCESS_DENIED will be returned if the entry to\r | |
1131 | be added is already existed.\r | |
1132 | @param[in] DnsCacheEntry Pointer to DNS Cache entry.\r | |
1133 | \r | |
1134 | @retval EFI_SUCCESS The operation completed successfully.\r | |
1135 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
1136 | This is NULL.\r | |
1137 | DnsCacheEntry.HostName is NULL.\r | |
1138 | DnsCacheEntry.IpAddress is NULL.\r | |
1139 | DnsCacheEntry.Timeout is zero.\r | |
1140 | @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is\r | |
1141 | not TRUE.\r | |
1142 | @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.\r | |
99c048ef | 1143 | **/\r |
1144 | EFI_STATUS\r | |
1145 | EFIAPI\r | |
1146 | Dns6UpdateDnsCache (\r | |
1147 | IN EFI_DNS6_PROTOCOL *This,\r | |
1148 | IN BOOLEAN DeleteFlag,\r | |
1149 | IN BOOLEAN Override,\r | |
1150 | IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry\r | |
1151 | );\r | |
1152 | \r | |
1153 | /**\r | |
0f4e123f JW |
1154 | Polls for incoming data packets and processes outgoing data packets.\r |
1155 | \r | |
1156 | The Poll() function can be used by network drivers and applications to increase the\r | |
1157 | rate that data packets are moved between the communications device and the transmit\r | |
1158 | and receive queues.\r | |
1159 | \r | |
1160 | In some systems, the periodic timer event in the managed network driver may not poll\r | |
1161 | the underlying communications device fast enough to transmit and/or receive all data\r | |
1162 | packets without missing incoming packets or dropping outgoing packets. Drivers and\r | |
1163 | applications that are experiencing packet loss should try calling the Poll()\r | |
1164 | function more often.\r | |
1165 | \r | |
1166 | @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r | |
1167 | \r | |
1168 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
1169 | @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.\r | |
1170 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
1171 | @retval EFI_NO_MAPPING There is no source address is available for use.\r | |
1172 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
1173 | @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive\r | |
1174 | queue. Consider increasing the polling rate.\r | |
99c048ef | 1175 | **/\r |
1176 | EFI_STATUS\r | |
1177 | EFIAPI\r | |
1178 | Dns6Poll (\r | |
1179 | IN EFI_DNS6_PROTOCOL *This\r | |
1180 | );\r | |
1181 | \r | |
1182 | /**\r | |
0f4e123f JW |
1183 | Abort an asynchronous DNS operation, including translation between IP and Host, and\r |
1184 | general look up behavior.\r | |
1185 | \r | |
1186 | The Cancel() function is used to abort a pending resolution request. After calling\r | |
1187 | this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be\r | |
1188 | signaled. If the token is not in one of the queues, which usually means that the\r | |
1189 | asynchronous operation has completed, this function will not signal the token and\r | |
1190 | EFI_NOT_FOUND is returned.\r | |
1191 | \r | |
1192 | @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.\r | |
1193 | @param[in] Token Pointer to a token that has been issued by\r | |
1194 | EFI_DNS6_PROTOCOL.HostNameToIp (),\r | |
1195 | EFI_DNS6_PROTOCOL.IpToHostName() or\r | |
1196 | EFI_DNS6_PROTOCOL.GeneralLookup().\r | |
1197 | If NULL, all pending tokens are aborted.\r | |
1198 | \r | |
1199 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
1200 | @retval EFI_NOT_STARTED This EFI DNS6 Protocol instance has not been started.\r | |
1201 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
1202 | @retval EFI_NO_MAPPING There's no source address is available for use.\r | |
1203 | @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS\r | |
1204 | operation was not found in the transmit queue. It\r | |
1205 | was either completed or was not issued by\r | |
1206 | HostNameToIp(), IpToHostName() or GeneralLookup().\r | |
99c048ef | 1207 | **/\r |
1208 | EFI_STATUS\r | |
1209 | EFIAPI\r | |
1210 | Dns6Cancel (\r | |
1211 | IN EFI_DNS6_PROTOCOL *This,\r | |
1212 | IN EFI_DNS6_COMPLETION_TOKEN *Token\r | |
1213 | );\r | |
1214 | \r | |
1215 | #endif\r |