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, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 @par Revision Reference:
17 This Protocol is introduced in UEFI Specification 2.5
21 #ifndef __EFI_DNS6_PROTOCOL_H__
22 #define __EFI_DNS6_PROTOCOL_H__
24 #define EFI_DNS6_SERVICE_BINDING_PROTOCOL_GUID \
26 0x7f1647c8, 0xb76e, 0x44b2, {0xa5, 0x65, 0xf7, 0xf, 0xf1, 0x9c, 0xd1, 0x9e } \
29 #define EFI_DNS6_PROTOCOL_GUID \
31 0xca37bc1f, 0xa327, 0x4ae9, {0x82, 0x8a, 0x8c, 0x40, 0xd8, 0x50, 0x6a, 0x17 } \
34 typedef struct _EFI_DNS6_PROTOCOL EFI_DNS6_PROTOCOL
;
37 /// EFI_DNS6_CONFIG_DATA
41 /// If TRUE, enable DNS cache function for this DNS instance. If FALSE, all DNS query
42 /// will not lookup local DNS cache.
44 BOOLEAN EnableDnsCache
;
46 /// Use the protocol number defined in
47 /// http://www.iana.org/assignments/protocol-numbers. Beside TCP/UDP, Other protocol
48 /// is invalid value. An implementation can choose to support UDP, or both TCP and UDP.
52 /// The local IP address to use. Set to zero to let the underlying IPv6
53 /// driver choose a source address. If not zero it must be one of the
54 /// configured IP addresses in the underlying IPv6 driver.
56 EFI_IPv6_ADDRESS StationIp
;
58 /// Local port number. Set to zero to use the automatically assigned port number.
62 /// Count of the DNS servers. When used with GetModeData(),
63 /// this field is the count of originally configured servers when
64 /// Configure() was called for this instance. When used with
65 /// Configure() this is the count of caller-supplied servers. If the
66 /// DnsServerListCount is zero, the DNS server configuration
67 /// will be retrieved from DHCP server automatically.
69 UINT32 DnsServerCount
;
71 /// Pointer to DNS server list containing DnsServerListCount
72 /// entries or NULL if DnsServerListCount is 0. For Configure(),
73 /// this will be NULL when there are no caller supplied server addresses
74 /// and the DNS instance will retrieve DNS server from DHCP Server.
75 /// The provided DNS server list is recommended to be filled up in the sequence
76 /// of preference. When used with GetModeData(), the buffer containing the list
77 /// will be allocated by the driver implementing this protocol and must be
78 /// freed by the caller. When used with Configure(), the buffer
79 /// containing the list will be allocated and released by the caller.
81 EFI_IPv6_ADDRESS
*DnsServerList
;
83 /// Retry number if no response received after RetryInterval.
87 /// Minimum interval of retry is 2 second. If the retry interval is less than 2
88 /// seconds, then use the 2 seconds.
90 } EFI_DNS6_CONFIG_DATA
;
93 /// EFI_DNS6_CACHE_ENTRY
97 /// Host name. This should be interpreted as Unicode characters.
101 /// IP address of this host.
103 EFI_IPv6_ADDRESS
*IpAddress
;
105 /// Time in second unit that this entry will remain in DNS cache. A value of zero means
106 /// that this entry is permanent. A nonzero value will override the existing one if
107 /// this entry to be added is dynamic entry. Implementations may set its default
108 /// timeout value for the dynamically created DNS cache entry after one DNS resolve
111 } EFI_DNS6_CACHE_ENTRY
;
114 /// EFI_DNS6_MODE_DATA
118 /// The configuration data of this instance.
120 EFI_DNS6_CONFIG_DATA DnsConfigData
;
122 /// Number of configured DNS6 servers.
124 UINT32 DnsServerCount
;
126 /// Pointer to common list of addresses of all configured DNS server used by EFI_DNS6_PROTOCOL
127 /// instances. List will include DNS servers configured by this or any other EFI_DNS6_PROTOCOL
128 /// instance. The storage for this list is allocated by the driver publishing this protocol,
129 /// and must be freed by the caller.
131 EFI_IPv6_ADDRESS
*DnsServerList
;
133 /// Number of DNS Cache entries. The DNS Cache is shared among all DNS instances.
135 UINT32 DnsCacheCount
;
137 /// Pointer to a buffer containing DnsCacheCount DNS Cache
138 /// entry structures. The storage for thislist is allocated by the driver
139 /// publishing this protocol and must be freed by caller.
141 EFI_DNS6_CACHE_ENTRY
*DnsCacheList
;
142 } EFI_DNS6_MODE_DATA
;
145 /// DNS6_HOST_TO_ADDR_DATA
149 /// Number of the returned IP address.
153 /// Pointer to the all the returned IP address.
155 EFI_IPv6_ADDRESS
*IpList
;
156 } DNS6_HOST_TO_ADDR_DATA
;
159 /// DNS6_ADDR_TO_HOST_DATA
163 /// Pointer to the primary name for this host address. It's the caller's
164 /// responsibility to free the response memory.
167 } DNS6_ADDR_TO_HOST_DATA
;
170 /// DNS6_RESOURCE_RECORD
178 /// The Type Code of this RR.
182 /// The CLASS code of this RR.
186 /// 32 bit integer which specify the time interval that the resource record may be
187 /// cached before the source of the information should again be consulted. Zero means
188 /// this RR cannot be cached.
192 /// 16 big integer which specify the length of RData.
196 /// A string of octets that describe the resource, the format of this information
197 /// varies according to QType and QClass difference.
200 } DNS6_RESOURCE_RECORD
;
203 /// DNS6_GENERAL_LOOKUP_DATA
207 /// Number of returned matching RRs.
211 /// Pointer to the all the returned matching RRs. It's caller responsibility to free
212 /// the allocated memory to hold the returned RRs.
214 DNS6_RESOURCE_RECORD
*RRList
;
215 } DNS6_GENERAL_LOOKUP_DATA
;
218 /// EFI_DNS6_COMPLETION_TOKEN
222 /// This Event will be signaled after the Status field is updated by the EFI DNSv6
223 /// protocol driver. The type of Event must be EFI_NOTIFY_SIGNAL.
227 /// Will be set to one of the following values:
228 /// EFI_SUCCESS: The host name to address translation completed successfully.
229 /// EFI_NOT_FOUND: No matching Resource Record (RR) is found.
230 /// EFI_TIMEOUT: No DNS server reachable, or RetryCount was exhausted without
231 /// response from all specified DNS servers.
232 /// EFI_DEVICE_ERROR: An unexpected system or network error occurred.
233 /// EFI_NO_MEDIA: There was a media error.
237 /// The parameter configured through DNSv6.Configure() interface. Retry number if no
238 /// response received after RetryInterval.
242 /// The parameter configured through DNSv6.Configure() interface. Minimum interval of
243 /// retry is 2 seconds. If the retry interval is less than 2 seconds, then use the 2
246 UINT32 RetryInterval
;
248 /// DNSv6 completion token data
252 /// When the Token is used for host name to address translation, H2AData is a pointer
253 /// to the DNS6_HOST_TO_ADDR_DATA.
255 DNS6_HOST_TO_ADDR_DATA
*H2AData
;
257 /// When the Token is used for host address to host name translation, A2HData is a
258 /// pointer to the DNS6_ADDR_TO_HOST_DATA.
260 DNS6_ADDR_TO_HOST_DATA
*A2HData
;
262 /// When the Token is used for a general lookup function, GLookupDATA is a pointer to
263 /// the DNS6_GENERAL_LOOKUP_DATA.
265 DNS6_GENERAL_LOOKUP_DATA
*GLookupData
;
267 } EFI_DNS6_COMPLETION_TOKEN
;
270 Retrieve mode data of this DNS instance.
272 This function is used to retrieve DNS mode data for this DNS instance.
274 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
275 @param[out] DnsModeData Pointer to the caller-allocated storage for the
276 EFI_DNS6_MODE_DATA data.
278 @retval EFI_SUCCESS The operation completed successfully.
279 @retval EFI_NOT_STARTED When DnsConfigData is queried, no configuration data
280 is available because this instance has not been
282 @retval EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
283 @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.
287 (EFIAPI
* EFI_DNS6_GET_MODE_DATA
)(
288 IN EFI_DNS6_PROTOCOL
*This
,
289 OUT EFI_DNS6_MODE_DATA
*DnsModeData
293 Configure this DNS instance.
295 The Configure() function is used to set and change the configuration data for this
296 EFI DNSv6 Protocol driver instance. Reset the DNS instance if DnsConfigData is NULL.
298 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
299 @param[in] DnsConfigData Pointer to the configuration data structure. All associated
300 storage to be allocated and released by caller.
302 @retval EFI_SUCCESS The operation completed successfully.
303 @retval EFI_INVALID_PARAMTER This is NULL.
304 The StationIp address provided in DnsConfigData is not a valid unicast.
305 DnsServerList is NULL while DnsServerList Count is not ZERO.
306 DnsServerList Count is ZERO while DnsServerList is not NULL.
307 @retval EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be allocated.
308 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The
309 EFI DNSv6 Protocol instance is not configured.
310 @retval EFI_UNSUPPORTED The designated protocol is not supported.
311 @retval EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To
312 reconfigure the instance the caller must call Configure() with
313 NULL first to return driver to unconfigured state.
317 (EFIAPI
* EFI_DNS6_CONFIGURE
)(
318 IN EFI_DNS6_PROTOCOL
*This
,
319 IN EFI_DNS6_CONFIG_DATA
*DnsConfigData
323 Host name to host address translation.
325 The HostNameToIp () function is used to translate the host name to host IP address. A
326 type A query is used to get the one or more IPv6 addresses for this host.
328 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
329 @param[in] Hostname Host name.
330 @param[in] Token Point to the completion token to translate host name
333 @retval EFI_SUCCESS The operation completed successfully.
334 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
338 HostName is NULL or buffer contained unsupported characters.
339 @retval EFI_NO_MAPPING There's no source address is available for use.
340 @retval EFI_ALREADY_STARTED This Token is being used in another DNS session.
341 @retval EFI_NOT_STARTED This instance has not been started.
342 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
346 (EFIAPI
*EFI_DNS6_HOST_NAME_TO_IP
) (
347 IN EFI_DNS6_PROTOCOL
*This
,
349 IN EFI_DNS6_COMPLETION_TOKEN
*Token
353 Host address to host name translation.
355 The IpToHostName () function is used to translate the host address to host name. A
356 type PTR query is used to get the primary name of the host. Implementation can choose
357 to support this function or not.
359 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
360 @param[in] IpAddress Ip Address.
361 @param[in] Token Point to the completion token to translate host
362 address to host name.
364 @retval EFI_SUCCESS The operation completed successfully.
365 @retval EFI_UNSUPPORTED This function is not supported.
366 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
370 IpAddress is not valid IP address.
371 @retval EFI_NO_MAPPING There's no source address is available for use.
372 @retval EFI_NOT_STARTED This instance has not been started.
373 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
377 (EFIAPI
*EFI_DNS6_IP_TO_HOST_NAME
) (
378 IN EFI_DNS6_PROTOCOL
*This
,
379 IN EFI_IPv6_ADDRESS IpAddress
,
380 IN EFI_DNS6_COMPLETION_TOKEN
*Token
384 This function provides capability to retrieve arbitrary information from the DNS
387 This GeneralLookup() function retrieves arbitrary information from the DNS. The caller
388 supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All
389 RR content (e.g., TTL) was returned. The caller need parse the returned RR to get
390 required information. The function is optional. Implementation can choose to support
393 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
394 @param[in] QName Pointer to Query Name.
395 @param[in] QType Query Type.
396 @param[in] QClass Query Name.
397 @param[in] Token Point to the completion token to retrieve arbitrary
400 @retval EFI_SUCCESS The operation completed successfully.
401 @retval EFI_UNSUPPORTED This function is not supported. Or the requested
402 QType is not supported
403 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
408 @retval EFI_NO_MAPPING There's no source address is available for use.
409 @retval EFI_NOT_STARTED This instance has not been started.
410 @retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
414 (EFIAPI
*EFI_DNS6_GENERAL_LOOKUP
) (
415 IN EFI_DNS6_PROTOCOL
*This
,
419 IN EFI_DNS6_COMPLETION_TOKEN
*Token
423 This function is to update the DNS Cache.
425 The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache
426 can be normally dynamically updated after the DNS resolve succeeds. This function
427 provided capability to manually add/delete/modify the DNS cache.
429 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
430 @param[in] DeleteFlag If FALSE, this function is to add one entry to the
431 DNS Cahce. If TRUE, this function will delete
432 matching DNS Cache entry.
433 @param[in] Override If TRUE, the maching DNS cache entry will be
434 overwritten with the supplied parameter. If FALSE,
435 EFI_ACCESS_DENIED will be returned if the entry to
436 be added is already existed.
437 @param[in] DnsCacheEntry Pointer to DNS Cache entry.
439 @retval EFI_SUCCESS The operation completed successfully.
440 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
442 DnsCacheEntry.HostName is NULL.
443 DnsCacheEntry.IpAddress is NULL.
444 DnsCacheEntry.Timeout is zero.
445 @retval EFI_ACCESS_DENIED The DNS cache entry already exists and Override is
447 @retval EFI_OUT_OF_RESOURCE Failed to allocate needed resources.
451 (EFIAPI
*EFI_DNS6_UPDATE_DNS_CACHE
) (
452 IN EFI_DNS6_PROTOCOL
*This
,
453 IN BOOLEAN DeleteFlag
,
455 IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry
459 Polls for incoming data packets and processes outgoing data packets.
461 The Poll() function can be used by network drivers and applications to increase the
462 rate that data packets are moved between the communications device and the transmit
465 In some systems, the periodic timer event in the managed network driver may not poll
466 the underlying communications device fast enough to transmit and/or receive all data
467 packets without missing incoming packets or dropping outgoing packets. Drivers and
468 applications that are experiencing packet loss should try calling the Poll()
471 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
473 @retval EFI_SUCCESS Incoming or outgoing data was processed.
474 @retval EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
475 @retval EFI_INVALID_PARAMETER This is NULL.
476 @retval EFI_NO_MAPPING There is no source address is available for use.
477 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
478 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive
479 queue. Consider increasing the polling rate.
483 (EFIAPI
*EFI_DNS6_POLL
) (
484 IN EFI_DNS6_PROTOCOL
*This
488 Abort an asynchronous DNS operation, including translation between IP and Host, and
489 general look up behavior.
491 The Cancel() function is used to abort a pending resolution request. After calling
492 this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be
493 signaled. If the token is not in one of the queues, which usually means that the
494 asynchronous operation has completed, this function will not signal the token and
495 EFI_NOT_FOUND is returned.
497 @param[in] This Pointer to EFI_DNS6_PROTOCOL instance.
498 @param[in] Token Pointer to a token that has been issued by
499 EFI_DNS6_PROTOCOL.HostNameToIp (),
500 EFI_DNS6_PROTOCOL.IpToHostName() or
501 EFI_DNS6_PROTOCOL.GeneralLookup().
502 If NULL, all pending tokens are aborted.
504 @retval EFI_SUCCESS Incoming or outgoing data was processed.
505 @retval EFI_NOT_STARTED This EFI DNS6 Protocol instance has not been started.
506 @retval EFI_INVALID_PARAMETER This is NULL.
507 @retval EFI_NO_MAPPING There's no source address is available for use.
508 @retval EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS
509 operation was not found in the transmit queue. It
510 was either completed or was not issued by
511 HostNameToIp(), IpToHostName() or GeneralLookup().
515 (EFIAPI
*EFI_DNS6_CANCEL
) (
516 IN EFI_DNS6_PROTOCOL
*This
,
517 IN EFI_DNS6_COMPLETION_TOKEN
*Token
521 /// The EFI_DNS6_PROTOCOL provides the function to get the host name and address
522 /// mapping, also provide pass through interface to retrieve arbitrary information from
525 struct _EFI_DNS6_PROTOCOL
{
526 EFI_DNS6_GET_MODE_DATA GetModeData
;
527 EFI_DNS6_CONFIGURE Configure
;
528 EFI_DNS6_HOST_NAME_TO_IP HostNameToIp
;
529 EFI_DNS6_IP_TO_HOST_NAME IpToHostName
;
530 EFI_DNS6_GENERAL_LOOKUP GeneralLookUp
;
531 EFI_DNS6_UPDATE_DNS_CACHE UpdateDnsCache
;
533 EFI_DNS6_CANCEL Cancel
;
536 extern EFI_GUID gEfiDns6ServiceBindingProtocolGuid
;
537 extern EFI_GUID gEfiDns6ProtocolGuid
;