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