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",
273 if (
query->started) {
Asterisk main include file. File version handling, generic pbx functions.
@ AO2_ALLOC_OPT_LOCK_NOLOCK
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
void * ast_dns_query_get_data(const struct ast_dns_query *query)
Get the user specific data of a DNS query.
Internal DNS structure definitions.
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)
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.
static void dns_query_set_callback(const struct ast_dns_query *query)
Callback invoked upon completion of a DNS query.
struct ast_dns_query_set * ast_dns_query_set_create(void)
Create a query set to hold queries.
static void dns_synchronous_resolve_callback(const struct ast_dns_query_set *query_set)
Callback used to implement synchronous resolution.
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.
static void dns_query_set_destroy(void *data)
Destructor for DNS query set.
static void dns_synchronous_resolve_destroy(void *data)
Destructor for synchronous resolution structure.
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.
#define DNS_QUERY_SET_EXPECTED_QUERY_COUNT
The default number of expected queries to be added to the query set.
int ast_query_set_resolve(struct ast_dns_query_set *query_set)
Synchronously resolve queries in a query set.
int ast_dns_query_set_resolve_cancel(struct ast_dns_query_set *query_set)
Cancel an asynchronous DNS query set resolution.
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.
void * ast_dns_query_set_get_data(const struct ast_dns_query_set *query_set)
Retrieve user specific data from a query set.
void(* ast_dns_query_set_callback)(const struct ast_dns_query_set *query_set)
Callback invoked when a query set completes.
A set of macros to manage forward-linked lists.
#define ast_cond_destroy(cond)
#define ast_cond_wait(cond, mutex)
#define ast_cond_init(cond, attr)
#define ast_mutex_init(pmutex)
#define ast_mutex_unlock(a)
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
#define ast_mutex_destroy(a)
#define ast_mutex_lock(a)
#define ast_cond_signal(cond)
void * user_data
User-specific data.
ast_dns_query_set_callback callback
Callback to invoke upon completion.
struct ast_dns_query_set::@216 queries
DNS queries.
int queries_cancelled
The total number of cancelled queries.
int queries_completed
The total number of completed queries.
int in_progress
Whether the query set is in progress or not.
void * user_data
User-specific data.
ast_dns_resolve_callback callback
Callback to invoke upon completion.
struct ast_dns_resolver * resolver
The resolver in use for this query.
int rr_class
Resource record class.
int rr_type
Resource record type.
int(* cancel)(struct ast_dns_query *query)
Cancel resolution of a DNS query.
int(* resolve)(struct ast_dns_query *query)
Perform resolution of a DNS query.
Structure for mutex and tracking information.
A DNS query set query, which includes its state.
struct ast_dns_query * query
The query itself.
Structure used for signaling back for synchronous resolution completion.
ast_cond_t cond
Condition used for signaling.
ast_mutex_t lock
Lock used for signaling.
unsigned int completed
Whether the query has completed.
Vector container support.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.
#define AST_VECTOR_GET_ADDR(vec, idx)
Get an address of element in a vector.