42 #define DNS_QUERY_SET_EXPECTED_QUERY_COUNT 5 113 ast_log(
LOG_ERROR,
"Attempted to add additional query to query set '%p' after resolution has started\n",
170 ast_log(
LOG_ERROR,
"Attempted to start asynchronous resolution of query set '%p' when it has already started\n",
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
void * ast_dns_query_set_get_data(const struct ast_dns_query_set *query_set)
Retrieve user specific data from a query set.
int ast_query_set_resolve(struct ast_dns_query_set *query_set)
Synchronously resolve queries in a query set.
Asterisk main include file. File version handling, generic pbx functions.
static void dns_query_set_destroy(void *data)
Destructor for DNS query set.
void * user_data
User-specific data.
Structure used for signaling back for synchronous resolution completion.
int rr_type
Resource record type.
static void dns_synchronous_resolve_callback(const struct ast_dns_query_set *query_set)
Callback used to implement synchronous resolution.
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.
int ast_dns_query_set_add(struct ast_dns_query_set *query_set, const char *name, int rr_type, int rr_class)
Add a query to a query set.
int rr_class
Resource record class.
#define ast_cond_wait(cond, mutex)
#define ast_cond_init(cond, attr)
struct ast_dns_query_set * ast_dns_query_set_create(void)
Create a query set to hold queries.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ast_mutex_lock(a)
ast_cond_t cond
Condition used for signaling.
#define ast_cond_signal(cond)
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
pthread_cond_t ast_cond_t
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 AST_VECTOR_INIT(vec, size)
Initialize a vector.
#define AST_VECTOR_GET_ADDR(vec, idx)
Get an address of element in a vector.
void * ast_dns_query_get_data(const struct ast_dns_query *query)
Get the user specific data of a DNS query.
#define ao2_ref(o, delta)
A set of macros to manage forward-linked lists.
static void dns_synchronous_resolve_destroy(void *data)
Destructor for synchronous resolution structure.
#define DNS_QUERY_SET_EXPECTED_QUERY_COUNT
The default number of expected queries to be added to the query set.
void * user_data
User-specific data.
unsigned int completed
Whether the query has completed.
struct ast_dns_query * ast_dns_query_set_get(const struct ast_dns_query_set *query_set, unsigned int index)
Retrieve a query from a query set.
char data[0]
Buffer for NAPTR-specific data.
int(* resolve)(struct ast_dns_query *query)
Perform resolution of a DNS query.
#define ast_cond_destroy(cond)
int ast_dns_query_set_resolve_cancel(struct ast_dns_query_set *query_set)
Cancel an asynchronous DNS query set resolution.
Internal DNS structure definitions.
ast_dns_resolve_callback callback
Callback to invoke upon completion.
A DNS query set query, which includes its state.
int queries_completed
The total number of completed queries.
Vector container support.
struct ast_dns_resolver * resolver
The resolver in use for this query.
int in_progress
Whether the query set is in progress or not.
int queries_cancelled
The total number of cancelled queries.
static void dns_query_set_callback(const struct ast_dns_query *query)
Callback invoked upon completion of a DNS query.
unsigned int started
Whether the query started successfully or not.
size_t ast_dns_query_set_num_queries(const struct ast_dns_query_set *query_set)
Retrieve the number of queries in a query set.
ast_dns_query_set_callback callback
Callback to invoke upon completion.
ast_mutex_t lock
Lock used for signaling.
#define ast_mutex_init(pmutex)
#define ast_mutex_destroy(a)
struct ast_dns_query * query
The query itself.
void(* ast_dns_query_set_callback)(const struct ast_dns_query_set *query_set)
Callback invoked when a query set completes.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
Structure for mutex and tracking information.
#define ast_mutex_unlock(a)
int(* cancel)(struct ast_dns_query *query)
Cancel resolution of a DNS query.
void ast_dns_query_set_resolve_async(struct ast_dns_query_set *query_set, ast_dns_query_set_callback callback, void *data)
Asynchronously resolve queries in a query set.