29 #ifdef ADNS_JGAA_WIN32 45 {
ot_flag,
"Do not look at environment variables at all",
47 {
ot_flag,
"Read queries on stdin instead of using args",
49 {
ot_flag,
"Allow answers to be reordered",
52 {
ot_desconly,
"answer/error output format and destination (see below):" },
53 {
ot_value,
"Answers to stdout, errors as messages to stderr (default)",
55 {
ot_value,
"Answers and errors both to stdout in parseable format",
57 {
ot_value,
"Fully-parseable output format (default for --asynch)",
61 {
ot_value,
"Do not print anything to stderr",
63 {
ot_value,
"Report unexpected kinds of problem only (default)",
69 {
ot_funcarg,
"Configuration to use instead of /etc/resolv.conf",
70 0,
"config", 0,0,
of_config,
"<config-text>" },
71 {
ot_func,
"Print version number",
73 {
ot_func,
"Print usage information",
82 "t",
"type", 0,0, &
of_type,
"type" },
83 {
ot_funcarg,
"Do reverse query (address -> name lookup)",
84 "i",
"ptr", 0,0, &
of_ptr,
"addr" },
85 {
ot_funcarg2,
"Lookup in in-addr-like `zone' (eg MAPS RBL)",
86 0,
"reverse", 0,0, &
of_reverse,
"addr",
"zone" },
89 {
ot_flag,
"Use the search list",
91 {
ot_flag,
"Let query domains contain quote-requiring chars",
93 {
ot_flag,
"Let hostnames in answers contain ...",
95 {
ot_flag,
"Prevent CNAME target domains from containing ...",
97 {
ot_flag,
"Force use of a virtual circuit",
99 {
ot_flag,
"Do not display owner name in output",
100 "Do",
"show-owner", &
ov_pqfr.show_owner, 0 },
101 {
ot_flag,
"Do not display RR type in output",
102 "Dt",
"show-type", &
ov_pqfr.show_type, 0 },
103 {
ot_flag,
"Do not display CNAME target in output",
104 "Dc",
"show-cname", &
ov_pqfr.show_cname, 0 },
106 {
ot_desconly,
"per-query TTL mode (NB TTL is minimum across all info in reply):" },
107 {
ot_value,
"Show the TTL as a TTL",
109 {
ot_value,
"Show the TTL as a time_t when the data might expire",
111 {
ot_value,
"Do not show the TTL (default)",
115 {
ot_value,
"Call it an error if a CNAME is found",
117 {
ot_value,
"Allow references to CNAMEs in other RRs",
119 {
ot_value,
"CNAME ok for query domain, but not in RRs (default)",
122 {
ot_desconly,
"asynchronous/pipe mode options:" },
123 {
ot_funcarg,
"Set <id>, default is decimal sequence starting 0",
125 {
ot_funcarg,
"Cancel the query with id <id> (no error if not found)",
132 static const struct optioninfo *
const all_optiontables[]= {
137 int maxsopt, maxlopt,
l;
141 for (oiap=all_optiontables; *oiap; oiap++) {
148 if (
l>maxlopt) maxlopt=
l;
153 fputs(
"usage: adnshost [global-opts] [query-opts] query-domain\n" 154 " [[query-opts] query-domain ...]\n" 155 " adnshost [global-opts] [query-opts] -f|--pipe\n",
158 for (oiap=all_optiontables; *oiap; oiap++) {
165 printf(
" +%-*s --no-%-*s %s\n",
167 maxlopt-2, oip->
lopt,
171 maxlopt+maxsopt+1, oip->
lopt,
178 printf(
" -%-*s --%-*s %s\n",
180 maxlopt+1, oip->
lopt,
184 maxlopt+maxsopt+3, oip->
lopt,
190 l= (maxlopt + maxsopt - 9 -
192 printf(
" -%s<%s> / --%s <%s>%*s%s\n",
197 l= (maxlopt + maxsopt + 1 -
199 printf(
" --%s <%s>%*s%s\n",
207 l= (maxlopt + maxsopt - 2 -
209 printf(
" --%s <%s> <%s>%*s%s\n",
223 printf(
"\nEscaping domains which might start with `-':\n" 224 " - %-*s Next argument is a domain, but more options may follow\n",
225 maxlopt+maxsopt+3,
"<domain>");
228 "Query domains should always be quoted according to master file format.\n" 230 "For binary options, --FOO and --no-FOO are opposites, as are\n" 231 "-X and +X. In each case the default is the one not listed.\n" 232 "Per query options stay set a particular way until they are reset,\n" 233 "whether they appear on the command line or on stdin.\n" 234 "All global options must preceed the first query domain.\n" 236 "With -f, the input should be lines with either an option, possibly\n" 237 "with a value argument (separated from the option by a space if it's a long\n" 238 "option), or a domain (possibly preceded by a hyphen and a space to\n" 239 "distinguish it from an option).\n" 241 "Output format is master file format without class or TTL by default:\n" 242 " [<owner>] [<ttl>] [<type>] <data>\n" 243 "or if the <owner> domain refers to a CNAME and --show-cname is on\n" 244 " [<owner>] [<ttl>] CNAME <cname>\n" 245 " [<cname>] [<ttl>] <type> <data>\n" 246 "When a query fails you get an error message to stderr (with --fmt-simple).\n" 247 "Specify --fmt-inline for lines like this (broken here for readability):\n" 248 " ; failed <statustype> <statusnum> <statusabbrev> \\\n" 249 " [<owner>] [<ttl>] [<cname>] \"<status string>\"\n" 250 "If you use --fmt-asynch, which is the default for --asynch,\n" 251 "each answer (success or failure) is preceded by a line\n" 252 " <id> <nrrs> <statustype> <statusnum> <statusabbrev> \\\n" 253 " [<owner>] [<ttl>] [<cname>] \"<status string>\"\n" 254 "where <nrrs> is the number of RRs that follow and <cname> will be `$' or\n" 255 "the CNAME target; the CNAME indirection and error formats above are not used.\n" 259 " 1-6 at least one query failed with statustype:\n" 261 " 2 remotefail ) temporary errors\n" 262 " 3 tempfail __)_________________\n" 264 " 5 misquery ) permanent errors\n" 266 " 10 system trouble\n" 267 " 11 usage problems\n" 269 "Query types (see adns.h; default is addr):\n" 270 " ns soa ptr mx rp addr - enhanced versions\n" 271 " cname hinfo txt - types with only one version\n" 272 " a ns- soa- ptr- mx- rp- - _raw versions\n" 273 "Default is addr, or ptr for -i/--ptr queries\n",
288 typedef int comparer_type(
const char **optp,
const struct optioninfo *
entry);
290 static int oc_long(
const char **optp,
const struct optioninfo *
entry) {
294 static int oc_short(
const char **optp,
const struct optioninfo *
entry) {
306 static const struct optioninfo *find1(
const char **optp,
326 if (!oip)
usageerr(
"unknown option %s%s",prefix,opt);
327 if (
ads)
usageerr(
"global option %s%s specified after query domain(s)",prefix,opt);
335 static void noninvert(
const struct optioninfo *oip) {
336 usageerr(
"option %s%s%s%s%s may not be inverted",
338 oip->
lopt && oip->
sopt ?
" / " :
"",
343 const char *
arg,
const char *
arg2) {
351 if (
invert) noninvert(oip);
355 if (
invert) noninvert(oip);
static void printusage(void)
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
GLenum GLsizei GLenum GLenum const GLvoid * table
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
const struct optioninfo * opt_findl(const char *opt)
struct perqueryflags_remember ov_pqfr
#define VERSION_PRINT_QUIT(program)
void usageerr(const char *fmt,...)
void sysfail(const char *what, int errnoval)
static const struct optioninfo perquery_options[]
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
static const struct optioninfo global_options[]
enum optioninfo::oi_type type
void opt_do(const struct optioninfo *oip, int invert, const char *arg, const char *arg2)
int strcmp(const char *String1, const char *String2)
const struct optioninfo * opt_finds(const char **optp)
static int comparer(const void *a, const void *b)
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)