]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
kill the -r switch, put everything in a -o <options> thingy
authorMiek Gieben <miekg@NLnetLabs.nl>
Tue, 22 Nov 2005 10:05:22 +0000 (10:05 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Tue, 22 Nov 2005 10:05:22 +0000 (10:05 +0000)
drill/drill.1
drill/drill.c
drill/drill.h.in

index 8006a298433687c311998843cf6639780b4c90ac..7dcc877723874c9d190522e191dbf2e0ad4bd578 100644 (file)
@@ -128,8 +128,22 @@ key. No chasing is done.
 Use this port instead of the DNS default of 53.
 
 .TP
-\fB\-r
-Don't set the RD bit in the query - the default is yes.
+\fB\-o \fImnemonic\fR
+Use this option to set or unset specific header bits. A bit is
+set by using the bit mnemonic in CAPITAL. A bit is unset when
+the mnemonic is given in lowercase. The following mnemonics are
+understood by \fBdrill\fR:
+
+        QR, qr: set, unset QueRy (default: on)
+        AA, aa: set, unset Authoritative Answer (default: off)
+        TC, tc: set, unset TrunCated (default: off)
+        RD, rd: set, unset Recursion Desired (default: on)
+        CD, cd: set, unset Checking Disabled  (default: off)
+        RA, ra: set, unset Recursion Available  (default: off)
+        AD, ad: set, unset Authenticated Data (default: off)
+
+Thus: \fB-o CD\fR, will enable Checking Disabled, which instructs the 
+cache to not validate the answers it gives out.
 
 .TP
 \fB\-s
index e7faf8508d031b618754d0623f3f0110bf4b05be..69542530ad4861989343031a7a56fb4ce9c809fb 100644 (file)
@@ -42,8 +42,8 @@ usage(FILE *stream, const char *progname)
        fprintf(stream, "\t-c\t\tsend the query with tcp (connected)\n");
        fprintf(stream, "\t-k <file>\tspecify a file that contains a trusted DNSSEC key [**]\n");
        fprintf(stream, "\t\t\tused to verify any signatures in the current answer\n");
+       fprintf(stream, "\t-o <mnemonic>\t[QR|qr][AA|aa] [TC|tc] [RD|rd] [CD|cd] [RA|ra] [AD|ad]\n");
        fprintf(stream, "\t-p <port>\tuse <port> as remote port number\n");
-       fprintf(stream, "\t-r\t\tdon't set the RD bit in queries (default is on)\n");
        fprintf(stream, "\t-s\t\tshow the DS RR for each key in a packet\n");
        fprintf(stream, "\t-u\t\tsend the query with udp (the default)\n");
        fprintf(stream, "\t-x\t\tdo a reverse (PTR) lookup\n");
@@ -148,7 +148,7 @@ main(int argc, char *argv[])
        /* string from orig drill: "i:w:I46Sk:TNp:b:DsvhVcuaq:f:xr" */
        /* global first, query opt next, option with parm's last
         * and sorted */
-       while ((c = getopt(argc, argv, "46DITSVQf:i:w:q:achruvxzy:sp:b:k:")) != -1) {
+       while ((c = getopt(argc, argv, "46DITSVQf:i:w:q:achuvxzy:so:p:b:k:")) != -1) {
                switch(c) {
                        /* global options */
                        case '4':
@@ -214,6 +214,51 @@ main(int argc, char *argv[])
                                ldns_rr_list_push_rr(key_list, dnssec_key);
                                qdnssec = true; /* enable that too */
                                break;
+                       case 'o':
+                               /* only looks at the first hit: capital=ON, lowercase=OFF*/
+                               if (strstr(optarg, "QR")) {
+                                       DRILL_ON(qflags, LDNS_QR);
+                               }
+                               if (strstr(optarg, "qr")) {
+                                       DRILL_OFF(qflags, LDNS_QR);
+                               }
+                               if (strstr(optarg, "AA")) {
+                                       DRILL_ON(qflags, LDNS_AA);
+                               }
+                               if (strstr(optarg, "aa")) {
+                                       DRILL_OFF(qflags, LDNS_AA);
+                               }
+                               if (strstr(optarg, "TC")) {
+                                       DRILL_ON(qflags, LDNS_TC);
+                               }
+                               if (strstr(optarg, "tc")) {
+                                       DRILL_OFF(qflags, LDNS_TC);
+                               }
+                               if (strstr(optarg, "RD")) {
+                                       DRILL_ON(qflags, LDNS_RD);
+                               }
+                               if (strstr(optarg, "rd")) {
+                                       DRILL_OFF(qflags, LDNS_RD);
+                               }
+                               if (strstr(optarg, "CD")) {
+                                       DRILL_ON(qflags, LDNS_CD);
+                               }
+                               if (strstr(optarg, "cd")) {
+                                       DRILL_OFF(qflags, LDNS_CD);
+                               }
+                               if (strstr(optarg, "RA")) {
+                                       DRILL_ON(qflags, LDNS_RA);
+                               }
+                               if (strstr(optarg, "ra")) {
+                                       DRILL_OFF(qflags, LDNS_RA);
+                               }
+                               if (strstr(optarg, "AD")) {
+                                       DRILL_ON(qflags, LDNS_AD);
+                               }
+                               if (strstr(optarg, "ad")) {
+                                       DRILL_OFF(qflags, LDNS_AD);
+                               }
+                               break;
                        case 'p':
                                qport = (uint16_t)atoi(optarg);
                                if (qport == 0) {
@@ -225,9 +270,6 @@ main(int argc, char *argv[])
                        case 's':
                                qds = true;
                                break;
-                       case 'r':
-                               qflags = qflags & ~LDNS_RD; 
-                               break;
                        case 'u':
                                qusevc = false;
                                break;
index d25fca00bb6805d4ced559b7079dc20614f63fae..80ab67463aad851bc8e2acb87079741c0a0af4eb 100644 (file)
 #define DRILL_REVERSE  6
 #define DRILL_SECTRACE         7
 
+#define DRILL_ON(VAR, BIT) \
+VAR = VAR | BIT
+#define DRILL_OFF(VAR, BIT) \
+VAR = VAR & ~BIT
+
 extern ldns_rr_list *global_dns_root;
 extern bool qds;