30#include <netinet/in.h>
41 const char *end_of_record =
data + size;
46 while (
data < end_of_record) {
47 uint8_t byte_count = (uint8_t) *
data;
49 data += byte_count + 1;
52 if (
data != end_of_record) {
81 const char *end_of_record = data + size;
95 while (data < end_of_record) {
97 uint8_t bytes = (uint8_t) *data;
105 memcpy(s, &data[1], bytes);
115 if (data != end_of_record) {
Asterisk main include file. File version handling, generic pbx functions.
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_malloc(len)
A wrapper for malloc()
const char * ast_dns_record_get_data(const struct ast_dns_record *record)
Retrieve the raw DNS record.
int ast_dns_record_get_rr_type(const struct ast_dns_record *record)
Get the resource record type of a DNS record.
size_t ast_dns_record_get_data_size(const struct ast_dns_record *record)
Retrieve the size of the raw DNS record.
Internal DNS structure definitions.
size_t ast_dns_txt_get_count(const struct ast_dns_record *record)
Get the number of character strings in a TXT record.
struct ast_vector_string * ast_dns_txt_get_strings(const struct ast_dns_record *record)
Get the character strings from this TXT record.
void ast_dns_txt_free_strings(struct ast_vector_string *strings)
Free strings returned by ast_dns_txt_get_strings.
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.
DNS TXT Record Parsing API.
char data[0]
The raw DNS record.
char * data_ptr
pointer to record-specific data.
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.
String vector definitions.
#define AST_VECTOR_PTR_FREE(vec)
Deallocates this vector pointer.
#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_CALLBACK_VOID(vec, callback,...)
Execute a callback on every element in a vector disregarding callback return.