* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dig.c,v 1.176 2001/12/19 12:16:38 marka Exp $ */
+/* $Id: dig.c,v 1.177 2002/05/22 04:58:29 marka Exp $ */
#include <config.h>
#include <stdlib.h>
static isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
nibble = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE,
- multiline = ISC_FALSE;
+ multiline = ISC_FALSE, nottl = ISC_FALSE, noclass = ISC_FALSE;
static const char *opcodetext[] = {
"QUERY",
" +[no]aaonly (Set AA flag in query)\n"
" +[no]adflag (Set AD flag in query)\n"
" +[no]cdflag (Set CD flag in query)\n"
+" +[no]cl (Control display of class in records)\n"
" +[no]cmd (Control display of command line)\n"
" +[no]comments (Control display of comment lines)\n"
" +[no]question (Control display of question)\n"
" +[no]stats (Control display of statistics)\n"
" +[no]short (Disable everything except short\n"
" form of answer)\n"
+" +[no]ttlid (Control display of ttls in records)\n"
" +[no]all (Set or clear all display flags)\n"
" +[no]qr (Print question before sending)\n"
" +[no]nssearch (Search all authoritative nameservers)\n"
dns_messagetextflag_t flags;
isc_buffer_t *buf = NULL;
unsigned int len = OUTPUTBUF;
- const dns_master_style_t *style;
-
- if (multiline)
- style = &dns_master_style_default;
- else
- style = &dns_master_style_debug;
+ dns_master_style_t *style = NULL;
+ unsigned int styleflags = 0;
+
+ styleflags |= DNS_STYLEFLAG_REL_OWNER;
+ if (nottl)
+ styleflags |= DNS_STYLEFLAG_NO_TTL;
+ if (noclass)
+ styleflags |= DNS_STYLEFLAG_NO_CLASS;
+ if (multiline) {
+ styleflags |= DNS_STYLEFLAG_OMIT_OWNER;
+ styleflags |= DNS_STYLEFLAG_OMIT_CLASS;
+ styleflags |= DNS_STYLEFLAG_REL_DATA;
+ styleflags |= DNS_STYLEFLAG_OMIT_TTL;
+ styleflags |= DNS_STYLEFLAG_TTL;
+ styleflags |= DNS_STYLEFLAG_MULTILINE;
+ styleflags |= DNS_STYLEFLAG_COMMENT;
+ }
+ if (multiline || (nottl && noclass))
+ result = dns_master_stylecreate(&style, styleflags,
+ 24, 24, 24, 32, 80, 8, mctx);
+ else if (nottl || noclass)
+ result = dns_master_stylecreate(&style, styleflags,
+ 24, 24, 32, 40, 80, 8, mctx);
+ else
+ result = dns_master_stylecreate(&style, styleflags,
+ 24, 32, 40, 48, 80, 8, mctx);
+ check_result(result, "dns_master_stylecreate");
if (query->lookup->cmdline[0] != 0) {
if (!short_form)
if (result == ISC_R_SUCCESS)
goto repopulate_buffer;
else
- return (result);
+ goto cleanup;
}
check_result(result,
"dns_message_pseudosectiontotext");
printf("%.*s", (int)isc_buffer_usedlength(buf),
(char *)isc_buffer_base(buf));
isc_buffer_free(&buf);
+
+cleanup:
+ if (style != NULL)
+ dns_master_styledestroy(&style, mctx);
return (result);
}
FULLCHECK("cdflag");
lookup->cdflag = state;
break;
+ case 'l': /* cl */
+ FULLCHECK("cl");
+ noclass = !state;
+ break;
case 'm': /* cmd */
FULLCHECK("cmd");
printcmd = state;
goto invalid_option;
}
break;
+ case 't': /* ttlid */
+ FULLCHECK("ttlid");
+ nottl = !state;
+ break;
default:
goto invalid_option;
}
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dig.docbook,v 1.10 2001/11/14 06:34:24 marka Exp $ -->
+<!-- $Id: dig.docbook,v 1.11 2002/05/22 04:58:30 marka Exp $ -->
<refentry>
requests the server to not perform DNSSEC validation of responses.
</para></listitem></varlistentry>
+<varlistentry><term><option>+[no]cl</option></term>
+<listitem><para>
+Display [do not display] the CLASS when printing the record.
+</para></listitem></varlistentry>
+
+<varlistentry><term><option>+[no]ttlid</option></term>
+<listitem><para>
+Display [do not display] the TTL when printing the record.
+</para></listitem></varlistentry>
+
<varlistentry><term><option>+[no]recursive</option></term>
<listitem><para>
Toggle the setting of the RD (recursion desired) bit in the query.