dig.c revision e2babfac176033ebae5b8faf59935b24f2458643
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater * Copyright (C) 2000 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Permission to use, copy, modify, and distribute this software for any
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * purpose with or without fee is hereby granted, provided that the above
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * copyright notice and this permission notice appear in all copies.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4be63b1fd8c18dbeca1648d6cf22fa14f057a469David Lawrence/* $Id: dig.c,v 1.113 2000/10/13 22:55:49 bwelling 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 tries;
extern int lookup_counter;
extern int exitcode;
char *argv0;
static const char *opcodetext[] = {
static const char *rcodetext[] = {
extern char *progname;
show_usage(void) {
, stderr);
* 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 (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
flags = 0;
if (!headers) {
if (headers) {
if (!short_form) {
goto question_again;
if (!short_form) {
goto answer_again;
if (!short_form) {
goto authority_again;
if (!short_form) {
goto additional_again;
if (headers) {
msg,
msg,
return (result);
if (printcmd) {
while (i < argc) {
if (first) {
char *ptr;
int end;
end--;
if (end == 0)
end--;
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;
goto need_value;
if (!state)
goto invalid_option;
if (ndots < 0)
ndots = 0;
if (state) {
goto invalid_option;
goto invalid_option;
goto need_value;
if (!state)
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;
goto invalid_option;
goto invalid_option;
#ifdef DNS_OPT_NEWCODES
if (!is_batchfile)
#ifdef DNS_OPT_NEWCODES
goto need_value;
if (!state)
goto invalid_option;
goto need_value;
if (!state)
goto invalid_option;
option);
show_usage();
static isc_boolean_t
return (ISC_FALSE);
show_usage();
exit(0);
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_FALSE);
goto invalid_option;
return (value_from_next);
value);
return (value_from_next);
return (value_from_next);
return (value_from_next);
return (value_from_next);
return (value_from_next);
value);
return (value_from_next);
show_usage();
show_usage();
return (value_from_next);
show_usage();
adrs[i]);
MXNAME);
MXNAME);
isc_buffer_t b;
show_usage();
name);
show_usage();
isc_buffer_putuint8(&b, 0);
show_usage();
return (value_from_next);
show_usage();
return (ISC_FALSE);
int bargc;
int rc;
char **rv;
#ifndef NOPOSIX
char *homedir;
char *input;
if (!is_batchfile) {
#ifndef NOPOSIX
batchfp) != 0) {
bargc++;
(char **)bargv);
lookup);
rc--;
rv++;
rc--;
rv++;
if (open_type_class) {
if (!config_only) {
ISC_TRUE);
if (firstarg) {
goto next_line;
bargc++;
* 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);