dig.c revision 2caff6b7dfc0d15b9f53b865ee6936ddc840aeee
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * Copyright (C) 2000, 2001 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Permission to use, copy, modify, and distribute this software for any
e4bea1f716ba373cce734278c3067746f6a0fd59Mark Andrews * purpose with or without fee is hereby granted, provided that the above
e4bea1f716ba373cce734278c3067746f6a0fd59Mark 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.137 2001/02/14 01:46:03 tamino 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) {
goto buftoosmall;
if (!short_form) {
goto buftoosmall;
if (!short_form) {
goto buftoosmall;
if (!short_form) {
goto buftoosmall;
if (!short_form) {
goto buftoosmall;
if (headers) {
msg,
msg,
return (result);
if (printcmd) {
while (i < argc) {
if (first) {
char *ptr;
int end;
end--;
if (end == 0)
end--;
static isc_uint32_t
char *endp;
return (tmp);
switch (cmd[0]) {
goto invalid_option;
goto invalid_option;
goto need_value;
if (!state)
goto invalid_option;
COMMSIZE);
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 (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;
MAXTRIES);
goto invalid_option;
goto invalid_option;
#ifdef DNS_OPT_NEWCODES_LIVE
if (!is_batchfile)
#ifdef DNS_OPT_NEWCODES_LIVE
goto need_value;
if (!state)
goto invalid_option;
goto need_value;
if (!state)
goto invalid_option;
option);
show_usage();
static isc_boolean_t
switch (cmd) {
return (ISC_FALSE);
show_usage();
exit(0);
return (ISC_FALSE);
return (ISC_FALSE);
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);
show_usage();
show_usage();
return (value_from_next);
if (!orig_rdtypeset)
if (!orig_rdclassset)
return (value_from_next);
show_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
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);