]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/bind9/bin/dnssec/dnssectool.h
MFC r254651:
[FreeBSD/stable/9.git] / contrib / bind9 / bin / dnssec / dnssectool.h
1 /*
2  * Copyright (C) 2004, 2007-2012  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 2000, 2001, 2003  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  * PERFORMANCE OF THIS SOFTWARE.
16  */
17
18 /* $Id: dnssectool.h,v 1.33 2011/10/20 23:46:51 tbox Exp $ */
19
20 #ifndef DNSSECTOOL_H
21 #define DNSSECTOOL_H 1
22
23 #include <isc/log.h>
24 #include <isc/stdtime.h>
25 #include <dns/rdatastruct.h>
26 #include <dst/dst.h>
27
28 #define check_dns_dbiterator_current(result) \
29         check_result((result == DNS_R_NEWORIGIN) ? ISC_R_SUCCESS : result, \
30                      "dns_dbiterator_current()")
31
32
33 typedef void (fatalcallback_t)(void);
34
35 ISC_PLATFORM_NORETURN_PRE void
36 fatal(const char *format, ...)
37 ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
38
39 void
40 setfatalcallback(fatalcallback_t *callback);
41
42 void
43 check_result(isc_result_t result, const char *message);
44
45 void
46 vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
47
48 void
49 type_format(const dns_rdatatype_t type, char *cp, unsigned int size);
50 #define TYPE_FORMATSIZE 20
51
52 void
53 sig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size);
54 #define SIG_FORMATSIZE (DNS_NAME_FORMATSIZE + DNS_SECALG_FORMATSIZE + sizeof("65535"))
55
56 void
57 setup_logging(int verbose, isc_mem_t *mctx, isc_log_t **logp);
58
59 void
60 cleanup_logging(isc_log_t **logp);
61
62 void
63 setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx);
64
65 void
66 cleanup_entropy(isc_entropy_t **ectx);
67
68 dns_ttl_t strtottl(const char *str);
69
70 isc_stdtime_t
71 strtotime(const char *str, isc_int64_t now, isc_int64_t base);
72
73 dns_rdataclass_t
74 strtoclass(const char *str);
75
76 isc_result_t
77 try_dir(const char *dirname);
78
79 void
80 check_keyversion(dst_key_t *key, char *keystr);
81
82 void
83 set_keyversion(dst_key_t *key);
84
85 isc_boolean_t
86 key_collision(dst_key_t *key, dns_name_t *name, const char *dir,
87               isc_mem_t *mctx, isc_boolean_t *exact);
88
89 isc_boolean_t
90 is_delegation(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
91                       dns_name_t *name, dns_dbnode_t *node, isc_uint32_t *ttlp);
92
93 void
94 verifyzone(dns_db_t *db, dns_dbversion_t *ver,
95                    dns_name_t *origin, isc_mem_t *mctx,
96                    isc_boolean_t ignore_kskflag, isc_boolean_t keyset_kskonly);
97 #endif /* DNSSEC_DNSSECTOOL_H */