40#include <arpa/nameser.h>
45#define MAX_TTL ((INT_MAX - EXTRA_TTL) / 1000)
63 recurring->
timer = -1;
90 callback_query->
callback(callback_query);
103 if (recurring->
timer < 0) {
129 recurring->
timer = -1;
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_replace(dst, src)
Replace one object reference with another cleaning up the original.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
#define ao2_alloc(data_size, destructor_fn)
struct ast_dns_query_active * ast_dns_resolve_async(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data)
Asynchronously resolve a DNS query.
int ast_dns_resolve_cancel(struct ast_dns_query_active *active)
Cancel an asynchronous DNS resolution.
int ast_dns_result_get_lowest_ttl(const struct ast_dns_result *result)
Retrieve the lowest TTL from a result.
void(* ast_dns_resolve_callback)(const struct ast_dns_query *query)
Callback invoked when a query completes.
void * ast_dns_query_get_data(const struct ast_dns_query *query)
Get the user specific data of a DNS query.
struct ast_dns_result * ast_dns_query_get_result(const struct ast_dns_query *query)
Get the result information for a DNS query.
Internal DNS structure definitions.
struct ast_sched_context * ast_dns_get_sched(void)
Retrieve the DNS scheduler context.
struct ast_dns_query * dns_query_alloc(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data)
Allocate a DNS query (but do not start resolution)
#define EXTRA_TTL
Delay between TTL expiration and the next DNS query, to make sure the resolver cache really expired.
int ast_dns_resolve_recurring_cancel(struct ast_dns_query_recurring *recurring)
Cancel an asynchronous recurring DNS resolution.
static void dns_query_recurring_destroy(void *data)
Destructor for a DNS query.
static void dns_query_recurring_resolution_callback(const struct ast_dns_query *query)
Query resolution callback.
struct ast_dns_query_recurring * ast_dns_resolve_recurring(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data)
Asynchronously resolve a DNS query, and continue resolving it according to the lowest TTL available.
static int dns_query_recurring_scheduled_callback(const void *data)
Scheduled recurring query callback.
DNS Recurring Resolution API.
A set of macros to manage forward-linked lists.
Scheduler Routines (derived from cheops)
#define AST_SCHED_DEL_UNREF(sched, id, refcall)
schedule task to get deleted and call unref function
int ast_sched_add(struct ast_sched_context *con, int when, ast_sched_cb callback, const void *data) attribute_warn_unused_result
Adds a scheduled event.
String manipulation functions.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void * user_data
User-specific data.
ast_dns_resolve_callback callback
Callback to invoke upon completion.
unsigned int cancelled
The recurring query has been cancelled.
struct ast_dns_query_active * active
Current active query.
int rr_class
Resource record class.
int rr_type
Resource record type.
int timer
Scheduled timer for next resolution.
char name[0]
The name of what is being resolved.
ast_dns_resolve_callback callback
Callback to invoke upon completion.
struct ast_dns_result * result
Result of the DNS query.
int rr_class
Resource record class.
int rr_type
Resource record type.
char name[0]
The name of what is being resolved.
The result of a DNS query.