dig.c revision 4b7d316065e104fcc3e9a985514442951b95a8de
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * Copyright (C) 2000 Internet Software Consortium.
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * Permission to use, copy, modify, and distribute this software for any
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * purpose with or without fee is hereby granted, provided that the above
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * copyright notice and this permission notice appear in all copies.
9fbefe0ace2ae7dba287f914b278153004bef428Bob Halley * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley/* $Id: dig.c,v 1.68 2000/07/14 21:33:02 mws Exp $ */
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley#define ADD_STRING(b, s) { \
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley if (strlen(s) >= isc_buffer_availablelength(b)) \
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halleyextern isc_boolean_t have_ipv6, show_details, specified_source,
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halleyextern unsigned int timeout;
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halleyisc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE;
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halleystatic const char *opcodetext[] = {
0fc87fa2f38df7b293b650deacfa5e6c3d50eff9Bob Halley "RESERVED3",
static const char *rcodetext[] = {
extern char *progname;
show_usage(void) {
, stderr);
dighost_shutdown(void) {
free_lists();
if (!validated)
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);
exitcode = 0;
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) {
char *ptr;
int end;
end--;
if (end == 0)
end--;
int bargc;
int rc;
char **rv;
char *ptr;
if (!is_batchfile)
&& (!is_batchfile)) {
&& (!is_batchfile)) {
&& (!is_batchfile)) {
&& (!is_batchfile)) {
if (timeout <= 0)
if (timeout <= 0)
if (ndots < 0)
ndots = 0;
if (!forcecomment)
if (!forcecomment) {
if (!forcecomment) {
MXRD);
MXRD);
rv++;
rc--;
MXRD);
MXRD);
rv++;
rc--;
rv++;
rc--;
rv++;
rc--;
show_usage();
show_usage();
rv++;
rc--;
MXRD);
MXRD);
rv++;
rc--;
show_usage();
show_usage();
show_usage();
adrs[i]);
rv++;
rc--;
MXRD);
bargc++;
if (!is_batchfile) {
while (s != NULL) {
s, default_lookup);
s2 = s;
setup_libs();
setup_system();
isc_app_run();
cancel_all();
destroy_libs();
return (exitcode);