dig.c revision 1b5b46942d149f891bb91e90c6f52944b77c8a68
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2000, 2001 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
693d70f96fc2b3c1830580edcc29146afd6a9f61Mark Andrews/* $Id: dig.c,v 1.180 2002/08/29 07:45:04 marka Exp $ */
#define ADD_STRING(b, s) { \
return (ISC_R_NOSPACE); \
isc_buffer_putstr(b, s); \
extern unsigned int timeout;
extern int sendcount;
extern int ndots;
extern int lookup_counter;
extern int exitcode;
static char *argv0;
static const char *opcodetext[] = {
static const char *rcodetext[] = {
extern char *progname;
usage(void) {
version(void) {
help(void) {
stdout);
* Callback from dighost.c to print the received message.
if (!validated)
* Callback from dighost.c to print that it is trying a server.
static isc_result_t
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
buf);
return (result);
return (ISC_R_SUCCESS);
* Callback from dighost.c to print the reply from a server
unsigned int styleflags = 0;
if (nottl)
if (noclass)
if (multiline) {
if (!short_form)
flags = 0;
if (!headers) {
if (headers) {
goto repopulate_buffer;
goto cleanup;
if (!short_form) {
goto buftoosmall;
if (!short_form) {
goto buftoosmall;
goto buftoosmall;
if (!short_form) {
goto buftoosmall;
if (!short_form) {
goto buftoosmall;
if (headers) {
msg,
goto buftoosmall;
msg,
goto buftoosmall;
return (result);
int remaining;
if (printcmd) {
while (i < argc) {
if (first) {
char *ptr;
int end;
end--;
if (end == 0)
end--;
static isc_uint32_t
return (tmp);
#define FULLCHECK(A) \
goto invalid_option; \
#define FULLCHECK2(A, B) \
goto invalid_option; \
switch (cmd[0]) {
goto invalid_option;
goto invalid_option;
goto need_value;
if (!state)
goto invalid_option;
goto invalid_option;
goto invalid_option;
goto need_value;
if (!state)
goto invalid_option;
goto invalid_option;
goto need_value;
if (!state)
goto invalid_option;
if (state) {
goto invalid_option;
goto invalid_option;
goto need_value;
if (!state)
goto invalid_option;
goto invalid_option;
goto invalid_option;
if (state) {
goto invalid_option;
if (!is_batchfile)
goto need_value;
if (!state)
goto invalid_option;
if (timeout == 0)
if (state) {
goto need_value;
if (!state)
goto invalid_option;
MAXTRIES);
goto invalid_option;
goto invalid_option;
if (!is_batchfile)
option);
usage();
static isc_boolean_t
switch (cmd) {
return (ISC_FALSE);
help();
exit(0);
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_FALSE);
version();
exit(0);
goto invalid_option;
switch (cmd) {
return (value_from_next);
value);
return (value_from_next);
return (value_from_next);
return (value_from_next);
return (value_from_next);
value);
return (value_from_next);
usage();
usage();
return (value_from_next);
== ISC_R_SUCCESS)
return (value_from_next);
usage();
return (ISC_FALSE);
int rc;
char **rv;
int bargc;
int rc;
char **rv;
#ifndef NOPOSIX
char *homedir;
char *input;
if (!is_batchfile) {
#ifndef NOPOSIX
homedir);
if (n < sizeof(rcfile))
batchfp) != 0) {
bargc++;
(char **)bargv);
lookup);
rc--;
rv++;
rc--;
rv++;
if (open_type_class) {
if (rdtype ==
if (!config_only) {
ISC_TRUE);
if (firstarg) {
goto next_line;
bargc++;
if (firstarg) {
* Callback from dighost.c to allow program-specific shutdown code. Here,
dighost_shutdown(void) {
int bargc;
char *input;
bargc++;
start_lookup();
setup_libs();
setup_system();
isc_app_run();
while (s != NULL) {
s, default_lookup);
s2 = s;
cancel_all();
destroy_libs();
return (exitcode);