Merge from vendor branch NTPD:
[dragonfly.git] / contrib / bind-9.2.4rc7 / bin / dnssec / dnssectool.h
1 /*
2  * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 2000, 2001  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and 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.15.2.1 2004/03/09 06:09:16 marka 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 typedef void (fatalcallback_t)(void);
29
30 void
31 fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
32
33 void
34 setfatalcallback(fatalcallback_t *callback);
35
36 void
37 check_result(isc_result_t result, const char *message);
38
39 void
40 vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
41
42 void
43 type_format(const dns_rdatatype_t type, char *cp, unsigned int size);
44 #define TYPE_FORMATSIZE 10
45
46 void
47 alg_format(const dns_secalg_t alg, char *cp, unsigned int size);
48 #define ALG_FORMATSIZE 10
49
50 void
51 sig_format(dns_rdata_sig_t *sig, char *cp, unsigned int size);
52 #define SIG_FORMATSIZE (DNS_NAME_FORMATSIZE + ALG_FORMATSIZE + sizeof("65535"))
53
54 void
55 key_format(const dst_key_t *key, char *cp, unsigned int size);
56 #define KEY_FORMATSIZE (DNS_NAME_FORMATSIZE + ALG_FORMATSIZE + sizeof("65535"))
57
58 void
59 setup_logging(int verbose, isc_mem_t *mctx, isc_log_t **logp);
60
61 void
62 cleanup_logging(isc_log_t **logp);
63
64 void
65 setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx);
66
67 void
68 cleanup_entropy(isc_entropy_t **ectx);
69
70 isc_stdtime_t
71 strtotime(char *str, isc_int64_t now, isc_int64_t base);
72
73 #endif /* DNSSEC_DNSSECTOOL_H */