37#define DNS_TYPE_AAAA (28)
38#define DNS_CLASS_IN (1)
45#define RR_TYPE_LENGTH (2U)
46#define RR_CLASS_LENGTH (2U)
47#define RR_TTL_LENGTH (4U)
48#define RR_RDLENGTH_LENGTH (2U)
73static inline int dns_query(
const char *domain_name,
void *addr_out,
int family)
78 if (!
IS_USED(MODULE_IPV4_ADDR)) {
81 else if (!
IS_USED(MODULE_IPV6_ADDR)) {
86 if (res <= 0 &&
IS_USED(MODULE_GCOAP_DNS)) {
89 if (res <= 0 &&
IS_USED(MODULE_SOCK_DODTLS)) {
92 if (res <= 0 && (
IS_USED(MODULE_SOCK_DNS) ||
IS_USED(MODULE_SOCK_DNS_MOCK))) {
#define AF_INET
internetwork address family: UDP, TCP, etc.
#define AF_INET6
internetwork address family with IPv6: UDP, TCP, etc.
#define AF_UNSPEC
unspecified address family (as macro)
DNS over DTLS sock definitions.
#define ENOTSUP
Not supported (may be the same value as [EOPNOTSUPP]).
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 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.
Common macros and compiler attributes/pragmas configuration.
#define IS_USED(module)
Checks whether a module is being used or not.