dig.c revision 24139527f3d0d3fe743bd867329a2edd529728a6
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * Copyright (C) 2000 Internet Software Consortium.
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * Permission to use, copy, modify, and distribute this software for any
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * purpose with or without fee is hereby granted, provided that the above
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * copyright notice and this permission notice appear in all copies.
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
a453f5b98e8f31889cde087403395d672f9df698Michael Graff * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
a453f5b98e8f31889cde087403395d672f9df698Michael Graff/* $Id: dig.c,v 1.55 2000/07/05 19:31:22 gson Exp $ */
a453f5b98e8f31889cde087403395d672f9df698Michael Graff#define ADD_STRING(b, s) { \
a453f5b98e8f31889cde087403395d672f9df698Michael Graff if (strlen(s) >= isc_buffer_availablelength(b)) \
a453f5b98e8f31889cde087403395d672f9df698Michael Graffextern isc_boolean_t have_ipv6, show_details, specified_source,
a453f5b98e8f31889cde087403395d672f9df698Michael Graffextern unsigned int timeout;
a453f5b98e8f31889cde087403395d672f9df698Michael Graffisc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE;
a453f5b98e8f31889cde087403395d672f9df698Michael Graffstatic const char *opcodetext[] = {
a453f5b98e8f31889cde087403395d672f9df698Michael Graff "RESERVED10",
a453f5b98e8f31889cde087403395d672f9df698Michael Graff "RESERVED11",
static const char *rcodetext[] = {
show_usage(void) {
, stderr);
dighost_shutdown(void) {
free_lists(0);
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;
sizeof(struct dig_server));
&& (!is_batchfile)) {
if (have_host)
&& (!is_batchfile)) {
if (have_host)
&& (!is_batchfile)) {
if (have_host)
&& (!is_batchfile)) {
if (have_host)
if (have_host)
if (have_host)
if (timeout <= 0)
if (have_host) {
if (tries <= 0)
if (have_host) {
if (bufsize <= 0)
bufsize = 0;
if (have_host) {
if (bufsize <= 0)
bufsize = 0;
if (ndots < 0)
ndots = 0;
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host) {
if (!forcecomment)
if (!forcecomment)
if (have_host)
if (have_host) {
if (!forcecomment) {
if (!forcecomment) {
if (have_host) {
if (have_host) {
if (!forcecomment) {
if (!forcecomment) {
if (have_host)
if (have_host)
if (have_host)
if (have_host) {
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host)
if (have_host) {
if (have_host) {
if (have_host) {
MXRD);
MXRD);
rv++;
rc--;
if (have_host) {
MXRD);
MXRD);
rv++;
rc--;
rv++;
rc--;
rv++;
rc--;
show_usage();
show_usage();
rv++;
rc--;
MXRD);
MXRD);
rv++;
rc--;
show_usage();
show_usage();
show_usage();
sizeof(struct dig_lookup));
adrs[i]);
rv++;
rc--;
if (have_host) {
MXRD);
sizeof(struct dig_lookup));
bargc++;
if (!is_batchfile)
setup_libs();
setup_system();
start_lookup();
isc_app_run();
if (isc_mem_debugging)
return (exitcode);