diff options
Diffstat (limited to 'src/rexmpp_dns.h')
-rw-r--r-- | src/rexmpp_dns.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/rexmpp_dns.h b/src/rexmpp_dns.h index 6641238..7abd2ef 100644 --- a/src/rexmpp_dns.h +++ b/src/rexmpp_dns.h @@ -12,6 +12,7 @@ #define REXMPP_DNS_H #include <stdint.h> +#include <stdbool.h> #include "config.h" #include "rexmpp.h" @@ -21,21 +22,21 @@ */ #if defined(USE_UNBOUND) #include <unbound.h> -struct rexmpp_dns_ctx { - struct ub_ctx *ctx; -}; +typedef struct ub_ctx* rexmpp_dns_ctx_t; +/* struct rexmpp_dns_ctx { */ +/* struct ub_ctx *ctx; */ +/* }; */ #elif defined(USE_CARES) #include <ares.h> -struct rexmpp_dns_ctx { - ares_channel channel; -}; +typedef ares_channel rexmpp_dns_ctx_t; +/* struct rexmpp_dns_ctx { */ +/* ares_channel channel; */ +/* }; */ #else -struct rexmpp_dns_ctx { - int dummy; -}; +typedef void* rexmpp_dns_ctx_t; #endif -typedef struct rexmpp_dns_ctx rexmpp_dns_ctx_t; +/* typedef struct rexmpp_dns_ctx rexmpp_dns_ctx_t; */ struct rexmpp_dns_srv { uint16_t priority; @@ -58,7 +59,7 @@ struct rexmpp_dns_result { int *len; /** @brief Whether the result was retrieved securely (that is, verified with DNSSEC). */ - int secure; + bool secure; }; typedef struct rexmpp_dns_result rexmpp_dns_result_t; @@ -103,9 +104,9 @@ int rexmpp_dns_fds (rexmpp_t *s, fd_set *read_fds, fd_set *write_fds); /** @brief Reports timeouts. */ -struct timeval * rexmpp_dns_timeout (rexmpp_t *s, - struct timeval *max_tv, - struct timeval *tv); +struct timespec * rexmpp_dns_timeout (rexmpp_t *s, + struct timespec *max_tv, + struct timespec *tv); typedef void (*dns_query_cb_t) (rexmpp_t *s, void *ptr, rexmpp_dns_result_t *result); |