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