Update repub branch u/fanf2/patch to rebasing branch u/fanf2/rebasing revision v9_13_...
[ipreg/bind9.git] / bin / dnssec / dnssectool.h
1 /*
2 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 *
8 * See the COPYRIGHT file distributed with this work for additional
9 * information regarding copyright ownership.
10 */
11
12
13 #ifndef DNSSECTOOL_H
14 #define DNSSECTOOL_H 1
15
16 #include <inttypes.h>
17 #include <stdbool.h>
18
19 #include <isc/log.h>
20 #include <isc/stdtime.h>
21 #include <dns/rdatastruct.h>
22 #include <dst/dst.h>
23
24 typedef void (fatalcallback_t)(void);
25
26 ISC_PLATFORM_NORETURN_PRE void
27 fatal(const char *format, ...)
28 ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
29
30 void
31 setfatalcallback(fatalcallback_t *callback);
32
33 void
34 check_result(isc_result_t result, const char *message);
35
36 void
37 vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
38
39 ISC_PLATFORM_NORETURN_PRE void
40 version(const char *program) ISC_PLATFORM_NORETURN_POST;
41
42 void
43 sig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size);
44 #define SIG_FORMATSIZE (DNS_NAME_FORMATSIZE + DNS_SECALG_FORMATSIZE + sizeof("65535"))
45
46 void
47 setup_logging(isc_mem_t *mctx, isc_log_t **logp);
48
49 void
50 cleanup_logging(isc_log_t **logp);
51
52 dns_ttl_t strtottl(const char *str);
53
54 isc_stdtime_t
55 strtotime(const char *str, int64_t now, int64_t base,
56 bool *setp);
57
58 unsigned int
59 strtodsdigest(const char *str);
60
61 dns_rdataclass_t
62 strtoclass(const char *str);
63
64 isc_result_t
65 try_dir(const char *dirname);
66
67 void
68 check_keyversion(dst_key_t *key, char *keystr);
69
70 void
71 set_keyversion(dst_key_t *key);
72
73 bool
74 key_collision(dst_key_t *key, dns_name_t *name, const char *dir,
75 isc_mem_t *mctx, bool *exact);
76
77 bool
78 isoptarg(const char *arg, char **argv, void (*usage)(void));
79
80 #ifdef _WIN32
81 void InitSockets(void);
82 void DestroySockets(void);
83 #endif
84
85 #endif /* DNSSEC_DNSSECTOOL_H */