TianoCore EDK2 master
|
#include "DnsImpl.h"
Go to the source code of this file.
DnsDxe support functions implementation.
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DnsImpl.c.
EFI_STATUS EFIAPI AddDns4ServerIp | ( | IN LIST_ENTRY * | Dns4ServerList, |
IN EFI_IPv4_ADDRESS | ServerIp | ||
) |
Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server.
Dns4ServerList | Common list of addresses of all configured DNSv4 server. |
ServerIp | DNS server Ip. |
EFI_SUCCESS | Add Dns4 ServerIp to common list successfully. |
Others | Failed to add Dns4 ServerIp to common list. |
EFI_STATUS EFIAPI AddDns6ServerIp | ( | IN LIST_ENTRY * | Dns6ServerList, |
IN EFI_IPv6_ADDRESS | ServerIp | ||
) |
Add Dns6 ServerIp to common list of addresses of all configured DNSv6 server.
Dns6ServerList | Common list of addresses of all configured DNSv6 server. |
ServerIp | DNS server Ip. |
EFI_SUCCESS | Add Dns6 ServerIp to common list successfully. |
Others | Failed to add Dns6 ServerIp to common list. |
EFI_STATUS ConstructDNSQuery | ( | IN DNS_INSTANCE * | Instance, |
IN CHAR8 * | QueryName, | ||
IN UINT16 | Type, | ||
IN UINT16 | Class, | ||
OUT NET_BUF ** | Packet | ||
) |
EFI_STATUS EFIAPI Dns4CancelTokens | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID *Arg | OPTIONAL | ||
) |
This function cancel the token specified by Arg in the Map.
[in] | Map | Pointer to the NET_MAP. |
[in] | Item | Pointer to the NET_MAP_ITEM. |
[in] | Arg | Pointer to the token to be cancelled. If NULL, all the tokens in this Map will be cancelled. This parameter is optional and may be NULL. |
EFI_SUCCESS | The token is cancelled if Arg is NULL, or the token is not the same as that in the Item, if Arg is not NULL. |
EFI_ABORTED | Arg is not NULL, and the token specified by Arg is cancelled. |
VOID Dns4CleanConfigure | ( | IN OUT EFI_DNS4_CONFIG_DATA * | Config | ) |
EFI_STATUS Dns4ConfigUdp | ( | IN DNS_INSTANCE * | Instance, |
IN UDP_IO * | UdpIo | ||
) |
EFI_STATUS Dns4CopyConfigure | ( | OUT EFI_DNS4_CONFIG_DATA * | Dst, |
IN EFI_DNS4_CONFIG_DATA * | Src | ||
) |
Allocate memory for configure parameter such as timeout value for Dst, then copy the configure parameter from Src to Dst.
[out] | Dst | The destination DHCP configure data. |
[in] | Src | The source DHCP configure data. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
EFI_SUCCESS | The configure is copied. |
BOOLEAN Dns4GetMapping | ( | IN DNS_INSTANCE * | Instance, |
IN UDP_IO * | UdpIo, | ||
IN EFI_UDP4_CONFIG_DATA * | UdpCfgData | ||
) |
Poll the UDP to get the IP4 default address, which may be retrieved by DHCP.
The default time out value is 5 seconds. If IP has retrieved the default address, the UDP is reconfigured.
Instance | The DNS instance |
UdpIo | The UDP_IO to poll |
UdpCfgData | The UDP configure data to reconfigure the UDP_IO |
TRUE | The default address is retrieved and UDP is reconfigured. |
FALSE | Some error occurred. |
EFI_STATUS Dns4InstanceCancelToken | ( | IN DNS_INSTANCE * | Instance, |
IN EFI_DNS4_COMPLETION_TOKEN * | Token | ||
) |
Cancel DNS4 tokens from the DNS4 instance.
[in] | Instance | Pointer to the DNS instance context data. |
[in] | Token | Pointer to the token to be canceled. If NULL, all tokens in this instance will be cancelled. This parameter is optional and may be NULL. |
EFI_SUCCESS | The Token is cancelled. |
EFI_NOT_FOUND | The Token is not found. |
EFI_STATUS Dns4RemoveTokenEntry | ( | IN NET_MAP * | TokenMap, |
IN DNS4_TOKEN_ENTRY * | TokenEntry | ||
) |
EFI_STATUS EFIAPI Dns6CancelTokens | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID *Arg | OPTIONAL | ||
) |
This function cancel the token specified by Arg in the Map.
[in] | Map | Pointer to the NET_MAP. |
[in] | Item | Pointer to the NET_MAP_ITEM. |
[in] | Arg | Pointer to the token to be cancelled. If NULL, all the tokens in this Map will be cancelled. This parameter is optional and may be NULL. |
EFI_SUCCESS | The token is cancelled if Arg is NULL, or the token is not the same as that in the Item, if Arg is not NULL. |
EFI_ABORTED | Arg is not NULL, and the token specified by Arg is cancelled. |
VOID Dns6CleanConfigure | ( | IN OUT EFI_DNS6_CONFIG_DATA * | Config | ) |
EFI_STATUS Dns6ConfigUdp | ( | IN DNS_INSTANCE * | Instance, |
IN UDP_IO * | UdpIo | ||
) |
EFI_STATUS Dns6CopyConfigure | ( | OUT EFI_DNS6_CONFIG_DATA * | Dst, |
IN EFI_DNS6_CONFIG_DATA * | Src | ||
) |
Allocate memory for configure parameter such as timeout value for Dst, then copy the configure parameter from Src to Dst.
[out] | Dst | The destination DHCP configure data. |
[in] | Src | The source DHCP configure data. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
EFI_SUCCESS | The configure is copied. |
BOOLEAN Dns6GetMapping | ( | IN DNS_INSTANCE * | Instance, |
IN UDP_IO * | UdpIo, | ||
IN EFI_UDP6_CONFIG_DATA * | UdpCfgData | ||
) |
Configure the opened Udp6 instance until the corresponding Ip6 instance has been configured.
Instance | The DNS instance |
UdpIo | The UDP_IO to poll |
UdpCfgData | The UDP configure data to reconfigure the UDP_IO |
TRUE | Configure the Udp6 instance successfully. |
FALSE | Some error occurred. |
EFI_STATUS Dns6InstanceCancelToken | ( | IN DNS_INSTANCE * | Instance, |
IN EFI_DNS6_COMPLETION_TOKEN * | Token | ||
) |
Cancel DNS6 tokens from the DNS6 instance.
[in] | Instance | Pointer to the DNS instance context data. |
[in] | Token | Pointer to the token to be canceled. If NULL, all tokens in this instance will be cancelled. This parameter is optional and may be NULL. |
EFI_SUCCESS | The Token is cancelled. |
EFI_NOT_FOUND | The Token is not found. |
EFI_STATUS Dns6RemoveTokenEntry | ( | IN NET_MAP * | TokenMap, |
IN DNS6_TOKEN_ENTRY * | TokenEntry | ||
) |
VOID EFIAPI DnsDummyExtFree | ( | IN VOID * | Arg | ) |
VOID EFIAPI DnsOnPacketReceived | ( | NET_BUF * | Packet, |
UDP_END_POINT * | EndPoint, | ||
EFI_STATUS | IoStatus, | ||
VOID * | Context | ||
) |
VOID EFIAPI DnsOnPacketSent | ( | NET_BUF * | Packet, |
UDP_END_POINT * | EndPoint, | ||
EFI_STATUS | IoStatus, | ||
VOID * | Context | ||
) |
EFI_STATUS DnsRetransmit | ( | IN DNS_INSTANCE * | Instance, |
IN NET_BUF * | Packet | ||
) |
EFI_STATUS DoDnsQuery | ( | IN DNS_INSTANCE * | Instance, |
IN NET_BUF * | Packet | ||
) |
EFI_STATUS EFIAPI GetDns4TokenEntry | ( | IN NET_MAP * | TokensMap, |
IN EFI_DNS4_COMPLETION_TOKEN * | Token, | ||
OUT DNS4_TOKEN_ENTRY ** | TokenEntry | ||
) |
Get the TokenEntry from the TokensMap.
[in] | TokensMap | All DNSv4 Token entrys |
[in] | Token | Pointer to the token to be get. |
[out] | TokenEntry | Pointer to TokenEntry corresponding Token. |
EFI_SUCCESS | Get the TokenEntry from the TokensMap successfully. |
EFI_NOT_FOUND | TokenEntry is not found in TokenMap. |
EFI_STATUS EFIAPI GetDns6TokenEntry | ( | IN NET_MAP * | TokensMap, |
IN EFI_DNS6_COMPLETION_TOKEN * | Token, | ||
OUT DNS6_TOKEN_ENTRY ** | TokenEntry | ||
) |
Get the TokenEntry from the TokensMap.
[in] | TokensMap | All DNSv6 Token entrys |
[in] | Token | Pointer to the token to be get. |
[out] | TokenEntry | Pointer to TokenEntry corresponding Token. |
EFI_SUCCESS | Get the TokenEntry from the TokensMap successfully. |
EFI_NOT_FOUND | TokenEntry is not found in TokenMap. |
BOOLEAN IsValidDnsResponse | ( | IN NET_MAP * | TokensMap, |
IN UINT16 | Identification, | ||
IN UINT16 | Type, | ||
IN UINT16 | Class, | ||
OUT NET_MAP_ITEM ** | Item | ||
) |
Find out whether the response is valid or invalid.
TokensMap | All DNS transmittal Tokens entry. |
Identification | Identification for queried packet. |
Type | Type for queried packet. |
Class | Class for queried packet. |
Item | Return corresponding Token entry. |
TRUE | The response is valid. |
FALSE | The response is invalid. |
EFI_STATUS ParseDnsResponse | ( | IN OUT DNS_INSTANCE * | Instance, |
IN UINT8 * | RxString, | ||
IN UINT32 | Length, | ||
OUT BOOLEAN * | Completed | ||
) |
Parse Dns Response.
Instance | The DNS instance |
RxString | Received buffer. |
Length | Received buffer length. |
Completed | Flag to indicate that Dns response is valid. |
EFI_SUCCESS | Parse Dns Response successfully. |
Others | Failed to parse Dns Response. |
EFI_STATUS EFIAPI UpdateDns4Cache | ( | IN LIST_ENTRY * | Dns4CacheList, |
IN BOOLEAN | DeleteFlag, | ||
IN BOOLEAN | Override, | ||
IN EFI_DNS4_CACHE_ENTRY | DnsCacheEntry | ||
) |
Update Dns4 cache to shared list of caches of all DNSv4 instances.
Dns4CacheList | All Dns4 cache list. |
DeleteFlag | If FALSE, this function is to add one entry to the DNS Cache. If TRUE, this function will delete matching DNS Cache entry. |
Override | If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter. If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists. |
DnsCacheEntry | Entry Pointer to DNS Cache entry. |
EFI_SUCCESS | Update Dns4 cache successfully. |
Others | Failed to update Dns4 cache. |
EFI_STATUS EFIAPI UpdateDns6Cache | ( | IN LIST_ENTRY * | Dns6CacheList, |
IN BOOLEAN | DeleteFlag, | ||
IN BOOLEAN | Override, | ||
IN EFI_DNS6_CACHE_ENTRY | DnsCacheEntry | ||
) |
Update Dns6 cache to shared list of caches of all DNSv6 instances.
Dns6CacheList | All Dns6 cache list. |
DeleteFlag | If FALSE, this function is to add one entry to the DNS Cache. If TRUE, this function will delete matching DNS Cache entry. |
Override | If TRUE, the matching DNS cache entry will be overwritten with the supplied parameter. If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already exists. |
DnsCacheEntry | Entry Pointer to DNS Cache entry. |
EFI_SUCCESS | Update Dns6 cache successfully. |
Others | Failed to update Dns6 cache. |