static isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
ip6_int = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE,
+#ifdef DIG_SIGCHASE
multiline = ISC_FALSE, nottl = ISC_FALSE, noclass = ISC_FALSE,
- onesoa = ISC_FALSE, use_usec = ISC_FALSE,
nocrypto = ISC_FALSE, ttlunits = ISC_FALSE,
+#endif
ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
static isc_uint32_t splitwidth = 0xffffffff;
/*% rrcomments are neither explicitly enabled nor disabled by default */
+#ifdef DIG_SIGCHASE
static int rrcomments = 0;
+#endif
/*% opcode text */
static const char * const opcodetext[] = {
if (query->lookup->stats && !short_form) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
- if (use_usec)
+ if (query->lookup->use_usec)
printf(";; Query time: %ld usec\n", (long) diff);
else
printf(";; Query time: %ld msec\n", (long) diff / 1000);
puts("");
} else if (query->lookup->identify && !short_form) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
- if (use_usec)
+ if (query->lookup->use_usec)
printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
"from %s(%s) in %ld us\n\n",
query->lookup->doing_xfr
}
/* Turn on rrcomments if explicitly enabled */
- if (rrcomments > 0)
+ if (query->lookup->rrcomments > 0)
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
- if (nocrypto)
+ if (query->lookup->nocrypto)
styleflags |= DNS_STYLEFLAG_NOCRYPTO;
if (query->lookup->print_unknown_format)
styleflags |= DNS_STYLEFLAG_UNKNOWNFORMAT;
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
ADD_STRING(buf, " from server ");
ADD_STRING(buf, query->servname);
- if (use_usec)
+ if (query->lookup->use_usec)
snprintf(store, 19, " in %ld us.", (long) diff);
else
snprintf(store, 19, " in %ld ms.", (long) diff / 1000);
if (query->lookup->print_unknown_format)
styleflags |= DNS_STYLEFLAG_UNKNOWNFORMAT;
/* Turn on rrcomments if explicitly enabled */
- if (rrcomments > 0)
+ if (query->lookup->rrcomments > 0)
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
- if (ttlunits)
+ if (query->lookup->ttlunits)
styleflags |= DNS_STYLEFLAG_TTL_UNITS;
- if (nottl)
+ if (query->lookup->nottl)
styleflags |= DNS_STYLEFLAG_NO_TTL;
- if (noclass)
+ if (query->lookup->noclass)
styleflags |= DNS_STYLEFLAG_NO_CLASS;
- if (nocrypto)
+ if (query->lookup->nocrypto)
styleflags |= DNS_STYLEFLAG_NOCRYPTO;
- if (multiline) {
+ if (query->lookup->multiline) {
styleflags |= DNS_STYLEFLAG_OMIT_OWNER;
styleflags |= DNS_STYLEFLAG_OMIT_CLASS;
styleflags |= DNS_STYLEFLAG_REL_DATA;
styleflags |= DNS_STYLEFLAG_TTL;
styleflags |= DNS_STYLEFLAG_MULTILINE;
/* Turn on rrcomments unless explicitly disabled */
- if (rrcomments >= 0)
+ if (query->lookup->rrcomments >= 0)
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
}
- if (multiline || (nottl && noclass))
+ if (query->lookup->multiline ||
+ (query->lookup->nottl && query->lookup->noclass))
result = dns_master_stylecreate2(&style, styleflags,
24, 24, 24, 32, 80, 8,
splitwidth, mctx);
- else if (nottl || noclass)
+ else if (query->lookup->nottl || query->lookup->noclass)
result = dns_master_stylecreate2(&style, styleflags,
24, 24, 32, 40, 80, 8,
splitwidth, mctx);
flags |= DNS_MESSAGETEXTFLAG_NOHEADERS;
flags |= DNS_MESSAGETEXTFLAG_NOCOMMENTS;
}
- if (onesoa && query->lookup->rdtype == dns_rdatatype_axfr)
+ if (query->lookup->onesoa &&
+ query->lookup->rdtype == dns_rdatatype_axfr)
flags |= (query->msg_count == 0) ? DNS_MESSAGETEXTFLAG_ONESOA :
DNS_MESSAGETEXTFLAG_OMITSOA;
if (!query->lookup->comments)
case 'l': /* class */
/* keep +cl for backwards compatibility */
FULLCHECK2("cl", "class");
+ lookup->noclass = ISC_TF(!state);
+#ifdef DIG_SIGCHASE
noclass = ISC_TF(!state);
+#endif
break;
case 'm': /* cmd */
FULLCHECK("cmd");
break;
case 'r':
FULLCHECK("crypto");
+ lookup->nocrypto = ISC_TF(!state);
+#ifdef DIG_SIGCHASE
nocrypto = ISC_TF(!state);
+#endif
break;
default:
goto invalid_option;
break;
case 'u':
FULLCHECK("multiline");
+ lookup->multiline = state;
+#ifdef DIG_SIGCHASE
multiline = state;
+#endif
break;
default:
goto invalid_option;
lookup->rdtype = dns_rdatatype_ns;
lookup->rdtypeset = ISC_TRUE;
short_form = ISC_TRUE;
+ lookup->rrcomments = 0;
+#ifdef DIG_SIGCHASE
rrcomments = 0;
+#endif
}
break;
default:
switch (cmd[1]) {
case 'n':
FULLCHECK("onesoa");
- onesoa = state;
+ lookup->onesoa = state;
break;
case 'p':
FULLCHECK("opcode");
switch (cmd[1]) {
case 'r': /* qr */
FULLCHECK("qr");
- qr = state;
+ lookup->qr = state;
break;
case 'u': /* question */
FULLCHECK("question");
break;
case 'r': /* rrcomments */
FULLCHECK("rrcomments");
+ lookup->rrcomments = state ? 1 : -1;
+#ifdef DIG_SIGCHASE
rrcomments = state ? 1 : -1;
+#endif
break;
default:
goto invalid_option;
lookup->section_question = ISC_FALSE;
lookup->comments = ISC_FALSE;
lookup->stats = ISC_FALSE;
+ lookup->rrcomments = -1;
+#ifdef DIG_SIGCHASE
rrcomments = -1;
+#endif
}
break;
case 'w': /* showsearch */
lookup->recurse = ISC_FALSE;
lookup->identify = ISC_TRUE;
lookup->comments = ISC_FALSE;
+ lookup->rrcomments = 0;
+#ifdef DIG_SIGCHASE
rrcomments = 0;
+#endif
lookup->stats = ISC_FALSE;
lookup->section_additional = ISC_FALSE;
lookup->section_authority = ISC_TRUE;
case 0:
case 'i': /* ttlid */
FULLCHECK2("ttl", "ttlid");
+ lookup->nottl = ISC_TF(!state);
+#ifdef DIG_SIGCHASE
nottl = ISC_TF(!state);
+#endif
break;
case 'u': /* ttlunits */
FULLCHECK("ttlunits");
+ lookup->nottl = ISC_FALSE;
+ lookup->ttlunits = ISC_TF(state);
+#ifdef DIG_SIGCHASE
nottl = ISC_FALSE;
ttlunits = ISC_TF(state);
+#endif
break;
default:
goto invalid_option;
/* deprecated */
break;
case 'u':
- use_usec = ISC_TRUE;
+ (*lookup)->use_usec = ISC_TRUE;
break;
case 'v':
version();
cancel_now = ISC_FALSE,
usesearch = ISC_FALSE,
showsearch = ISC_FALSE,
- qr = ISC_FALSE,
is_dst_up = ISC_FALSE,
keep_open = ISC_FALSE,
verbose = ISC_FALSE;
looknew->sendcookie = ISC_FALSE;
looknew->seenbadcookie = ISC_FALSE;
looknew->badcookie = ISC_TRUE;
+ looknew->multiline = ISC_FALSE;
+ looknew->nottl = ISC_FALSE;
+ looknew->noclass = ISC_FALSE;
+ looknew->onesoa = ISC_FALSE;
+ looknew->use_usec = ISC_FALSE;
+ looknew->nocrypto = ISC_FALSE;
+ looknew->ttlunits = ISC_FALSE;
+ looknew->ttlunits = ISC_FALSE;
+ looknew->qr = ISC_FALSE;
#ifdef DIG_SIGCHASE
looknew->sigchase = ISC_FALSE;
#if DIG_SIGCHASE_TD
looknew->ednsneg = ISC_TRUE;
looknew->mapped = ISC_TRUE;
looknew->dscp = -1;
+ looknew->rrcomments = 0;
dns_fixedname_init(&looknew->fdomain);
ISC_LINK_INIT(looknew, link);
ISC_LIST_INIT(looknew->q);
looknew->ednsoptscnt = lookold->ednsoptscnt;
looknew->ednsneg = lookold->ednsneg;
looknew->mapped = lookold->mapped;
+ looknew->multiline = lookold->multiline;
+ looknew->nottl = lookold->nottl;
+ looknew->noclass = lookold->noclass;
+ looknew->onesoa = lookold->onesoa;
+ looknew->use_usec = lookold->use_usec;
+ looknew->nocrypto = lookold->nocrypto;
+ looknew->ttlunits = lookold->ttlunits;
+ looknew->qr = lookold->qr;
#ifdef DIG_SIGCHASE
looknew->sigchase = lookold->sigchase;
#if DIG_SIGCHASE_TD
looknew->need_search = lookold->need_search;
looknew->done_as_is = lookold->done_as_is;
looknew->dscp = lookold->dscp;
+ looknew->rrcomments = lookold->rrcomments;
if (lookold->ecs_addr != NULL) {
size_t len = sizeof(isc_sockaddr_t);
}
/* XXX qrflag, print_query, etc... */
- if (!ISC_LIST_EMPTY(lookup->q) && qr) {
+ if (!ISC_LIST_EMPTY(lookup->q) && lookup->qr) {
extrabytes = 0;
printmessage(ISC_LIST_HEAD(lookup->q), lookup->sendmsg,
ISC_TRUE);