ldns: Update local files for update to 1.6.11
[dragonfly.git] / usr.bin / drill / drill.h
CommitLineData
286a6bf8
JL
1/*
2 * drill.h
3 * the main header file of drill
4 * (c) 2005, 2006 NLnet Labs
5 *
6 * See the file LICENSE for the license
7 *
8 */
9#ifndef _DRILL_H_
10#define _DRILL_H_
11#include "config.h"
12
13#include "drill_util.h"
14
de9b0015 15#define DRILL_VERSION "1.6.11"
286a6bf8
JL
16
17/* what kind of stuff do we allow */
18#define DRILL_QUERY 0
19#define DRILL_TRACE 1
20#define DRILL_CHASE 2
21#define DRILL_AFROMFILE 3
22#define DRILL_QTOFILE 4
23#define DRILL_NSEC 5
24#define DRILL_REVERSE 6
25#define DRILL_SECTRACE 7
26
27#define DRILL_ON(VAR, BIT) \
28(VAR) = (VAR) | (BIT)
29#define DRILL_OFF(VAR, BIT) \
30(VAR) = (VAR) & ~(BIT)
31
32extern ldns_rr_list *global_dns_root;
33extern bool qds;
34extern int verbosity;
35
36ldns_pkt *do_trace(ldns_resolver *res,
37 ldns_rdf *name,
38 ldns_rr_type type,
39 ldns_rr_class c);
40ldns_status do_chase(ldns_resolver *res,
41 ldns_rdf *name,
42 ldns_rr_type type,
43 ldns_rr_class c,
44 ldns_rr_list *trusted_keys,
45 ldns_pkt *pkt_o,
46 uint16_t qflags,
47 ldns_rr_list *prev_key_list,
48 int verbosity);
49int do_secure_trace(ldns_resolver *res,
50 ldns_rdf *name,
51 ldns_rr_type type,
52 ldns_rr_class c,
53 ldns_rr_list *trusted_keys,
54 ldns_rdf *start_name);
55
56ldns_rr_list * get_rr(ldns_resolver *res,
57 ldns_rdf *zname,
58 ldns_rr_type t,
59 ldns_rr_class c);
60
61void drill_pkt_print(FILE *fd, ldns_resolver *r, ldns_pkt *p);
62void drill_pkt_print_footer(FILE *fd, ldns_resolver *r, ldns_pkt *p);
63
64ldns_pkt_type get_dnssec_rr(ldns_pkt *p,
65 ldns_rdf *name,
66 ldns_rr_type t,
67 ldns_rr_list **rrlist,
68 ldns_rr_list **sig);
69
70ldns_rr *ldns_nsec3_exact_match(ldns_rdf *qname,
71 ldns_rr_type qtype,
72 ldns_rr_list *nsec3s);
73
74ldns_rdf *ldns_nsec3_closest_encloser(ldns_rdf *qname,
75 ldns_rr_type qtype,
76 ldns_rr_list *nsec3s);
77
78/* verifies denial of existence of *name in *pkt (must contain NSEC or NSEC3 records
79 * if *nsec_rrs and *nsec_rr_sigs are given, pointers to the relevant nsecs and their signatures are
80 * placed there
81 */
82ldns_status ldns_verify_denial(ldns_pkt *pkt,
83 ldns_rdf *name,
84 ldns_rr_type type,
85 ldns_rr_list **nsec_rrs,
86 ldns_rr_list **nsec_rr_sigs);
87ldns_status ldns_verify_denial_wildcard(ldns_pkt *pkt,
88 ldns_rdf *name,
89 ldns_rr_type type,
90 ldns_rr_list **nsec_rrs,
91 ldns_rr_list **nsec_rr_sigs);
92
93ldns_status read_key_file(const char *filename, ldns_rr_list *key_list);
94ldns_pkt *read_hex_pkt(char *filename);
95ldns_buffer *read_hex_buffer(char *filename);
96void init_root(void);
97ldns_rr_list *read_root_hints(const char *filename);
98void clear_root(void);
99void dump_hex(const ldns_pkt *pkt, const char *file);
100void warning(const char *fmt, ...);
101void error(const char *fmt, ...);
102void mesg(const char *fmt, ...);
103
104/* screen.c */
105void resolver_print_nameservers(ldns_resolver *r);
106void print_dnskey(ldns_rr_list *key_list);
107void print_ds(ldns_rr_list *ds_list);
108
109#endif /* _DRILL_H_ */