2000-04-19 23:23:31 +00:00
|
|
|
/*
|
2015-01-20 23:45:26 +00:00
|
|
|
* Copyright (C) 2004-2009, 2011-2015 Internet Systems Consortium, Inc. ("ISC")
|
2004-03-05 05:14:21 +00:00
|
|
|
* Copyright (C) 2000-2003 Internet Software Consortium.
|
2000-08-01 01:33:37 +00:00
|
|
|
*
|
2007-06-18 23:47:57 +00:00
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
2000-04-19 23:23:31 +00:00
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
2000-08-01 01:33:37 +00:00
|
|
|
*
|
2004-03-05 05:14:21 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
|
|
|
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
|
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
|
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
|
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
|
|
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
2000-04-19 23:23:31 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DIG_H
|
|
|
|
#define DIG_H
|
|
|
|
|
2005-04-27 04:57:32 +00:00
|
|
|
/*! \file */
|
|
|
|
|
2000-06-21 17:48:32 +00:00
|
|
|
#include <dns/rdatalist.h>
|
2001-08-08 22:54:55 +00:00
|
|
|
|
2000-06-21 17:48:32 +00:00
|
|
|
#include <dst/dst.h>
|
2001-08-08 22:54:55 +00:00
|
|
|
|
2000-06-21 17:48:32 +00:00
|
|
|
#include <isc/boolean.h>
|
2000-04-19 23:23:31 +00:00
|
|
|
#include <isc/buffer.h>
|
|
|
|
#include <isc/bufferlist.h>
|
2001-08-08 22:54:55 +00:00
|
|
|
#include <isc/formatcheck.h>
|
2000-06-21 17:48:32 +00:00
|
|
|
#include <isc/lang.h>
|
2000-04-19 23:23:31 +00:00
|
|
|
#include <isc/list.h>
|
2000-06-21 17:48:32 +00:00
|
|
|
#include <isc/mem.h>
|
2000-04-26 19:36:40 +00:00
|
|
|
#include <isc/print.h>
|
2000-06-21 17:48:32 +00:00
|
|
|
#include <isc/sockaddr.h>
|
|
|
|
#include <isc/socket.h>
|
2000-04-19 23:23:31 +00:00
|
|
|
|
2005-03-31 02:36:05 +00:00
|
|
|
#define MXSERV 20
|
2000-08-09 00:09:36 +00:00
|
|
|
#define MXNAME (DNS_NAME_MAXTEXT+1)
|
2000-04-19 23:23:31 +00:00
|
|
|
#define MXRD 32
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% Buffer Size */
|
2000-04-19 23:23:31 +00:00
|
|
|
#define BUFSIZE 512
|
2000-06-23 02:56:10 +00:00
|
|
|
#define COMMSIZE 0xffff
|
2001-10-04 03:20:23 +00:00
|
|
|
#ifndef RESOLV_CONF
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% location of resolve.conf */
|
2001-10-04 03:20:23 +00:00
|
|
|
#define RESOLV_CONF "/etc/resolv.conf"
|
|
|
|
#endif
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% output buffer */
|
2000-05-24 19:27:01 +00:00
|
|
|
#define OUTPUTBUF 32767
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% Max RR Limit */
|
2000-11-21 20:55:00 +00:00
|
|
|
#define MAXRRLIMIT 0xffffffff
|
|
|
|
#define MAXTIMEOUT 0xffff
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% Max number of tries */
|
2000-11-21 21:40:12 +00:00
|
|
|
#define MAXTRIES 0xffffffff
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% Max number of dots */
|
2000-11-21 20:55:00 +00:00
|
|
|
#define MAXNDOTS 0xffff
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% Max number of ports */
|
2000-11-21 20:55:00 +00:00
|
|
|
#define MAXPORT 0xffff
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% Max serial number */
|
2000-11-21 20:55:00 +00:00
|
|
|
#define MAXSERIAL 0xffffffff
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% Default TCP Timeout */
|
2000-07-18 01:28:20 +00:00
|
|
|
#define TCP_TIMEOUT 10
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% Default UDP Timeout */
|
2000-07-18 01:28:20 +00:00
|
|
|
#define UDP_TIMEOUT 5
|
2000-07-10 17:25:59 +00:00
|
|
|
|
2000-09-21 22:46:39 +00:00
|
|
|
#define SERVER_TIMEOUT 1
|
|
|
|
|
2000-05-06 01:16:07 +00:00
|
|
|
#define LOOKUP_LIMIT 64
|
2005-04-27 04:57:32 +00:00
|
|
|
/*%
|
2000-07-05 19:31:26 +00:00
|
|
|
* Lookup_limit is just a limiter, keeping too many lookups from being
|
2000-05-06 01:16:07 +00:00
|
|
|
* created. It's job is mainly to prevent the program from running away
|
|
|
|
* in a tight loop of constant lookups. It's value is arbitrary.
|
|
|
|
*/
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2004-06-19 02:23:36 +00:00
|
|
|
/*
|
|
|
|
* Defaults for the sigchase suboptions. Consolidated here because
|
|
|
|
* these control the layout of dig_lookup_t (among other things).
|
|
|
|
*/
|
|
|
|
#ifdef DIG_SIGCHASE
|
|
|
|
#ifndef DIG_SIGCHASE_BU
|
|
|
|
#define DIG_SIGCHASE_BU 1
|
|
|
|
#endif
|
|
|
|
#ifndef DIG_SIGCHASE_TD
|
|
|
|
#define DIG_SIGCHASE_TD 1
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2000-04-19 23:23:31 +00:00
|
|
|
ISC_LANG_BEGINDECLS
|
|
|
|
|
|
|
|
typedef struct dig_lookup dig_lookup_t;
|
|
|
|
typedef struct dig_query dig_query_t;
|
|
|
|
typedef struct dig_server dig_server_t;
|
2004-04-13 02:54:15 +00:00
|
|
|
#ifdef DIG_SIGCHASE
|
2004-04-13 02:39:35 +00:00
|
|
|
typedef struct dig_message dig_message_t;
|
|
|
|
#endif
|
2000-07-14 16:35:30 +00:00
|
|
|
typedef ISC_LIST(dig_server_t) dig_serverlist_t;
|
2000-05-02 23:23:12 +00:00
|
|
|
typedef struct dig_searchlist dig_searchlist_t;
|
2000-04-19 23:23:31 +00:00
|
|
|
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% The dig_lookup structure */
|
2000-04-19 23:23:31 +00:00
|
|
|
struct dig_lookup {
|
2000-05-12 01:02:37 +00:00
|
|
|
isc_boolean_t
|
2008-04-03 02:01:08 +00:00
|
|
|
pending, /*%< Pending a successful answer */
|
2000-04-20 19:09:11 +00:00
|
|
|
waiting_connect,
|
2000-04-28 21:41:19 +00:00
|
|
|
doing_xfr,
|
2005-04-27 04:57:32 +00:00
|
|
|
ns_search_only, /*%< dig +nssearch, host -C */
|
|
|
|
identify, /*%< Append an "on server <foo>" message */
|
|
|
|
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
|
2001-02-17 01:05:30 +00:00
|
|
|
message, with newline and tab */
|
2000-09-13 00:03:28 +00:00
|
|
|
ignore,
|
2000-05-06 01:16:07 +00:00
|
|
|
recurse,
|
2000-05-08 22:51:08 +00:00
|
|
|
aaonly,
|
2000-06-16 18:00:05 +00:00
|
|
|
adflag,
|
|
|
|
cdflag,
|
2014-10-31 10:16:00 +11:00
|
|
|
zflag,
|
2005-04-27 04:57:32 +00:00
|
|
|
trace, /*% dig +trace */
|
|
|
|
trace_root, /*% initial query for either +trace or +nssearch */
|
2000-05-12 01:02:37 +00:00
|
|
|
tcp_mode,
|
2014-05-14 09:59:02 +10:00
|
|
|
tcp_mode_set,
|
2002-07-25 05:46:07 +00:00
|
|
|
ip6_int,
|
2000-05-12 01:02:37 +00:00
|
|
|
comments,
|
|
|
|
stats,
|
|
|
|
section_question,
|
|
|
|
section_answer,
|
|
|
|
section_authority,
|
2000-05-24 19:49:51 +00:00
|
|
|
section_additional,
|
2000-09-28 23:02:28 +00:00
|
|
|
servfail_stops,
|
2000-10-13 17:54:00 +00:00
|
|
|
new_search,
|
2006-12-07 05:52:16 +00:00
|
|
|
need_search,
|
|
|
|
done_as_is,
|
2000-11-13 21:34:03 +00:00
|
|
|
besteffort,
|
2008-04-03 02:01:08 +00:00
|
|
|
dnssec,
|
2014-02-20 14:56:20 +11:00
|
|
|
expire,
|
2014-02-19 12:53:42 +11:00
|
|
|
#ifdef ISC_PLATFORM_USESIT
|
|
|
|
sit,
|
|
|
|
#endif
|
2014-10-30 11:42:02 +11:00
|
|
|
nsid, /*% Name Server ID (RFC 5001) */
|
2014-10-30 23:13:12 +11:00
|
|
|
header_only,
|
|
|
|
ednsneg;
|
2004-04-13 02:54:15 +00:00
|
|
|
#ifdef DIG_SIGCHASE
|
2004-04-13 02:39:35 +00:00
|
|
|
isc_boolean_t sigchase;
|
2004-04-13 02:54:15 +00:00
|
|
|
#if DIG_SIGCHASE_TD
|
2008-04-03 02:01:08 +00:00
|
|
|
isc_boolean_t do_topdown,
|
|
|
|
trace_root_sigchase,
|
|
|
|
rdtype_sigchaseset,
|
|
|
|
rdclass_sigchaseset;
|
2004-04-13 02:39:35 +00:00
|
|
|
/* Name we are going to validate RRset */
|
2008-04-03 02:01:08 +00:00
|
|
|
char textnamesigchase[MXNAME];
|
2004-04-13 02:39:35 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2008-04-03 02:01:08 +00:00
|
|
|
|
2005-04-27 04:57:32 +00:00
|
|
|
char textname[MXNAME]; /*% Name we're going to be looking up */
|
2000-09-29 23:42:15 +00:00
|
|
|
char cmdline[MXNAME];
|
2000-07-18 01:28:20 +00:00
|
|
|
dns_rdatatype_t rdtype;
|
2001-07-28 00:11:15 +00:00
|
|
|
dns_rdatatype_t qrdtype;
|
2004-04-13 02:54:15 +00:00
|
|
|
#if DIG_SIGCHASE_TD
|
2008-04-03 02:01:08 +00:00
|
|
|
dns_rdatatype_t rdtype_sigchase;
|
|
|
|
dns_rdatatype_t qrdtype_sigchase;
|
|
|
|
dns_rdataclass_t rdclass_sigchase;
|
2004-04-13 02:39:35 +00:00
|
|
|
#endif
|
2000-07-18 01:28:20 +00:00
|
|
|
dns_rdataclass_t rdclass;
|
2000-12-08 17:06:52 +00:00
|
|
|
isc_boolean_t rdtypeset;
|
|
|
|
isc_boolean_t rdclassset;
|
2000-04-19 23:23:31 +00:00
|
|
|
char namespace[BUFSIZE];
|
2000-05-02 23:23:12 +00:00
|
|
|
char onamespace[BUFSIZE];
|
2000-04-19 23:23:31 +00:00
|
|
|
isc_buffer_t namebuf;
|
2000-05-02 23:23:12 +00:00
|
|
|
isc_buffer_t onamebuf;
|
2006-12-07 01:21:04 +00:00
|
|
|
isc_buffer_t renderbuf;
|
2000-07-13 01:22:38 +00:00
|
|
|
char *sendspace;
|
2000-04-19 23:23:31 +00:00
|
|
|
dns_name_t *name;
|
|
|
|
isc_timer_t *timer;
|
|
|
|
isc_interval_t interval;
|
|
|
|
dns_message_t *sendmsg;
|
2000-05-02 23:23:12 +00:00
|
|
|
dns_name_t *oname;
|
2000-04-19 23:23:31 +00:00
|
|
|
ISC_LINK(dig_lookup_t) link;
|
|
|
|
ISC_LIST(dig_query_t) q;
|
2012-10-18 17:50:07 -05:00
|
|
|
ISC_LIST(dig_query_t) connecting;
|
2000-09-21 22:46:39 +00:00
|
|
|
dig_query_t *current_query;
|
2000-07-14 16:35:30 +00:00
|
|
|
dig_serverlist_t my_server_list;
|
2000-05-02 23:23:12 +00:00
|
|
|
dig_searchlist_t *origin;
|
2000-04-20 19:09:11 +00:00
|
|
|
dig_query_t *xfr_q;
|
2000-11-21 21:40:12 +00:00
|
|
|
isc_uint32_t retries;
|
2000-05-06 01:16:07 +00:00
|
|
|
int nsfound;
|
2000-05-08 22:51:08 +00:00
|
|
|
isc_uint16_t udpsize;
|
2005-06-07 00:16:01 +00:00
|
|
|
isc_int16_t edns;
|
2000-06-02 18:45:33 +00:00
|
|
|
isc_uint32_t ixfr_serial;
|
|
|
|
isc_buffer_t rdatabuf;
|
|
|
|
char rdatastore[MXNAME];
|
2000-06-06 22:50:44 +00:00
|
|
|
dst_context_t *tsigctx;
|
|
|
|
isc_buffer_t *querysig;
|
2000-06-07 00:13:57 +00:00
|
|
|
isc_uint32_t msgcounter;
|
2004-10-07 02:21:48 +00:00
|
|
|
dns_fixedname_t fdomain;
|
2014-02-19 15:51:02 -08:00
|
|
|
isc_sockaddr_t *ecs_addr;
|
2014-02-19 12:53:42 +11:00
|
|
|
#ifdef ISC_PLATFORM_USESIT
|
|
|
|
char *sitvalue;
|
|
|
|
#endif
|
2014-04-18 09:52:12 +10:00
|
|
|
dns_ednsopt_t *ednsopts;
|
|
|
|
unsigned int ednsoptscnt;
|
2014-07-15 23:27:14 +10:00
|
|
|
isc_dscp_t dscp;
|
2014-09-13 19:13:59 +10:00
|
|
|
unsigned int ednsflags;
|
2015-05-19 12:46:06 +10:00
|
|
|
dns_opcode_t opcode;
|
2000-04-19 23:23:31 +00:00
|
|
|
};
|
|
|
|
|
2005-04-27 04:57:32 +00:00
|
|
|
/*% The dig_query structure */
|
2000-04-19 23:23:31 +00:00
|
|
|
struct dig_query {
|
|
|
|
dig_lookup_t *lookup;
|
2000-07-27 19:06:12 +00:00
|
|
|
isc_boolean_t waiting_connect,
|
2006-10-02 03:08:34 +00:00
|
|
|
pending_free,
|
2006-12-07 01:21:04 +00:00
|
|
|
waiting_senddone,
|
2000-04-19 23:23:31 +00:00
|
|
|
first_pass,
|
2000-06-02 18:45:33 +00:00
|
|
|
first_soa_rcvd,
|
|
|
|
second_rr_rcvd,
|
2000-09-21 22:46:39 +00:00
|
|
|
first_repeat_rcvd,
|
2003-07-17 07:42:00 +00:00
|
|
|
recv_made,
|
|
|
|
warn_id;
|
2000-06-02 18:45:33 +00:00
|
|
|
isc_uint32_t first_rr_serial;
|
|
|
|
isc_uint32_t second_rr_serial;
|
2002-05-29 05:31:05 +00:00
|
|
|
isc_uint32_t msg_count;
|
2000-07-20 19:41:44 +00:00
|
|
|
isc_uint32_t rr_count;
|
2014-01-06 06:22:30 +11:00
|
|
|
isc_boolean_t ixfr_axfr;
|
2000-04-19 23:23:31 +00:00
|
|
|
char *servname;
|
2004-09-06 01:24:44 +00:00
|
|
|
char *userarg;
|
2000-04-19 23:23:31 +00:00
|
|
|
isc_bufferlist_t sendlist,
|
|
|
|
recvlist,
|
|
|
|
lengthlist;
|
|
|
|
isc_buffer_t recvbuf,
|
2000-04-20 19:09:11 +00:00
|
|
|
lengthbuf,
|
|
|
|
slbuf;
|
2000-07-13 01:22:38 +00:00
|
|
|
char *recvspace,
|
2000-04-20 19:09:11 +00:00
|
|
|
lengthspace[4],
|
|
|
|
slspace[4];
|
2000-04-19 23:23:31 +00:00
|
|
|
isc_socket_t *sock;
|
|
|
|
ISC_LINK(dig_query_t) link;
|
2012-10-18 17:50:07 -05:00
|
|
|
ISC_LINK(dig_query_t) clink;
|
2000-04-19 23:23:31 +00:00
|
|
|
isc_sockaddr_t sockaddr;
|
2000-05-02 23:23:12 +00:00
|
|
|
isc_time_t time_sent;
|
2014-07-31 07:39:59 +10:00
|
|
|
isc_time_t time_recv;
|
2004-10-21 01:44:24 +00:00
|
|
|
isc_uint64_t byte_count;
|
2006-12-07 01:21:04 +00:00
|
|
|
isc_buffer_t sendbuf;
|
2000-04-19 23:23:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct dig_server {
|
|
|
|
char servername[MXNAME];
|
2004-09-06 01:24:44 +00:00
|
|
|
char userarg[MXNAME];
|
2000-04-19 23:23:31 +00:00
|
|
|
ISC_LINK(dig_server_t) link;
|
|
|
|
};
|
|
|
|
|
2000-05-02 23:23:12 +00:00
|
|
|
struct dig_searchlist {
|
|
|
|
char origin[MXNAME];
|
|
|
|
ISC_LINK(dig_searchlist_t) link;
|
|
|
|
};
|
2004-04-13 02:54:15 +00:00
|
|
|
#ifdef DIG_SIGCHASE
|
2004-04-13 02:39:35 +00:00
|
|
|
struct dig_message {
|
2008-04-03 02:01:08 +00:00
|
|
|
dns_message_t *msg;
|
2004-04-13 02:39:35 +00:00
|
|
|
ISC_LINK(dig_message_t) link;
|
|
|
|
};
|
|
|
|
#endif
|
2005-07-04 03:03:21 +00:00
|
|
|
|
|
|
|
typedef ISC_LIST(dig_searchlist_t) dig_searchlistlist_t;
|
|
|
|
typedef ISC_LIST(dig_lookup_t) dig_lookuplist_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Externals from dighost.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern dig_lookuplist_t lookup_list;
|
|
|
|
extern dig_serverlist_t server_list;
|
|
|
|
extern dig_searchlistlist_t search_list;
|
|
|
|
extern unsigned int extrabytes;
|
|
|
|
|
2005-08-25 00:40:50 +00:00
|
|
|
extern isc_boolean_t check_ra, have_ipv4, have_ipv6, specified_source,
|
2008-04-03 02:01:08 +00:00
|
|
|
usesearch, showsearch, qr;
|
2005-07-04 03:03:21 +00:00
|
|
|
extern in_port_t port;
|
|
|
|
extern unsigned int timeout;
|
|
|
|
extern isc_mem_t *mctx;
|
|
|
|
extern int sendcount;
|
|
|
|
extern int ndots;
|
|
|
|
extern int lookup_counter;
|
|
|
|
extern int exitcode;
|
|
|
|
extern isc_sockaddr_t bind_address;
|
|
|
|
extern char keynametext[MXNAME];
|
|
|
|
extern char keyfile[MXNAME];
|
|
|
|
extern char keysecret[MXNAME];
|
2006-01-27 02:35:15 +00:00
|
|
|
extern dns_name_t *hmacname;
|
|
|
|
extern unsigned int digestbits;
|
2005-07-04 03:03:21 +00:00
|
|
|
#ifdef DIG_SIGCHASE
|
|
|
|
extern char trustedkey[MXNAME];
|
|
|
|
#endif
|
|
|
|
extern dns_tsigkey_t *key;
|
|
|
|
extern isc_boolean_t validated;
|
|
|
|
extern isc_taskmgr_t *taskmgr;
|
|
|
|
extern isc_task_t *global_task;
|
|
|
|
extern isc_boolean_t free_now;
|
2013-10-25 10:09:33 +11:00
|
|
|
extern isc_boolean_t debugging, debugtiming, memdebugging;
|
2013-11-07 10:50:01 +11:00
|
|
|
extern isc_boolean_t keep_open;
|
2005-07-04 03:03:21 +00:00
|
|
|
|
|
|
|
extern char *progname;
|
|
|
|
extern int tries;
|
|
|
|
extern int fatalexit;
|
2014-04-17 17:04:51 -07:00
|
|
|
extern isc_boolean_t verbose;
|
2007-02-26 00:27:09 +00:00
|
|
|
#ifdef WITH_IDN
|
|
|
|
extern int idnoptions;
|
|
|
|
#endif
|
2005-07-04 03:03:21 +00:00
|
|
|
|
2000-06-01 18:49:22 +00:00
|
|
|
/*
|
|
|
|
* Routines in dighost.c.
|
|
|
|
*/
|
2008-12-16 02:57:24 +00:00
|
|
|
isc_result_t
|
2015-04-17 02:57:02 +02:00
|
|
|
get_address(char *host, in_port_t myport, isc_sockaddr_t *sockaddr);
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2011-02-25 23:11:13 +00:00
|
|
|
int
|
2011-12-07 17:23:28 +00:00
|
|
|
getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp);
|
2011-02-25 23:11:13 +00:00
|
|
|
|
2000-10-23 23:13:21 +00:00
|
|
|
isc_result_t
|
2003-07-25 04:02:54 +00:00
|
|
|
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t ip6_int,
|
2001-10-04 06:56:37 +00:00
|
|
|
isc_boolean_t strict);
|
2000-10-23 23:13:21 +00:00
|
|
|
|
2009-09-29 15:06:07 +00:00
|
|
|
ISC_PLATFORM_NORETURN_PRE void
|
|
|
|
fatal(const char *format, ...)
|
|
|
|
ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2000-04-29 00:12:56 +00:00
|
|
|
void
|
2001-08-08 22:54:55 +00:00
|
|
|
debug(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2000-05-05 18:22:16 +00:00
|
|
|
void
|
2000-06-01 18:49:22 +00:00
|
|
|
check_result(isc_result_t result, const char *msg);
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2014-08-21 18:05:55 +10:00
|
|
|
isc_boolean_t
|
2000-04-26 18:34:17 +00:00
|
|
|
setup_lookup(dig_lookup_t *lookup);
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2007-04-03 23:06:39 +00:00
|
|
|
void
|
|
|
|
destroy_lookup(dig_lookup_t *lookup);
|
|
|
|
|
2000-04-26 18:34:17 +00:00
|
|
|
void
|
2000-05-12 01:02:37 +00:00
|
|
|
do_lookup(dig_lookup_t *lookup);
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2000-04-26 18:34:17 +00:00
|
|
|
void
|
2000-07-05 19:31:26 +00:00
|
|
|
start_lookup(void);
|
|
|
|
|
2000-07-10 18:02:31 +00:00
|
|
|
void
|
|
|
|
onrun_callback(isc_task_t *task, isc_event_t *event);
|
|
|
|
|
2000-05-09 18:05:13 +00:00
|
|
|
int
|
|
|
|
dhmain(int argc, char **argv);
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2000-05-09 18:05:13 +00:00
|
|
|
void
|
|
|
|
setup_libs(void);
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2000-05-09 18:05:13 +00:00
|
|
|
void
|
|
|
|
setup_system(void);
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2009-09-15 03:13:44 +00:00
|
|
|
isc_result_t
|
|
|
|
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
|
|
|
|
const char *desc);
|
|
|
|
|
2014-09-13 19:13:59 +10:00
|
|
|
isc_result_t
|
|
|
|
parse_xint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
|
|
|
|
const char *desc);
|
|
|
|
|
2014-02-19 15:51:02 -08:00
|
|
|
isc_result_t
|
|
|
|
parse_netprefix(isc_sockaddr_t **sap, const char *value);
|
|
|
|
|
2009-09-15 03:13:44 +00:00
|
|
|
void
|
|
|
|
parse_hmac(const char *hmacstr);
|
|
|
|
|
2000-06-01 18:49:22 +00:00
|
|
|
dig_lookup_t *
|
|
|
|
requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
|
2000-05-09 18:05:13 +00:00
|
|
|
|
2000-07-13 18:52:58 +00:00
|
|
|
dig_lookup_t *
|
|
|
|
make_empty_lookup(void);
|
|
|
|
|
|
|
|
dig_lookup_t *
|
|
|
|
clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
|
|
|
|
|
2000-07-14 16:35:30 +00:00
|
|
|
dig_server_t *
|
2004-09-06 01:24:44 +00:00
|
|
|
make_server(const char *servname, const char *userarg);
|
2000-07-14 16:35:30 +00:00
|
|
|
|
2002-08-12 18:25:25 +00:00
|
|
|
void
|
|
|
|
flush_server_list(void);
|
|
|
|
|
|
|
|
void
|
|
|
|
set_nameserver(char *opt);
|
|
|
|
|
2000-07-14 16:35:30 +00:00
|
|
|
void
|
2000-08-01 01:33:37 +00:00
|
|
|
clone_server_list(dig_serverlist_t src,
|
2000-07-14 16:35:30 +00:00
|
|
|
dig_serverlist_t *dest);
|
2000-04-26 18:34:17 +00:00
|
|
|
|
2000-07-14 17:57:27 +00:00
|
|
|
void
|
|
|
|
cancel_all(void);
|
|
|
|
|
|
|
|
void
|
|
|
|
destroy_libs(void);
|
|
|
|
|
2001-01-18 05:12:44 +00:00
|
|
|
void
|
|
|
|
set_search_domain(char *domain);
|
|
|
|
|
2004-04-13 02:54:15 +00:00
|
|
|
#ifdef DIG_SIGCHASE
|
2004-04-13 02:39:35 +00:00
|
|
|
void
|
|
|
|
clean_trustedkey(void);
|
|
|
|
#endif
|
|
|
|
|
2000-06-01 18:49:22 +00:00
|
|
|
/*
|
2001-01-24 19:28:34 +00:00
|
|
|
* Routines to be defined in dig.c, host.c, and nslookup.c.
|
2000-06-01 18:49:22 +00:00
|
|
|
*/
|
2004-04-13 02:54:15 +00:00
|
|
|
#ifdef DIG_SIGCHASE
|
2004-04-13 02:39:35 +00:00
|
|
|
isc_result_t
|
|
|
|
printrdataset(dns_name_t *owner_name, dns_rdataset_t *rdataset,
|
|
|
|
isc_buffer_t *target);
|
|
|
|
#endif
|
2001-01-24 19:28:34 +00:00
|
|
|
|
2000-04-26 18:34:17 +00:00
|
|
|
isc_result_t
|
2000-06-01 18:49:22 +00:00
|
|
|
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers);
|
2005-04-27 04:57:32 +00:00
|
|
|
/*%<
|
2001-01-24 19:28:34 +00:00
|
|
|
* Print the final result of the lookup.
|
|
|
|
*/
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2000-04-26 18:34:17 +00:00
|
|
|
void
|
2001-01-24 19:28:34 +00:00
|
|
|
received(int bytes, isc_sockaddr_t *from, dig_query_t *query);
|
2005-04-27 04:57:32 +00:00
|
|
|
/*%<
|
2001-01-24 19:28:34 +00:00
|
|
|
* Print a message about where and when the response
|
|
|
|
* was received from, like the final comment in the
|
|
|
|
* output of "dig".
|
|
|
|
*/
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2000-05-02 23:23:12 +00:00
|
|
|
void
|
2001-07-27 05:26:38 +00:00
|
|
|
trying(char *frm, dig_lookup_t *lookup);
|
2000-07-05 19:31:26 +00:00
|
|
|
|
2000-05-12 01:02:37 +00:00
|
|
|
void
|
|
|
|
dighost_shutdown(void);
|
2000-04-26 18:34:17 +00:00
|
|
|
|
2000-09-21 23:47:41 +00:00
|
|
|
char *
|
|
|
|
next_token(char **stringp, const char *delim);
|
|
|
|
|
2004-04-13 02:54:15 +00:00
|
|
|
#ifdef DIG_SIGCHASE
|
2004-04-13 02:39:35 +00:00
|
|
|
/* Chasing functions */
|
|
|
|
dns_rdataset_t *
|
|
|
|
chase_scanname(dns_name_t *name, dns_rdatatype_t type, dns_rdatatype_t covers);
|
|
|
|
void
|
|
|
|
chase_sig(dns_message_t *msg);
|
|
|
|
#endif
|
|
|
|
|
2014-04-18 09:52:12 +10:00
|
|
|
void save_opt(dig_lookup_t *lookup, char *code, char *value);
|
|
|
|
|
2014-04-18 07:27:50 -07:00
|
|
|
void setup_file_key(void);
|
|
|
|
void setup_text_key(void);
|
|
|
|
|
2000-04-19 23:23:31 +00:00
|
|
|
ISC_LANG_ENDDECLS
|
|
|
|
|
|
|
|
#endif
|