|
unbound 0.1
|
This program shows the results from several background lookups, while printing time in the foreground. More...
#include "config.h"#include "libunbound/unbound.h"#include "libunbound/context.h"#include "util/locks.h"#include "util/log.h"#include "sldns/rrdef.h"Data Structures | |
| struct | track_id |
| keeping track of the async ids More... | |
| struct | lookinfo |
| result list for the lookups More... | |
| struct | ext_thr_info |
| struct for extended thread info More... | |
Macros | |
| #define | NUMTHR 10 |
| number of threads to make in extended test | |
Functions | |
| static void | usage (char *argv[]) |
| usage information for asynclook | |
| static void | print_result (struct lookinfo *info) |
| print result from lookup nicely | |
| static void | lookup_is_done (void *mydata, int err, struct ub_result *result) |
| this is a function of type ub_callback_t | |
| static void | checkerr (const char *desc, int err) |
| check error, if bad, exit with error message | |
| static void | ext_check_result (const char *desc, int err, struct ub_result *result) |
| check result structure for the 'correct' answer | |
| static void | ext_callback (void *mydata, int err, struct ub_result *result) |
| extended bg result callback, this function is ub_callback_t | |
| static void * | ext_thread (void *arg) |
| extended thread worker | |
| static int | ext_test (struct ub_ctx *ctx, int argc, char **argv) |
| perform extended threaded test | |
| int | main (int argc, char **argv) |
| main program for asynclook | |
Variables | |
| static int | num_wait = 0 |
| global variable to see how many queries we have left | |
| static int | q_is_localhost = 0 |
| if true, we are testing against 'localhost' and extra checking is done | |
| int | optind |
| getopt global, in case header files fail to declare it. | |
| char * | optarg |
| getopt global, in case header files fail to declare it. | |
This program shows the results from several background lookups, while printing time in the foreground.
| #define NUMTHR 10 |
number of threads to make in extended test
Referenced by ext_test(), and ext_thread().
|
static |
usage information for asynclook
References usage().
|
static |
print result from lookup nicely
References ub_result::data, lookinfo::err, ub_result::havedata, lookinfo::name, ub_result::nxdomain, print_result(), ub_result::rcode, lookinfo::result, and ub_strerror().
Referenced by ext_callback(), main(), and print_result().
|
static |
this is a function of type ub_callback_t
References lookinfo::err, lookup_is_done(), lookinfo::name, num_wait, and lookinfo::result.
Referenced by lookup_is_done(), and main().
|
static |
check error, if bad, exit with error message
References checkerr(), lookinfo::err, and ub_strerror().
Referenced by checkerr(), ext_check_result(), ext_thread(), and main().
|
static |
check result structure for the 'correct' answer
References ub_result::answer_len, ub_result::answer_packet, ub_result::bogus, checkerr(), ub_result::data, ext_check_result(), ub_result::havedata, LDNS_RR_CLASS_IN, LDNS_RR_TYPE_A, ub_result::len, ub_result::nxdomain, q_is_localhost, ub_result::qclass, ub_result::qname, ub_result::qtype, ub_result::rcode, and ub_result::secure.
Referenced by ext_callback(), ext_check_result(), and ext_thread().
|
static |
extended bg result callback, this function is ub_callback_t
References track_id::cancel, lookinfo::err, ext_callback(), ext_check_result(), track_id::id, track_id::lock, log_assert, lookinfo::name, print_result(), ub_result::qname, lookinfo::result, and ub_resolve_free().
Referenced by ext_callback(), and ext_thread().
|
static |
extended thread worker
References ext_thr_info::argc, ext_thr_info::argv, track_id::cancel, checkerr(), ext_thr_info::ctx, ext_callback(), ext_check_result(), ext_thread(), track_id::id, ext_thr_info::id_list, LDNS_RR_CLASS_IN, LDNS_RR_TYPE_A, track_id::lock, log_thread_set(), ext_thr_info::numq, NUMTHR, ext_thr_info::thread_num, ub_cancel(), UB_NOID, ub_resolve(), ub_resolve_async(), ub_resolve_free(), and ub_wait().
Referenced by ext_test(), and ext_thread().
|
static |
perform extended threaded test
References ext_thr_info::argc, ext_thr_info::argv, ext_thr_info::ctx, ext_test(), ext_thread(), ext_thr_info::id_list, ext_thr_info::numq, NUMTHR, q_is_localhost, ext_thr_info::thread_num, ext_thr_info::tid, and ub_ctx_delete().
Referenced by ext_test(), and main().
| int main | ( | int | argc, |
| char ** | argv ) |
main program for asynclook
References lookinfo::async_id, checkerr(), ext_test(), LDNS_RR_CLASS_IN, LDNS_RR_TYPE_A, log_init(), lookup_is_done(), main, lookinfo::name, num_wait, optarg, optind, print_result(), lookinfo::result, ub_cancel(), ub_ctx_async(), ub_ctx_create(), ub_ctx_debuglevel(), ub_ctx_delete(), ub_ctx_hosts(), ub_ctx_resolvconf(), ub_ctx_set_fwd(), UB_NOID, ub_process(), ub_resolve(), ub_resolve_async(), ub_resolve_free(), ub_strerror(), and usage().
|
static |
global variable to see how many queries we have left
Referenced by lookup_is_done(), and main().
|
static |
if true, we are testing against 'localhost' and extra checking is done
Referenced by ext_check_result(), and ext_test().