]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
print NULL pkt when sending fails
authorMiek Gieben <miekg@NLnetLabs.nl>
Wed, 8 Mar 2006 14:25:07 +0000 (14:25 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Wed, 8 Mar 2006 14:25:07 +0000 (14:25 +0000)
examples/pcat-print.c
examples/pcat.c

index 226161df571dd797dfe9915921a0c5c212371fe5..a40c26e6fd451b9eba0d1932d396a131008f7283 100644 (file)
@@ -16,10 +16,10 @@ void
 usage(FILE *fp)
 {
         fprintf(fp, "pcat-print [-h] FILE\n\n");
-        fprintf(fp, "Read the output if pcat-diff and try to convert the\n");
-        fprintf(fp, "hex dump back in the DNS packets. Then print those packets\n");
-       fprintf(fp, "to standard output or print the error in case the conversion failed \n");
-        fprintf(fp, "There are no options, is FILE is not given, standard input is read\n");
+        fprintf(fp, "Read the output of pcat-diff and try to convert the\n");
+        fprintf(fp, "hex dump back in to DNS packets. Then print those packets\n");
+       fprintf(fp, "to standard output or print the error in case the conversion failed.\n");
+        fprintf(fp, "There are no options. If FILE is not given, standard input is read.\n");
         fprintf(fp, "\nOUTPUT FORMAT:\n");
         fprintf(fp, "  Each record consists of an index and then three packets.\n");
         fprintf(fp, "  Each packet is seperated by a line of '='s.\n");
index ae38f8022b5b52dfcdefd519561ccda18917b09e..e64cb8276f791d6667927b0396ccaeec32a5d80c 100644 (file)
@@ -175,6 +175,11 @@ main(int argc, char **argv)
                } else {
                        /* todo print failure */
                        fprintf(stderr, "Failure to send packet\n");
+                       fprintf(stdout, "%zd\n%zd\n", i, ((size_t)h.caplen * 2));
+                       /* query */
+                       data2hex(stdout, q, h.caplen); 
+                       /* answer, thus empty */
+                       fprintf(stdout, "0\n\n");
                }
                ldns_buffer_clear(qpkt);
                i++;