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