|
unbound 0.1
|
This file performs functionality like 'host', and also supports validation. More...
#include "config.h"#include "libunbound/unbound.h"#include "sldns/rrdef.h"#include "sldns/wire2str.h"Functions | |
| static void | usage (void) |
| Give unbound-host usage, and exit (1). | |
| static int | isip4 (const char *nm, char **res) |
| determine if str is ip4 and put into reverse lookup format | |
| static int | isip6 (const char *nm, char **res) |
| determine if str is ip6 and put into reverse lookup format | |
| static char * | massage_qname (const char *nm, int *reverse) |
| massage input name | |
| static int | massage_type (const char *t, int reverse, int *multi) |
| massage input type | |
| static int | massage_class (const char *c) |
| massage input class | |
| static const char * | secure_str (struct ub_result *result) |
| nice security status string | |
| static void | pretty_type (char *s, size_t len, int t) |
| nice string for type | |
| static void | pretty_class (char *s, size_t len, int c) |
| nice string for class | |
| static void | pretty_rcode (char *s, size_t len, int r) |
| nice string for rcode | |
| static void | print_rd (int t, char *data, size_t len) |
| convert and print rdata | |
| static void | pretty_rdata (char *q, char *cstr, char *tstr, int t, const char *sec, char *data, size_t len) |
| pretty line of RR data for results | |
| static void | pretty_output (char *q, int t, int c, struct ub_result *result, int docname) |
| pretty line of output for results | |
| static int | dnslook (struct ub_ctx *ctx, char *q, int t, int c, int docname) |
| perform a lookup and printout return if domain existed | |
| static void | lookup (struct ub_ctx *ctx, const char *nm, const char *qt, const char *qc) |
| perform host lookup | |
| static void | check_ub_res (int r) |
| print error if any | |
| int | main (int argc, char *argv[]) |
| Main routine for unbound-host. | |
Variables | |
| static int | verb = 0 |
| verbosity for unbound-host app | |
| 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 file performs functionality like 'host', and also supports validation.
It uses the libunbound library.
|
static |
Give unbound-host usage, and exit (1).
References usage().
|
static |
determine if str is ip4 and put into reverse lookup format
References isip4().
Referenced by isip4(), and massage_qname().
|
static |
determine if str is ip6 and put into reverse lookup format
References isip6().
Referenced by isip6(), and massage_qname().
|
static |
massage input name
References isip4(), isip6(), massage_qname(), and reverse().
Referenced by lookup(), and massage_qname().
|
static |
massage input type
References LDNS_RR_TYPE_A, LDNS_RR_TYPE_PTR, massage_type(), reverse(), and sldns_get_rr_type_by_name().
Referenced by lookup(), and massage_type().
|
static |
massage input class
References LDNS_RR_CLASS_IN, massage_class(), and sldns_get_rr_class_by_name().
Referenced by lookup(), and massage_class().
|
static |
nice security status string
References ub_result::bogus, ub_result::rcode, ub_result::secure, and secure_str().
Referenced by pretty_output(), and secure_str().
|
static |
nice string for type
References pretty_type(), and sldns_wire2str_type_buf().
Referenced by pretty_output(), and pretty_type().
|
static |
nice string for class
References pretty_class(), and sldns_wire2str_class_buf().
Referenced by pretty_class(), and pretty_output().
|
static |
nice string for rcode
References pretty_rcode(), and sldns_wire2str_rcode_buf().
Referenced by pretty_output(), and pretty_rcode().
|
static |
convert and print rdata
References print_rd(), and sldns_wire2str_rdata_buf().
Referenced by pretty_rdata(), and print_rd().
|
static |
pretty line of RR data for results
References LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA, LDNS_RR_TYPE_MX, LDNS_RR_TYPE_PTR, pretty_rdata(), print_rd(), and verb.
Referenced by pretty_output(), and pretty_rdata().
|
static |
pretty line of output for results
References ub_result::answer_len, ub_result::answer_packet, ub_result::bogus, ub_result::canonname, ub_result::data, ub_result::havedata, LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA, LDNS_RR_TYPE_ANY, LDNS_RR_TYPE_MX, LDNS_RR_TYPE_PTR, ub_result::len, pretty_class(), pretty_output(), pretty_rcode(), pretty_rdata(), pretty_type(), ub_result::qname, ub_result::rcode, secure_str(), sldns_wire2str_pkt(), verb, and ub_result::why_bogus.
Referenced by dnslook(), and pretty_output().
|
static |
perform a lookup and printout return if domain existed
References dnslook(), ub_result::nxdomain, pretty_output(), ub_resolve(), ub_resolve_free(), and ub_strerror().
|
static |
perform host lookup
References dnslook(), LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA, LDNS_RR_TYPE_MX, massage_class(), massage_qname(), massage_type(), reverse(), and ub_ctx_delete().
Referenced by main().
|
static |
print error if any
References check_ub_res(), and ub_strerror().
Referenced by check_ub_res(), and main().
| int main | ( | int | argc, |
| char * | argv[] ) |
Main routine for unbound-host.
References check_ub_res(), lookup(), main, optarg, optind, ub_result::qclass, ub_result::qtype, ub_ctx_add_ta(), ub_ctx_add_ta_file(), ub_ctx_config(), ub_ctx_create(), ub_ctx_debuglevel(), ub_ctx_delete(), ub_ctx_get_option(), ub_ctx_resolvconf(), ub_ctx_set_option(), ub_ctx_trustedkeys(), usage(), and verb.