2 This file defines the EFI DNSv6 (Domain Name Service version 6) Protocol. It is split
3 into the following two main sections:
4 DNSv6 Service Binding Protocol (DNSv6SB)
7 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
10 @par Revision Reference:
11 This Protocol is introduced in UEFI Specification 2.5
15 #ifndef __EFI_DNS6_PROTOCOL_H__
16 #define __EFI_DNS6_PROTOCOL_H__
18 #define EFI_DNS6_SERVICE_BINDING_PROTOCOL_GUID \
20 0x7f1647c8, 0xb76e, 0x44b2, {0xa5, 0x65, 0xf7, 0xf, 0xf1, 0x9c, 0xd1, 0x9e } \
23 #define EFI_DNS6_PROTOCOL_GUID \
25 0xca37bc1f, 0xa327, 0x4ae9, {0x82, 0x8a, 0x8c, 0x40, 0xd8, 0x50, 0x6a, 0x17 } \
28 typedef struct _EFI_DNS6_PROTOCOL EFI_DNS6_PROTOCOL
;
31 /// EFI_DNS6_CONFIG_DATA
35 /// If TRUE, enable DNS cache function for this DNS instance. If FALSE, all DNS query
36 /// will not lookup local DNS cache.
38 BOOLEAN EnableDnsCache
;
40 /// Use the protocol number defined in
41 /// http://www.iana.org/assignments/protocol-numbers. Beside TCP/UDP, Other protocol
42 /// is invalid value. An implementation can choose to support UDP, or both TCP and UDP.
46 /// The local IP address to use. Set to zero to let the underlying IPv6
47 /// driver choose a source address. If not zero it must be one of the
48 /// configured IP addresses in the underlying IPv6 driver.
50 EFI_IPv6_ADDRESS StationIp
;
52 /// Local port number. Set to zero to use the automatically assigned port number.
56 /// Count of the DNS servers. When used with GetModeData(),
57 /// this field is the count of originally configured servers when
58 /// Configure() was called for this instance. When used with
59 /// Configure() this is the count of caller-supplied servers. If the
60 /// DnsServerListCount is zero, the DNS server configuration
61 /// will be retrieved from DHCP server automatically.
63 UINT32 DnsServerCount
;
65 /// Pointer to DNS server list containing DnsServerListCount
66 /// entries or NULL if DnsServerListCount is 0. For Configure(),
67 /// this will be NULL when there are no caller supplied server addresses
68 /// and the DNS instance will retrieve DNS server from DHCP Server.
69 /// The provided DNS server list is recommended to be filled up in the sequence
70 /// of preference. When used with GetModeData(), the buffer containing the list
71 /// will be allocated by the driver implementing this protocol and must be
72 /// freed by the caller. When used with Configure(), the buffer
73 /// containing the list will be allocated and released by the caller.
75 EFI_IPv6_ADDRESS
*DnsServerList
;
77 /// Retry number if no response received after RetryInterval.
81 /// Minimum interval of retry is 2 second. If the retry interval is less than 2
82 /// seconds, then use the 2 seconds.
84 } EFI_DNS6_CONFIG_DATA
;
87 /// EFI_DNS6_CACHE_ENTRY
91 /// Host name. This should be interpreted as Unicode characters.
95 /// IP address of this host.
97 EFI_IPv6_ADDRESS
*IpAddress
;
99 /// Time in second unit that this entry will remain in DNS cache. A value of zero means
100 /// that this entry is permanent. A nonzero value will override the existing one if
101 /// this entry to be added is dynamic entry. Implementations may set its default
102 /// timeout value for the dynamically created DNS cache entry after one DNS resolve
105 } EFI_DNS6_CACHE_ENTRY
;
108 /// EFI_DNS6_MODE_DATA
112 /// The configuration data of this instance.
114 EFI_DNS6_CONFIG_DATA DnsConfigData
;
116 /// Number of configured DNS6 servers.
118 UINT32 DnsServerCount
;
120 /// Pointer to common list of addresses of all configured DNS server used by EFI_DNS6_PROTOCOL
121 /// instances. List will include DNS servers configured by this or any other EFI_DNS6_PROTOCOL
122 /// instance. The storage for this list is allocated by the driver publishing this protocol,
123 /// and must be freed by the caller.
125 EFI_IPv6_ADDRESS
*DnsServerList
;
127 /// Number of DNS Cache entries. The DNS Cache is shared among all DNS instances.
129 UINT32 DnsCacheCount
;
131 /// Pointer to a buffer containing DnsCacheCount DNS Cache
132 /// entry structures. The storage for thislist is allocated by the driver
133 /// publishing this protocol and must be freed by caller.
135 EFI_DNS6_CACHE_ENTRY
*DnsCacheList
;
136 } EFI_DNS6_MODE_DATA
;
139 /// DNS6_HOST_TO_ADDR_DATA
143 /// Number of the returned IP address.
147 /// Pointer to the all the returned IP address.
149 EFI_IPv6_ADDRESS
*IpList
;
150 } DNS6_HOST_TO_ADDR_DATA
;
153 /// DNS6_ADDR_TO_HOST_DATA
157 /// Pointer to the primary name for this host address. It's the caller's
158 /// responsibility to free the response memory.
161 } DNS6_ADDR_TO_HOST_DATA
;
164 /// DNS6_RESOURCE_RECORD
172 /// The Type Code of this RR.
176 /// The CLASS code of this RR.
180 /// 32 bit integer which specify the time interval that the resource record may be
181 /// cached before the source of the information should again be consulted. Zero means
182 /// this RR cannot be cached.
186 /// 16 big integer which specify the length of RData.
190 /// A string of octets that describe the resource, the format of this information
191 /// varies according to QType and QClass difference.
194 } DNS6_RESOURCE_RECORD
;
197 /// DNS6_GENERAL_LOOKUP_DATA
201 /// Number of returned matching RRs.
205 /// Pointer to the all the returned matching RRs. It's caller responsibility to free
206 /// the allocated memory to hold the returned RRs.
208 DNS6_RESOURCE_RECORD
*RRList
;
209 } DNS6_GENERAL_LOOKUP_DATA
;
212 /// EFI_DNS6_COMPLETION_TOKEN
216 /// This Event will be signaled after the Status field is updated by the EFI DNSv6
217 /// protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
221 /// Will be set to one of the following values:
222 /// EFI_SUCCESS: The host name to address translation completed successfully.
223 /// EFI_NOT_FOUND: No matching Resource Record (RR) is found.
224 /// EFI_TIMEOUT: No DNS server reachable, or RetryCount was exhausted without
225 /// response from all specified DNS servers.
226 /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.
227 /// EFI_NO_MEDIA: There was a media error.
231 /// The parameter configured through DNSv6.Configure() interface. Retry number if no
232 /// response received after RetryInterval.
236 /// The parameter configured through DNSv6.Configure() interface. Minimum interval of
237 /// retry is 2 seconds. If the retry interval is less than 2 seconds, then use the 2
240 UINT32 RetryInterval
;
242 /// DNSv6 completion token data
246 /// When the Token is used for host name to address translation, H2AData is a pointer
247 /// to the DNS6_HOST_TO_ADDR_DATA.
249 DNS6_HOST_TO_ADDR_DATA
*H2AData
;
251 /// When the Token is used for host address to host name translation, A2HData is a
252 /// pointer to the DNS6_ADDR_TO_HOST_DATA.
254 DNS6_ADDR_TO_HOST_DATA
*A2HData
;
256 /// When the Token is used for a general lookup function, GLookupDATA is a pointer to
257 /// the DNS6_GENERAL_LOOKUP_DATA.
259 DNS6_GENERAL_LOOKUP_DATA
*GLookupData
;
261 } EFI_DNS6_COMPLETION_TOKEN
;
264 Retrieve mode data of this DNS instance.
266 This function is used to retrieve DNS mode data for this DNS instance.
268 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
269 @param[out] DnsModeData Pointer to the caller-allocated storage for the
270 EFI_DNS6_MODE_DATA data.
272 @retval EFI_SUCCESS The operation completed successfully.
273 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data
274 is available because this instance has not been
276 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
277 @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.
281 (EFIAPI
* EFI_DNS6_GET_MODE_DATA
)(
282 IN EFI_DNS6_PROTOCOL
*This
,
283 OUT EFI_DNS6_MODE_DATA
*DnsModeData
287 Configure this DNS instance.
289 The Configure() function is used to set and change the configuration data for this
290 EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.
292 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
293 @param[in] DnsConfigData Pointer to the configuration data structure. All associated
294 storage to be allocated and released by caller.
296 @retval EFI_SUCCESS The operation completed successfully.
297 @retval EFI_INVALID_PARAMETER This is NULL.
298 The StationIp address provided in DnsConfigData is not zero and not a valid unicast.
299 DnsServerList is NULL while DnsServerList Count is not ZERO.
300 DnsServerList Count is ZERO while DnsServerList is not NULL.
301 @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be allocated.
302 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The
303 EFI DNSv6 Protocol instance is not configured.
304 @retval EFI_UNSUPPORTED The designated protocol is not supported.
305 @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
306 reconfigure the instance the caller must call Configure() with
307 NULL first to return driver to unconfigured state.
311 (EFIAPI
* EFI_DNS6_CONFIGURE
)(
312 IN EFI_DNS6_PROTOCOL
*This
,
313 IN EFI_DNS6_CONFIG_DATA
*DnsConfigData
317 Host name to host address translation.
319 The HostNameToIp () function is used to translate the host name to host IP address. A
320 type AAAA query is used to get the one or more IPv6 addresses for this host.
322 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
323 @param[in] HostName Host name.
324 @param[in] Token Point to the completion token to translate host name
327 @retval EFI_SUCCESS The operation completed successfully.
328 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
332 HostName is NULL or buffer contained unsupported characters.
333 @retval EFI_NO_MAPPING There's no source address is available for use.
334 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.
335 @retval EFI_NOT_STARTED This instance has not been started.
336 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
340 (EFIAPI
*EFI_DNS6_HOST_NAME_TO_IP
) (
341 IN EFI_DNS6_PROTOCOL
*This
,
343 IN EFI_DNS6_COMPLETION_TOKEN
*Token
347 Host address to host name translation.
349 The IpToHostName () function is used to translate the host address to host name. A
350 type PTR query is used to get the primary name of the host. Implementation can choose
351 to support this function or not.
353 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
354 @param[in] IpAddress Ip Address.
355 @param[in] Token Point to the completion token to translate host
356 address to host name.
358 @retval EFI_SUCCESS The operation completed successfully.
359 @retval EFI_UNSUPPORTED This function is not supported.
360 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
364 IpAddress is not valid IP address.
365 @retval EFI_NO_MAPPING There's no source address is available for use.
366 @retval EFI_NOT_STARTED This instance has not been started.
367 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
371 (EFIAPI
*EFI_DNS6_IP_TO_HOST_NAME
) (
372 IN EFI_DNS6_PROTOCOL
*This
,
373 IN EFI_IPv6_ADDRESS IpAddress
,
374 IN EFI_DNS6_COMPLETION_TOKEN
*Token
378 This function provides capability to retrieve arbitrary information from the DNS
381 This GeneralLookup() function retrieves arbitrary information from the DNS. The caller
382 supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All
383 RR content (e.g., TTL) was returned. The caller need parse the returned RR to get
384 required information. The function is optional. Implementation can choose to support
387 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
388 @param[in] QName Pointer to Query Name.
389 @param[in] QType Query Type.
390 @param[in] QClass Query Name.
391 @param[in] Token Point to the completion token to retrieve arbitrary
394 @retval EFI_SUCCESS The operation completed successfully.
395 @retval EFI_UNSUPPORTED This function is not supported. Or the requested
396 QType is not supported
397 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
402 @retval EFI_NO_MAPPING There's no source address is available for use.
403 @retval EFI_NOT_STARTED This instance has not been started.
404 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
408 (EFIAPI
*EFI_DNS6_GENERAL_LOOKUP
) (
409 IN EFI_DNS6_PROTOCOL
*This
,
413 IN EFI_DNS6_COMPLETION_TOKEN
*Token
417 This function is to update the DNS Cache.
419 The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache
420 can be normally dynamically updated after the DNS resolve succeeds. This function
421 provided capability to manually add/delete/modify the DNS cache.
423 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
424 @param[in] DeleteFlag If FALSE, this function is to add one entry to the
425 DNS Cahce. If TRUE, this function will delete
426 matching DNS Cache entry.
427 @param[in] Override If TRUE, the maching DNS cache entry will be
428 overwritten with the supplied parameter. If FALSE,
429 EFI_ACCESS_DENIED will be returned if the entry to
430 be added is already existed.
431 @param[in] DnsCacheEntry Pointer to DNS Cache entry.
433 @retval EFI_SUCCESS The operation completed successfully.
434 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
436 DnsCacheEntry.HostName is NULL.
437 DnsCacheEntry.IpAddress is NULL.
438 DnsCacheEntry.Timeout is zero.
439 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is
441 @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.
445 (EFIAPI
*EFI_DNS6_UPDATE_DNS_CACHE
) (
446 IN EFI_DNS6_PROTOCOL
*This
,
447 IN BOOLEAN DeleteFlag
,
449 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
453 Polls for incoming data packets and processes outgoing data packets.
455 The Poll() function can be used by network drivers and applications to increase the
456 rate that data packets are moved between the communications device and the transmit
459 In some systems, the periodic timer event in the managed network driver may not poll
460 the underlying communications device fast enough to transmit and/or receive all data
461 packets without missing incoming packets or dropping outgoing packets. Drivers and
462 applications that are experiencing packet loss should try calling the Poll()
465 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
467 @retval EFI_SUCCESS Incoming or outgoing data was processed.
468 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
469 @retval EFI_INVALID_PARAMETER This is NULL.
470 @retval EFI_NO_MAPPING There is no source address is available for use.
471 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
472 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive
473 queue. Consider increasing the polling rate.
477 (EFIAPI
*EFI_DNS6_POLL
) (
478 IN EFI_DNS6_PROTOCOL
*This
482 Abort an asynchronous DNS operation, including translation between IP and Host, and
483 general look up behavior.
485 The Cancel() function is used to abort a pending resolution request. After calling
486 this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be
487 signaled. If the token is not in one of the queues, which usually means that the
488 asynchronous operation has completed, this function will not signal the token and
489 EFI_NOT_FOUND is returned.
491 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
492 @param[in] Token Pointer to a token that has been issued by
493 EFI_DNS6_PROTOCOL.HostNameToIp (),
494 EFI_DNS6_PROTOCOL.IpToHostName() or
495 EFI_DNS6_PROTOCOL.GeneralLookup().
496 If NULL, all pending tokens are aborted.
498 @retval EFI_SUCCESS Incoming or outgoing data was processed.
499 @retval EFI_NOT_STARTED This EFI DNS6 Protocol instance has not been started.
500 @retval EFI_INVALID_PARAMETER This is NULL.
501 @retval EFI_NO_MAPPING There's no source address is available for use.
502 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS
503 operation was not found in the transmit queue. It
504 was either completed or was not issued by
505 HostNameToIp(), IpToHostName() or GeneralLookup().
509 (EFIAPI
*EFI_DNS6_CANCEL
) (
510 IN EFI_DNS6_PROTOCOL
*This
,
511 IN EFI_DNS6_COMPLETION_TOKEN
*Token
515 /// The EFI_DNS6_PROTOCOL provides the function to get the host name and address
516 /// mapping, also provide pass through interface to retrieve arbitrary information from
519 struct _EFI_DNS6_PROTOCOL
{
520 EFI_DNS6_GET_MODE_DATA GetModeData
;
521 EFI_DNS6_CONFIGURE Configure
;
522 EFI_DNS6_HOST_NAME_TO_IP HostNameToIp
;
523 EFI_DNS6_IP_TO_HOST_NAME IpToHostName
;
524 EFI_DNS6_GENERAL_LOOKUP GeneralLookUp
;
525 EFI_DNS6_UPDATE_DNS_CACHE UpdateDnsCache
;
527 EFI_DNS6_CANCEL Cancel
;
530 extern EFI_GUID gEfiDns6ServiceBindingProtocolGuid
;
531 extern EFI_GUID gEfiDns6ProtocolGuid
;