40 #include <arpa/nameser.h> 58 recurring->
timer = -1;
85 callback_query->
callback(callback_query);
98 if (recurring->
timer < 0) {
124 recurring->
timer = -1;
127 strcpy(recurring->
name, name);
Asterisk main include file. File version handling, generic pbx functions.
ast_dns_resolve_callback callback
Callback to invoke upon completion.
char name[0]
The name of what is being resolved.
String manipulation functions.
void(* ast_dns_resolve_callback)(const struct ast_dns_query *query)
Callback invoked when a query completes.
int rr_type
Resource record type.
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 rr_class
Resource record class.
int rr_class
Resource record class.
#define AST_SCHED_DEL_UNREF(sched, id, refcall)
schedule task to get deleted and call unref function
static int dns_query_recurring_scheduled_callback(const void *data)
Scheduled recurring query callback.
char name[0]
The name of what is being resolved.
static void dns_query_recurring_destroy(void *data)
Destructor for a DNS query.
#define ast_strlen_zero(foo)
void * user_data
User-specific data.
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)
int ast_dns_result_get_lowest_ttl(const struct ast_dns_result *result)
Retrieve the lowest TTL from a result.
void * ast_dns_query_get_data(const struct ast_dns_query *query)
Get the user specific data of a DNS query.
Scheduler Routines (derived from cheops)
#define ao2_ref(o, delta)
struct ast_dns_query_active * active
Current active query.
A set of macros to manage forward-linked lists.
The result of a DNS query.
unsigned int cancelled
The recurring query has been cancelled.
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...
struct ast_dns_result * ast_dns_query_get_result(const struct ast_dns_query *query)
Get the result information for a DNS query.
struct ast_dns_result * result
Result of the DNS query.
static void dns_query_recurring_resolution_callback(const struct ast_dns_query *query)
Query resolution callback.
#define ao2_alloc(data_size, destructor_fn)
Internal DNS structure definitions.
ast_dns_resolve_callback callback
Callback to invoke upon completion.
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.
#define ao2_replace(dst, src)
int ast_dns_resolve_recurring_cancel(struct ast_dns_query_recurring *recurring)
Cancel an asynchronous recurring DNS resolution.
int ast_dns_resolve_cancel(struct ast_dns_query_active *active)
Cancel an asynchronous DNS resolution.
int rr_type
Resource record type.
DNS Recurring Resolution API.
int timer
Scheduled timer for next resolution.