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