22 #if IS_USED(MODULE_HOSTS)
25 #if IS_USED(MODULE_SOCK_DNS) || IS_USED(MODULE_SOCK_DNS_MOCK)
28 #if IS_USED(MODULE_SOCK_DODTLS)
31 #if IS_USED(MODULE_GCOAP_DNS)
43 #define DNS_TYPE_A (1)
44 #define DNS_TYPE_AAAA (28)
45 #define DNS_CLASS_IN (1)
52 #define RR_TYPE_LENGTH (2U)
53 #define RR_CLASS_LENGTH (2U)
54 #define RR_TTL_LENGTH (4U)
55 #define RR_RDLENGTH_LENGTH (2U)
80 static inline int dns_query(
const char *domain_name,
void *addr_out,
int family)
88 if (!
IS_USED(MODULE_IPV4_ADDR)) {
91 else if (!
IS_USED(MODULE_IPV6_ADDR)) {
96 #if IS_USED(MODULE_HOSTS)
101 #if IS_USED(MODULE_GCOAP_DNS)
106 #if IS_USED(MODULE_SOCK_DODTLS)
111 #if IS_USED(MODULE_SOCK_DNS) || IS_USED(MODULE_SOCK_DNS_MOCK)
Global UNIX address family definitions.
DNS over DTLS sock definitions.
#define ENOTSUP
Not supported (may be the same value as [EOPNOTSUPP]).
@ AF_INET6
internetwork address family with IPv6: UDP, TCP, etc.
@ AF_INET
internetwork address family: UDP, TCP, etc.
@ AF_UNSPEC
unspecified address family
static int dns_query(const char *domain_name, void *addr_out, int family)
Get IP address for DNS name.
int gcoap_dns_query(const char *domain_name, void *addr_out, int family)
Query a domain name via CoAP synchronously.
int hosts_query(const char *host_name, void *addr_out, int family)
Get IP address for a host name.
int sock_dns_query(const char *domain_name, void *addr_out, int family)
Get IP address for DNS name.
int sock_dodtls_query(const char *domain_name, void *addr_out, int family)
Get IP address for DNS name.
Static mappings from hostnames to IP addresses.
Common macros and compiler attributes/pragmas configuration.
#define IS_USED(module)
Checks whether a module is being used or not.