Asterisk - The Open Source Telephony Project  18.5.0
dns_txt.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2020, Sean Bright
5  *
6  * Sean Bright <[email protected]>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18 
19 /*! \file
20  * \brief DNS TXT Record Parsing API
21  * \author Sean Bright <[email protected]>
22  */
23 
24 #ifndef ASTERISK_DNS_TXT_H
25 #define ASTERISK_DNS_TXT_H
26 
27 #if defined(__cplusplus) || defined(c_plusplus)
28 extern "C" {
29 #endif
30 
31 /*!
32  * \brief Get the number of character strings in a TXT record
33  * \since 16.10.0, 17.4.0
34  *
35  * \param record The DNS record
36  *
37  * \return the number of character strings in this TXT record
38  */
39 size_t ast_dns_txt_get_count(const struct ast_dns_record *record);
40 
41 /*!
42  * \brief Get the character strings from this TXT record
43  * \since 16.10.0, 17.4.0
44  *
45  * \param record The DNS record
46  *
47  * \retval NULL Unable to allocate memory
48  * \return Vector of strings. Free with ast_dns_txt_free_strings
49  */
50 struct ast_vector_string *ast_dns_txt_get_strings(const struct ast_dns_record *record);
51 
52 /*!
53  * \brief Free strings returned by ast_dns_txt_get_strings
54  * \since 16.10.0, 17.4.0
55  *
56  * \param strings The vector to free
57  */
58 void ast_dns_txt_free_strings(struct ast_vector_string *strings);
59 
60 #if defined(__cplusplus) || defined(c_plusplus)
61 }
62 #endif
63 
64 #endif /* ASTERISK_DNS_TXT_H */
struct ast_vector_string * ast_dns_txt_get_strings(const struct ast_dns_record *record)
Get the character strings from this TXT record.
Definition: dns_txt.c:75
size_t ast_dns_txt_get_count(const struct ast_dns_record *record)
Get the number of character strings in a TXT record.
Definition: dns_txt.c:68
For AST_LIST.
Definition: dns_internal.h:39
void ast_dns_txt_free_strings(struct ast_vector_string *strings)
Free strings returned by ast_dns_txt_get_strings.
Definition: dns_txt.c:123