Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include <arpa/nameser.h>
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/dns_core.h"
#include "asterisk/dns_resolver.h"
#include "asterisk/dns_srv.h"
#include "asterisk/dns_test.h"
Go to the source code of this file.
Data Structures | |
struct | srv_record |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
AST_TEST_DEFINE (srv_resolve_single_record) | |
AST_TEST_DEFINE (srv_resolve_sort_priority) | |
AST_TEST_DEFINE (srv_resolve_same_priority_zero_weight) | |
AST_TEST_DEFINE (srv_resolve_same_priority_different_weights) | |
AST_TEST_DEFINE (srv_resolve_different_priorities_different_weights) | |
AST_TEST_DEFINE (srv_resolve_record_missing_weight_port_host) | |
AST_TEST_DEFINE (srv_resolve_record_missing_port_host) | |
AST_TEST_DEFINE (srv_resolve_record_missing_host) | |
static int | generate_srv_record (void *dns_record, char *buf) |
static enum ast_test_result_state | invalid_record_test (struct ast_test *test, struct srv_record *records, int num_records) |
static int | load_module (void) |
static enum ast_test_result_state | nominal_test (struct ast_test *test, struct srv_record *records, int *srv_record_order, int num_records) |
static int | srv_cancel (struct ast_dns_query *query) |
static int | srv_resolve (struct ast_dns_query *query) |
static void * | srv_thread (void *dns_query) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "DNS SRV Tests" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
static char | ans_buffer [1024] |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static int | num_test_records |
static struct ast_dns_resolver | srv_resolver |
static struct srv_record * | test_records |
|
static |
Definition at line 589 of file test_dns_srv.c.
|
static |
Definition at line 589 of file test_dns_srv.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 589 of file test_dns_srv.c.
AST_TEST_DEFINE | ( | srv_resolve_single_record | ) |
Definition at line 188 of file test_dns_srv.c.
References ARRAY_LEN, AST_TEST_NOT_RUN, sip_to_pjsip::info(), nominal_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | srv_resolve_sort_priority | ) |
Definition at line 212 of file test_dns_srv.c.
References ARRAY_LEN, AST_TEST_NOT_RUN, sip_to_pjsip::info(), nominal_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | srv_resolve_same_priority_zero_weight | ) |
Definition at line 237 of file test_dns_srv.c.
References ARRAY_LEN, AST_TEST_NOT_RUN, sip_to_pjsip::info(), nominal_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | srv_resolve_same_priority_different_weights | ) |
Definition at line 262 of file test_dns_srv.c.
References ans_buffer, ARRAY_LEN, ast_dns_resolve(), ast_dns_resolver_register(), ast_dns_resolver_unregister(), ast_dns_result_free(), ast_dns_result_get_records(), ast_dns_srv_get_host(), ast_dns_srv_get_port(), ast_dns_srv_get_priority(), ast_dns_srv_get_weight(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), srv_record::host, sip_to_pjsip::info(), NULL, num_test_records, srv_record::port, srv_record::priority, records, result, TEST_EXECUTE, TEST_INIT, and srv_record::weight.
AST_TEST_DEFINE | ( | srv_resolve_different_priorities_different_weights | ) |
Definition at line 348 of file test_dns_srv.c.
References ans_buffer, ARRAY_LEN, ast_dns_record_get_next(), ast_dns_resolve(), ast_dns_resolver_register(), ast_dns_resolver_unregister(), ast_dns_result_free(), ast_dns_result_get_records(), ast_dns_srv_get_host(), ast_dns_srv_get_port(), ast_dns_srv_get_priority(), ast_dns_srv_get_weight(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, cleanup(), srv_record::host, sip_to_pjsip::info(), NULL, num_test_records, srv_record::port, srv_record::priority, records, result, TEST_EXECUTE, TEST_INIT, and srv_record::weight.
AST_TEST_DEFINE | ( | srv_resolve_record_missing_weight_port_host | ) |
Definition at line 494 of file test_dns_srv.c.
References ARRAY_LEN, AST_TEST_NOT_RUN, sip_to_pjsip::info(), invalid_record_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | srv_resolve_record_missing_port_host | ) |
Definition at line 516 of file test_dns_srv.c.
References ARRAY_LEN, AST_TEST_NOT_RUN, sip_to_pjsip::info(), invalid_record_test(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | srv_resolve_record_missing_host | ) |
Definition at line 538 of file test_dns_srv.c.
References ARRAY_LEN, AST_TEST_NOT_RUN, sip_to_pjsip::info(), invalid_record_test(), TEST_EXECUTE, and TEST_INIT.
|
static |
Definition at line 47 of file test_dns_srv.c.
References ast_dns_test_write_domain(), buf, srv_record::host, srv_record::ignore_host, srv_record::ignore_port, srv_record::ignore_priority, srv_record::ignore_weight, srv_record::port, srv_record::priority, and srv_record::weight.
Referenced by srv_thread().
|
static |
Definition at line 452 of file test_dns_srv.c.
References ans_buffer, ast_dns_resolve(), ast_dns_resolver_register(), ast_dns_resolver_unregister(), ast_dns_result_free(), ast_dns_result_get_records(), AST_TEST_FAIL, AST_TEST_PASS, ast_test_status_update, cleanup(), NULL, num_test_records, RAII_VAR, records, and result.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 575 of file test_dns_srv.c.
References AST_MODULE_LOAD_SUCCESS, and AST_TEST_REGISTER.
|
static |
Definition at line 125 of file test_dns_srv.c.
References ans_buffer, ast_dns_record_get_next(), ast_dns_resolve(), ast_dns_resolver_register(), ast_dns_resolver_unregister(), ast_dns_result_free(), ast_dns_result_get_records(), ast_dns_srv_get_host(), ast_dns_srv_get_port(), ast_dns_srv_get_priority(), ast_dns_srv_get_weight(), AST_TEST_FAIL, AST_TEST_PASS, ast_test_status_update, cleanup(), srv_record::host, NULL, num_test_records, srv_record::port, srv_record::priority, RAII_VAR, records, result, and srv_record::weight.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 113 of file test_dns_srv.c.
|
static |
Definition at line 106 of file test_dns_srv.c.
References ao2_bump, ast_pthread_create_detached, NULL, srv_thread(), and thread.
|
static |
Definition at line 81 of file test_dns_srv.c.
References ans_buffer, ao2_ref, ast_dns_resolver_add_record(), ast_dns_resolver_completed(), ast_dns_resolver_set_result(), ast_dns_test_generate_result(), generate_srv_record(), NULL, and num_test_records.
Referenced by srv_resolve().
|
static |
|
static |
Definition at line 589 of file test_dns_srv.c.
|
static |
Definition at line 79 of file test_dns_srv.c.
Referenced by AST_TEST_DEFINE(), invalid_record_test(), nominal_test(), and srv_thread().
|
static |
Definition at line 589 of file test_dns_srv.c.
|
static |
Definition at line 78 of file test_dns_srv.c.
Referenced by AST_TEST_DEFINE(), invalid_record_test(), nominal_test(), and srv_thread().
|
static |
Definition at line 118 of file test_dns_srv.c.
|
static |
Definition at line 77 of file test_dns_srv.c.