Asterisk - The Open Source Telephony Project
18.5.0
|
DNS Recurring Resolution API. More...
Go to the source code of this file.
Functions | |
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. More... | |
int | ast_dns_resolve_recurring_cancel (struct ast_dns_query_recurring *recurring) |
Cancel an asynchronous recurring DNS resolution. More... | |
DNS Recurring Resolution API.
Definition in file dns_recurring.h.
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.
name | The name of what to resolve |
rr_type | Resource record type |
rr_class | Resource record class |
callback | The callback to invoke upon completion |
data | User data to make available on the query |
non-NULL | success - query has been sent for resolution |
NULL | failure |
Definition at line 109 of file dns_recurring.c.
References ast_dns_query_recurring::active, ao2_alloc, ao2_bump, ao2_ref, ast_dns_get_sched(), ast_dns_resolve_async(), ast_strlen_zero, ast_dns_query_recurring::callback, dns_query_recurring_destroy(), dns_query_recurring_resolution_callback(), ast_dns_query_recurring::name, NULL, ast_dns_query_recurring::rr_class, ast_dns_query_recurring::rr_type, ast_dns_query_recurring::timer, and ast_dns_query_recurring::user_data.
Referenced by AST_TEST_DEFINE().
int ast_dns_resolve_recurring_cancel | ( | struct ast_dns_query_recurring * | recurring | ) |
Cancel an asynchronous recurring DNS resolution.
query | The DNS query returned from ast_dns_resolve_recurring |
0 | success - any active query has been cancelled and the query will no longer occur |
-1 | failure - an active query was in progress and could not be cancelled |
Definition at line 138 of file dns_recurring.c.
References ast_dns_query_recurring::active, ao2_lock, ao2_ref, ao2_replace, ao2_unlock, ast_dns_get_sched(), ast_dns_resolve_cancel(), AST_SCHED_DEL_UNREF, ast_dns_query_recurring::cancelled, NULL, and ast_dns_query_recurring::timer.
Referenced by AST_TEST_DEFINE().