X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/7d0aaee4dc7c78c81b609d678c63e194a3cbcbc7..27af7cd34e93dc118f6435e4328f055aca64f5de:/client/adh-opts.c diff --git a/client/adh-opts.c b/client/adh-opts.c index 1a46bae..9ae4beb 100644 --- a/client/adh-opts.c +++ b/client/adh-opts.c @@ -4,12 +4,11 @@ * option handling tables etc. */ /* - * This file is - * Copyright (C) 1997-2000 Ian Jackson - * - * It is part of adns, which is - * Copyright (C) 1997-2000 Ian Jackson - * Copyright (C) 1999-2000 Tony Finch + * This file is part of adns, which is + * Copyright (C) 1997-2000,2003,2006 Ian Jackson + * Copyright (C) 1999-2000,2003,2006 Tony Finch + * Copyright (C) 1991 Massachusetts Institute of Technology + * (See the file INSTALL for full details.) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +31,7 @@ int ov_env=1, ov_pipe=0, ov_asynch=0; int ov_verbose= 0; adns_rrtype ov_type= adns_r_none; int ov_search=0, ov_qc_query=0, ov_qc_anshost=0, ov_qc_cname=1; -int ov_tcp=0, ov_cname=0, ov_format=fmt_default; +int ov_tcp=0, ov_cname=0, ov_afflags=adns_qf_ipv6_ok, ov_format=fmt_default; char *ov_id= 0; struct perqueryflags_remember ov_pqfr = { 1,1,1, tm_none }; @@ -106,6 +105,16 @@ static const struct optioninfo perquery_options[]= { "Ta", "ttl-abs", &ov_pqfr.ttl, tm_abs }, { ot_value, "Do not show the TTL (default)", "Tn", "no-ttl", &ov_pqfr.ttl, tm_none }, + + { ot_desconly, "per-query address family options (for `addr' etc.):" }, + { ot_value, "Only return IPv4 addresses", + "A4", "--addr-ipv4-only", &ov_afflags, adns_qf_ipv4_only }, + { ot_value, "Return all available addresses (default)", + "Aa", "--addr-all", &ov_afflags, adns_qf_ipv6_ok }, + { ot_value, "Only return IPv6 addresses", + "A6", "--addr-ipv6-only", &ov_afflags, adns_qf_ipv6_only }, + { ot_value, "Return IPv4 addresses as IPv6-mapped", + "Am", "--addr-ipv6-mapped", &ov_afflags, adns_qf_ipv6_mapv4 }, { ot_desconly, "per-query CNAME handling mode:" }, { ot_value, "Call it an error if a CNAME is found", @@ -263,10 +272,10 @@ static void printusage(void) { " 11 usage problems\n" "\n" "Query types (see adns.h; default is addr):\n" - " ns soa ptr mx rp srv addr - enhanced versions\n" - " cname hinfo txt - types with only one version\n" - " a ns- soa- ptr- mx- rp- srv- - _raw versions\n" - " type - `unknown' type, RFC3597\n" + " ns soa ptr mx rp srv addr - enhanced versions\n" + " cname hinfo txt - types with only one version\n" + " a aaaa ns- soa- ptr- mx- rp- srv- - _raw versions\n" + " type - `unknown' type, RFC3597\n" "Default is addr, or ptr for -i/--ptr queries\n", stdout); if (ferror(stdout)) sysfail("write usage message",errno);