dig.c revision 354f4f1ab20ba521818a4bff9ffdbf9e00142b91
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley * Copyright (C) 2000, 2001 Internet Software Consortium.
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * Permission to use, copy, modify, and distribute this software for any
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * purpose with or without fee is hereby granted, provided that the above
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * copyright notice and this permission notice appear in all copies.
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington/* $Id: dig.c,v 1.136 2001/02/13 23:12:13 tamino Exp $ */
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellingtonextern ISC_LIST(dig_searchlist_t) search_list;
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington#define ADD_STRING(b, s) { \
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington if (strlen(s) >= isc_buffer_availablelength(b)) \
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellingtonextern isc_boolean_t have_ipv6, specified_source,
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellingtonextern unsigned int timeout;
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellingtonextern isc_boolean_t debugging, memdebugging;
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellingtonisc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington nibble = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE;
e552b980379e3a7ffce1411a939c62e27f953133Brian Wellingtonstatic const char *opcodetext[] = {
d2524f38d22998efb4196410643280b14f8b6febBob Halley "RESERVED6",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington "RESERVED10",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington "RESERVED11",
d2524f38d22998efb4196410643280b14f8b6febBob Halley "RESERVED12",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington "RESERVED13",
d598338952797df77417e69fcb8782b73651f9a9Brian Wellington "RESERVED14",
d598338952797df77417e69fcb8782b73651f9a9Brian Wellingtonstatic const char *rcodetext[] = {
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence "RESERVED11",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington "RESERVED12",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington "RESERVED13",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington "RESERVED14",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington "RESERVED15",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington"Usage: dig [@global-server] [domain] [q-type] [q-class] {q-opt}\n"
1fd4766e5b732c04c06ef44c0338b3b6bdbf2457Brian Wellington" {global-d-opt} host [@local-server] {local-d-opt}\n"
1fd4766e5b732c04c06ef44c0338b3b6bdbf2457Brian Wellington" [ host [@local-server] {local-d-opt} [...]]\n"
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington"Where: domain are in the Domain Name System\n"
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington" q-class is one of (in,hs,ch,...) [default: in]\n"
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington" q-type is one of (a,any,mx,ns,soa,hinfo,axfr,txt,...) [default:a]\n"
183d6e8b51170e57e7268120d475927fffcf08a5Brian Wellington" (Use ixfr=version for type ixfr)\n"
183d6e8b51170e57e7268120d475927fffcf08a5Brian Wellington" q-opt is one of:\n"
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington" -x dot-notation (shortcut for in-addr lookups)\n"
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington" -n (nibble form for reverse IPv6 lookups)\n"
1a2c699f0eb89fbd776a2dfabb6e197fe36a8c20Brian Wellington" -f filename (batch mode)\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" -p port (specify port number)\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" -t type (specify query type)\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" -c class (specify query class)\n"
1a2c699f0eb89fbd776a2dfabb6e197fe36a8c20Brian Wellington" -y name:key (specify named base64 tsig key)\n"
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington" d-opt is of the form +keyword[=value], where keyword is:\n"
1a2c699f0eb89fbd776a2dfabb6e197fe36a8c20Brian Wellington" +[no]vc (TCP mode)\n"
1a2c699f0eb89fbd776a2dfabb6e197fe36a8c20Brian Wellington" +[no]tcp (TCP mode, alternate syntax)\n"
1a2c699f0eb89fbd776a2dfabb6e197fe36a8c20Brian Wellington" +time=### (Set query timeout) [5]\n"
1a2c699f0eb89fbd776a2dfabb6e197fe36a8c20Brian Wellington" +tries=### (Set number of UDP attempts) [3]\n"
1a2c699f0eb89fbd776a2dfabb6e197fe36a8c20Brian Wellington" +domain=### (Set default domainname)\n"
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington" +bufsize=### (Set EDNS0 Max UDP packet size)\n"
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington" +[no]search (Set whether to use searchlist)\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" +[no]defname (Ditto)\n"
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington" +[no]recursive (Recursive mode)\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" +[no]ignore (Don't revert to TCP for TC responses.)"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" +[no]fail (Don't try next server on SERVFAIL)\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" +[no]besteffort (Try to parse even illegal messages)\n"
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington" +[no]aaonly (Set AA flag in query)\n"
949d406b57fe80fabc6a60d36a0dcee927c780b3Brian Wellington" +[no]adflag (Set AD flag in query)\n"
e552b980379e3a7ffce1411a939c62e27f953133Brian Wellington" +[no]cdflag (Set CD flag in query)\n"
e552b980379e3a7ffce1411a939c62e27f953133Brian Wellington" +ndots=### (Set NDOTS value)\n"
ac335315cddc0a42b9235001197dcf719ae737b6Brian Wellington" +[no]cmd (Control display of command line)\n"
fb01226bcd598c36b5edc566489c890c39f03ed3Brian Wellington" +[no]comments (Control display of comment lines)\n"
fb01226bcd598c36b5edc566489c890c39f03ed3Brian Wellington" +[no]question (Control display of question)\n"
949d406b57fe80fabc6a60d36a0dcee927c780b3Brian Wellington" +[no]answer (Control display of answer)\n"
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington" +[no]authority (Control display of authority)\n"
8dd915daf3f75ac9d04395e61157fdea825f3ebaBrian Wellington" +[no]additional (Control display of additional)\n"
8dd915daf3f75ac9d04395e61157fdea825f3ebaBrian Wellington" +[no]short (Disable everything except short\n"
8dd915daf3f75ac9d04395e61157fdea825f3ebaBrian Wellington" form of answer)\n"
8dd915daf3f75ac9d04395e61157fdea825f3ebaBrian Wellington" +[no]all (Set or clear all display flags)\n"
8dd915daf3f75ac9d04395e61157fdea825f3ebaBrian Wellington" +qr (Print question before sending)\n"
419590499823ce15b5d2ad4fe71eaf04bd5a86c0Michael Graff" +[no]nssearch (Search all authorative nameservers)\n"
8dd915daf3f75ac9d04395e61157fdea825f3ebaBrian Wellington" +[no]identify (ID responders in short answers)\n"
15660bccc162db0a7df281f5d743757c527580d5Brian Wellington" +[no]trace (Trace delegation down from root)\n"
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington" +rrlimit=### (Limit number of rr's in xfr)\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" +namelimit=### (Limit number of names in xfr)\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" +[no]dnssec (Request DNSSEC records)\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" global d-opts and servers (before host name) affect all queries.\n"
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington" local d-opts and servers (after host name) affect only that lookup.\n"
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * Callback from dighost.c to print the received message.
3f6dc1703f76a24b34ed3bc839447291c33ca837Brian Wellingtonreceived(int bytes, isc_sockaddr_t *from, dig_query_t *query) {
3f6dc1703f76a24b34ed3bc839447291c33ca837Brian Wellington isc_sockaddr_format(from, fromtext, sizeof(fromtext));
949d406b57fe80fabc6a60d36a0dcee927c780b3Brian Wellington diff = isc_time_microdiff(&now, &query->time_sent);
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington printf(";; Query time: %ld msec\n", (long int)diff/1000);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington printf(";; SERVER: %s(%s)\n", fromtext, query->servname);
d598338952797df77417e69fcb8782b73651f9a9Brian Wellington "be validated");
3f6dc1703f76a24b34ed3bc839447291c33ca837Brian Wellington if ((key == NULL) && (keysecret[0] != 0)) {
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington puts(";; WARNING -- TSIG key was not used.");
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington } else if (query->lookup->identify && !short_form) {
d0345e08f26267c1d11e02af57a6555868068415Brian Wellington diff = isc_time_microdiff(&now, &query->time_sent);
d0345e08f26267c1d11e02af57a6555868068415Brian Wellington printf(";; Received %u bytes from %s(%s) in %d ms\n\n",
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington * Callback from dighost.c to print that it is trying a server.
d0345e08f26267c1d11e02af57a6555868068415Brian Wellington * Not used in dig.
b6666e61dc9b91f4ac6af3aa1172bfd8a5f2d6ffBrian Wellington * XXX print_trying
d0345e08f26267c1d11e02af57a6555868068415Brian Wellingtontrying(int frmsize, char *frm, dig_lookup_t *lookup) {
15660bccc162db0a7df281f5d743757c527580d5Brian Wellington * Internal print routine used to print short form replies.
949d406b57fe80fabc6a60d36a0dcee927c780b3Brian Wellingtonsay_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
3f6dc1703f76a24b34ed3bc839447291c33ca837Brian Wellington char store[sizeof("12345678901234567890")];
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington if (query->lookup->trace || query->lookup->ns_search_only) {
3b2b306f47867d0037fb851623fb5a5736d64348Michael Graff result = dns_rdatatype_totext(rdata->type, buf);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington result = dns_rdata_totext(rdata, NULL, buf);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington diff = isc_time_microdiff(&now, &query->time_sent);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington snprintf(store, 19, " in %d ms.", (int)diff/1000);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * short_form message print handler. Calls above say_message()
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellingtonshort_answer(dns_message_t *msg, dns_messagetextflag_t flags,
452123247dcc4c6d30ea3f33f5174df62d84e9aeBrian Wellington char t[4096];
d692d9991a731d60b63e6389da1ebf2b2839cfabBrian Wellington result = dns_message_firstname(msg, DNS_SECTION_ANSWER);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington dns_message_currentname(msg, DNS_SECTION_ANSWER, &name);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington rdataset = ISC_LIST_NEXT(rdataset, link)) {
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence result = dns_message_nextname(msg, DNS_SECTION_ANSWER);
d5334bc18380d25e8a7ee804f68f22dc746b9c20Brian Wellington * Callback from dighost.c to print the reply from a server
d84ce5d5c69a7e144fb90fd4b3c349e88e4dcdddBrian Wellingtonprintmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
d84ce5d5c69a7e144fb90fd4b3c349e88e4dcdddBrian Wellington debug("printmessage(%s %s %s)", headers ? "headers" : "noheaders",
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence query->lookup->comments ? "comments" : "nocomments",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington result = isc_buffer_allocate(mctx, &buf, len);
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington check_result(result, "isc_buffer_allocate");
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence if (query->lookup->comments && !short_form) {
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington printf(";; ->>HEADER<<- opcode: %s, status: %s, "
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington opcodetext[msg->opcode], rcodetext[msg->rcode],
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington if ((msg->flags & DNS_MESSAGEFLAG_QR) != 0) {
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington if ((msg->flags & DNS_MESSAGEFLAG_AA) != 0) {
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0) {
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington if ((msg->flags & DNS_MESSAGEFLAG_RD) != 0) {
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington if ((msg->flags & DNS_MESSAGEFLAG_RA) != 0) {
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington if ((msg->flags & DNS_MESSAGEFLAG_AD) != 0) {
83e4218f6c6497eeaec7fb422b5f662cd98b2ba6David Lawrence if ((msg->flags & DNS_MESSAGEFLAG_CD) != 0) {
83e4218f6c6497eeaec7fb422b5f662cd98b2ba6David Lawrence "AUTHORITY: %u, ADDITIONAL: %u\n",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington if (query->lookup->comments && headers && !short_form)
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington result = dns_message_pseudosectiontotext(msg,
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington "dns_message_pseudosectiontotext");
4dc6a937d699f76782c17d58305f6d6cfaa8b55dBrian Wellington if (query->lookup->section_question && headers) {
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington result = isc_buffer_allocate(mctx, &buf, len);
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington check_result(result, "dns_message_sectiontotext");
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington result = isc_buffer_allocate(mctx, &buf, len);
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence check_result(result, "dns_message_sectiontotext");
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington result = short_answer(msg, flags, buf, query);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington result = isc_buffer_allocate(mctx, &buf, len);
c3a4d8072ccd3b33aa3fc84cdeadd1a6fac87e08Michael Graff check_result(result, "dns_message_sectiontotext");
2c12fc4d63f1d5f9d55fc0ecb198d582da6fd7d3Brian Wellington result = isc_buffer_allocate(mctx, &buf, len);
2c12fc4d63f1d5f9d55fc0ecb198d582da6fd7d3Brian Wellington check_result(result, "dns_message_sectiontotext");
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence * Only print the signature on the first record.
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington "dns_message_pseudosectiontotext");
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington "dns_message_pseudosectiontotext");
2c12fc4d63f1d5f9d55fc0ecb198d582da6fd7d3Brian Wellington if (headers && query->lookup->comments && !short_form)
5caab9f99d19ab9ebb0a0ba64c09c8de80e89e29Brian Wellington printf("%.*s", (int)isc_buffer_usedlength(buf),
2c12fc4d63f1d5f9d55fc0ecb198d582da6fd7d3Brian Wellington * print the greeting message when the program first starts up.
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellingtonprintgreeting(int argc, char **argv, dig_lookup_t *lookup) {
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington snprintf(lookup->cmdline, sizeof(lookup->cmdline),
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington while (i < argc) {
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington snprintf(append, sizeof(append), " %s", argv[i++]);
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington strncat(lookup->cmdline, "\n", sizeof (lookup->cmdline));
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington ";; global options: %s %s\n",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * Reorder an argument list so that server names all come at the end.
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * This is a bit of a hack, to allow batch-mode processing to properly
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * handle the server options.
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington debug("moving %s to end, %d", ptr, end - 1);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellingtonparse_int(char *arg, const char *desc, isc_uint32_t max) {
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington fatal("%s '%s' must be numeric", desc, arg);
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * We're not using isc_commandline_parse() here since the command line
452123247dcc4c6d30ea3f33f5174df62d84e9aeBrian Wellington * syntax of dig is quite a bit different from that which can be described
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * by that routine.
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington * XXX doc options
fb01226bcd598c36b5edc566489c890c39f03ed3Brian Wellingtonplus_option(char *option, isc_boolean_t is_batchfile,
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington strncpy(option_store, option, sizeof(option_store));
0f0162e6297ddf5e4abe848d27f3bcdb373189daBrian Wellington printf(";; Invalid option %s\n",option_store);
0f0162e6297ddf5e4abe848d27f3bcdb373189daBrian Wellington switch (cmd[0]) {
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington lookup->udpsize = parse_int(value, "buffer size",
4dc6a937d699f76782c17d58305f6d6cfaa8b55dBrian Wellington strncpy(domainopt, value, sizeof(domainopt));
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington default: /* Inherets default for compatibility */
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington ndots = parse_int(value, "ndots", MAXNDOTS);
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington rr_limit = parse_int(value, "rrlimit", MAXRRLIMIT);
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington timeout = parse_int(value, "timeout", MAXTIMEOUT);
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington lookup->retries = parse_int(value, "retries",
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington#endif /* DNS_OPT_NEWCODES_LIVE */
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington#endif /* DNS_OPT_NEWCODES_LIVE */
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington * ISC_TRUE returned if value was used
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellingtondash_option(char *option, char *next, dig_lookup_t **lookup,
c7f13217d11f26739a79f0dab391ec372b49b96bBrian Wellington /* memdebug is handled in preparse_args() */
3f6dc1703f76a24b34ed3bc839447291c33ca837Brian Wellington fprintf(stderr, ";; Warning, extra class option\n");
1a2c699f0eb89fbd776a2dfabb6e197fe36a8c20Brian Wellington "invalid class %s\n",
15660bccc162db0a7df281f5d743757c527580d5Brian Wellington port = parse_int(value, "port number", MAXPORT);
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington "extra type option\n");
8dd915daf3f75ac9d04395e61157fdea825f3ebaBrian Wellington "invalid type %s\n",
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington strncpy(keynametext, ptr, sizeof(keynametext));
b984520acca2532d048eae929dc0682dd334c7a3Brian Wellington strncpy(keysecret, ptr, sizeof(keysecret));
8dd915daf3f75ac9d04395e61157fdea825f3ebaBrian Wellington orig_section_question = (*lookup)->section_question;
6d4886fa7430889a96dbf9b88a2a4eb6f9d04674Brian Wellington *lookup = clone_lookup(default_lookup, ISC_TRUE);
if (!orig_rdtypeset)
if (!orig_rdclassset)
return (value_from_next);
show_usage();
return (ISC_FALSE);
int rc;
char **rv;
int bargc;
int rc;
char **rv;
#ifndef NOPOSIX
char *homedir;
char *input;
if (!is_batchfile) {
#ifndef NOPOSIX
batchfp) != 0) {
bargc++;
(char **)bargv);
lookup);
rc--;
rv++;
rc--;
rv++;
if (open_type_class) {
if (!config_only) {
ISC_TRUE);
if (firstarg) {
goto next_line;
bargc++;
* Callback from dighost.c to allow program-specific shutdown code. Here,
dighost_shutdown(void) {
int bargc;
char *input;
bargc++;
start_lookup();
setup_libs();
setup_system();
isc_app_run();
while (s != NULL) {
s, default_lookup);
s2 = s;
cancel_all();
destroy_libs();
return (exitcode);