26#ifndef _ASTERISK_DNS_INTERNAL_H
27#define _ASTERISK_DNS_INTERNAL_H
280char *
dns_find_record(
const char *record,
size_t record_size,
const char *response,
size_t response_size);
void(* ast_dns_resolve_callback)(const struct ast_dns_query *query)
Callback invoked when a query completes.
void dns_naptr_sort(struct ast_dns_result *result)
Sort the NAPTR records on a result.
char * dns_find_record(const char *record, size_t record_size, const char *response, size_t response_size)
Find the location of a DNS record within the entire DNS answer.
struct ast_dns_record * dns_naptr_alloc(struct ast_dns_query *query, const char *data, const size_t size)
Allocate and parse a DNS NAPTR record.
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 dns_parse_short(unsigned char *cur, uint16_t *val)
Parse a 16-bit unsigned value from a DNS record.
int dns_parse_string(char *cur, uint8_t *size, char **val)
Parse a DNS string from a DNS record.
struct ast_dns_record * dns_srv_alloc(struct ast_dns_query *query, const char *data, const size_t size)
Allocate and parse a DNS SRV record.
void dns_srv_sort(struct ast_dns_result *result)
Sort the SRV records on a result.
struct ast_dns_record * dns_txt_alloc(struct ast_dns_query *query, const char *data, const size_t size)
Allocate and parse a DNS TXT record.
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_LIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
unsigned short order
The order for the NAPTR record.
struct ast_dns_record generic
Generic DNS record information.
unsigned short preference
The preference of the NAPTR record.
const char * regexp
The regular expression from the NAPTR record.
char data[0]
Buffer for NAPTR-specific data.
const char * flags
The flags from the NAPTR record.
const char * service
The service from the NAPTR record.
const char * replacement
The replacement from the NAPTR record.
struct ast_dns_query * query
The underlying DNS query.
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.
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.
void * resolver_data
Resolver-specific data.
ast_dns_resolve_callback callback
Callback to invoke upon completion.
struct ast_dns_resolver * resolver
The resolver in use for this query.
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.
int ttl
Time-to-live of the record.
char data[0]
The raw DNS record.
struct ast_dns_record::@215 list
Linked list information.
int rr_class
Resource record class.
int rr_type
Resource record type.
size_t data_len
The size of the raw DNS record.
char * data_ptr
pointer to record-specific data.
DNS resolver implementation.
The result of a DNS query.
char buf[0]
Buffer for dynamic data.
struct ast_dns_result::dns_records records
const char * canonical
The canonical name.
size_t answer_size
The size of the raw DNS answer.
unsigned int bogus
Whether the result is bogus.
unsigned int secure
Whether the result is secure.
const char * answer
The raw DNS answer.
unsigned int rcode
Optional rcode, set if an error occurred.
struct ast_dns_record generic
Generic DNS record information.
unsigned short weight
The weight of the SRV record.
unsigned short priority
The priority of the SRV record.
unsigned int weight_sum
The running weight sum.
char data[0]
Additional data.
unsigned short port
The port in the SRV record.
const char * host
The hostname in the SRV record.
struct ast_dns_record generic
Generic DNS record information.
size_t count
The number of character strings in the TXT record.
char data[0]
The raw DNS record.
A DNS query set query, which includes its state.
struct ast_dns_query * query
The query itself.
unsigned int started
Whether the query started successfully or not.
Vector container support.
#define AST_VECTOR(name, type)
Define a vector structure.