dns_query_set.h File Reference

DNS Query Set API. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(* ast_dns_query_set_callback )(const struct ast_dns_query_set *query_set)
 Callback invoked when a query set completes.

Functions

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.
struct ast_dns_query_setast_dns_query_set_create (void)
 Create a query set to hold queries.
void ast_dns_query_set_free (struct ast_dns_query_set *query_set)
 Free a query set.
struct ast_dns_queryast_dns_query_set_get (const struct ast_dns_query_set *query_set, unsigned int index)
 Retrieve a query from 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.
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.
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.
int ast_dns_query_set_resolve_cancel (struct ast_dns_query_set *query_set)
 Cancel an asynchronous DNS query set resolution.
void ast_query_set_resolve (struct ast_dns_query_set *query_set)
 Synchronously resolve queries in a query set.


Detailed Description

DNS Query Set API.

Author:
Joshua Colp <jcolp@digium.com>

Definition in file dns_query_set.h.


Typedef Documentation

typedef void(* ast_dns_query_set_callback)(const struct ast_dns_query_set *query_set)

Callback invoked when a query set completes.

Parameters:
query_set The DNS query set that was invoked

Definition at line 39 of file dns_query_set.h.


Function Documentation

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.

Parameters:
query_set A DNS query set
name The name of what to resolve
rr_type Resource record type
rr_class Resource record class
Return values:
0 success
-1 failure

Definition at line 56 of file dns_query_set.c.

00057 {
00058    return -1;
00059 }

struct ast_dns_query_set* ast_dns_query_set_create ( void   )  [read]

Create a query set to hold queries.

Return values:
non-NULL success
NULL failure

Definition at line 51 of file dns_query_set.c.

References NULL.

00052 {
00053    return NULL;
00054 }

void ast_dns_query_set_free ( struct ast_dns_query_set query_set  ) 

Free a query set.

Parameters:
query_set A DNS query set

Definition at line 91 of file dns_query_set.c.

00092 {
00093 }

struct ast_dns_query* ast_dns_query_set_get ( const struct ast_dns_query_set query_set,
unsigned int  index 
) [read]

Retrieve a query from a query set.

Parameters:
query_set A DNS query set
index The index of the query to retrieve
Return values:
non-NULL success
NULL failure

Definition at line 66 of file dns_query_set.c.

References NULL.

00067 {
00068    return NULL;
00069 }

void* ast_dns_query_set_get_data ( const struct ast_dns_query_set query_set  ) 

Retrieve user specific data from a query set.

Parameters:
query_set A DNS query set
Returns:
user specific data

Definition at line 71 of file dns_query_set.c.

00072 {
00073    return query_set->user_data;
00074 }

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.

Parameters:
query_set A DNS query set
Returns:
the number of queries

Definition at line 61 of file dns_query_set.c.

00062 {
00063    return 0;
00064 }

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.

Parameters:
query_set The query set
callback The callback to invoke upon completion
data User data to make available on the query set
Note:
The callback will be invoked when all queries have completed

The user data passed in to this function must be ao2 allocated

Definition at line 76 of file dns_query_set.c.

References ao2_bump.

00077 {
00078    query_set->callback = callback;
00079    query_set->user_data = ao2_bump(data);
00080 }

int ast_dns_query_set_resolve_cancel ( struct ast_dns_query_set query_set  ) 

Cancel an asynchronous DNS query set resolution.

Parameters:
query_set The DNS query set
Return values:
0 success
-1 failure
Note:
If successfully cancelled the callback will not be invoked

Definition at line 86 of file dns_query_set.c.

00087 {
00088    return -1;
00089 }

void ast_query_set_resolve ( struct ast_dns_query_set query_set  ) 

Synchronously resolve queries in a query set.

Parameters:
query_set The query set
Note:
This function will return when all queries have been completed

Definition at line 82 of file dns_query_set.c.

00083 {
00084 }


Generated on Thu Apr 16 06:30:43 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6