X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/828d89bd4196ad8ef825cdf2db26afe2eb797b69..70a778e57fbc29a2d2bc8976745a18f4edd1a03a:/client/adnstest.c?ds=inline diff --git a/client/adnstest.c b/client/adnstest.c index 95955cb..9768d74 100644 --- a/client/adnstest.c +++ b/client/adnstest.c @@ -25,6 +25,10 @@ #include #include +#ifndef OUTPUTSTREAM +# define OUTPUTSTREAM stdout +#endif + #include "adns.h" static void failure(const char *what, adns_status st) { @@ -38,11 +42,21 @@ static const adns_rrtype defaulttypes[]= { adns_r_a, adns_r_ns_raw, adns_r_cname, + adns_r_soa_raw, adns_r_ptr_raw, + adns_r_hinfo, adns_r_mx_raw, - adns_r_rp_raw, adns_r_txt, + adns_r_rp_raw, + adns_r_addr, + adns_r_ns, + adns_r_ptr, + adns_r_mx, + + adns_r_soa, + adns_r_rp, + adns_r_none }; @@ -71,8 +85,8 @@ int main(int argc, char *const *argv) { for (cp= argv[1]+1, ti=0; ti,...] [ ...]",stderr); + if (ch != ',') { + fputs("usage: dtest [:,...] [ ...]\n",stderr); exit(4); } cp++; @@ -99,14 +113,14 @@ int main(int argc, char *const *argv) { for (ti=0; tinrrs; i++) { r= adns_rr_info(ans->type, 0,0,0, ans->rrs.bytes+i*len,&show); if (r) failure("info",r); - printf(" %s\n",show); + fprintf(stdout," %s\n",show); free(show); } } @@ -140,5 +154,7 @@ int main(int argc, char *const *argv) { } free(qus); + adns_finish(ads); + exit(0); }