Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
DNS TXT Record Parsing API. More...
#include "asterisk.h"
#include <netinet/in.h>
#include <resolv.h>
#include "asterisk/dns_core.h"
#include "asterisk/dns_txt.h"
#include "asterisk/dns_internal.h"
#include "asterisk/utils.h"
Go to the source code of this file.
Functions | |
void | ast_dns_txt_free_strings (struct ast_vector_string *strings) |
Free strings returned by ast_dns_txt_get_strings. More... | |
size_t | ast_dns_txt_get_count (const struct ast_dns_record *record) |
Get the number of character strings in a TXT record. More... | |
struct ast_vector_string * | ast_dns_txt_get_strings (const struct ast_dns_record *record) |
Get the character strings from this TXT record. More... | |
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. More... | |
DNS TXT Record Parsing API.
Definition in file dns_txt.c.
void ast_dns_txt_free_strings | ( | struct ast_vector_string * | strings | ) |
Free strings returned by ast_dns_txt_get_strings.
strings | The vector to free |
Definition at line 123 of file dns_txt.c.
References ast_free, AST_VECTOR_CALLBACK_VOID, and AST_VECTOR_PTR_FREE.
Referenced by ast_dns_txt_get_strings().
size_t ast_dns_txt_get_count | ( | const struct ast_dns_record * | record | ) |
Get the number of character strings in a TXT record.
record | The DNS record |
Definition at line 68 of file dns_txt.c.
References ast_assert, ast_dns_record_get_rr_type(), and ast_dns_txt_record::count.
Referenced by ast_dns_txt_get_strings().
struct ast_vector_string * ast_dns_txt_get_strings | ( | const struct ast_dns_record * | record | ) |
Get the character strings from this TXT record.
record | The DNS record |
NULL | Unable to allocate memory |
Definition at line 75 of file dns_txt.c.
References ast_assert, ast_dns_record_get_data(), ast_dns_record_get_data_size(), ast_dns_record_get_rr_type(), ast_dns_txt_free_strings(), ast_dns_txt_get_count(), ast_free, ast_malloc, AST_VECTOR_APPEND, AST_VECTOR_INIT, and NULL.
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.
query | The DNS query |
data | This specific TXT record |
size | The size of the TXT record |
non-NULL | success |
NULL | failure |
Definition at line 38 of file dns_txt.c.
References ast_calloc, ast_dns_txt_record::count, ast_dns_txt_record::data, ast_dns_record::data_ptr, ast_dns_txt_record::generic, and NULL.