Update repub branch u/fanf2/patch to rebasing branch u/fanf2/rebasing revision v9_15_...
[ipreg/bind9.git] / bin / dnssec / dnssectool.h
CommitLineData
b1d234eb 1/*
843d3896 2 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
40f53fa8 3 *
0c27b3fe
MA
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/.
843d3896
OS
7 *
8 * See the COPYRIGHT file distributed with this work for additional
9 * information regarding copyright ownership.
b1d234eb
BW
10 */
11
9c3531d7 12
b1d234eb 13#ifndef DNSSECTOOL_H
7efc8c3f 14#define DNSSECTOOL_H 1
b1d234eb 15
cb6a185c 16#include <inttypes.h>
994e6569 17#include <stdbool.h>
cb6a185c 18
c9c1d174 19#include <isc/log.h>
42848e71 20#include <isc/stdtime.h>
565d0dc2 21#include <dns/rdatastruct.h>
4fc4813e 22#include <dst/dst.h>
c9c1d174 23
a177b07d
TF
24#ifndef PATH_MAX
25#define PATH_MAX 1024 /* WIN32, and others don't define this. */
26#endif
27
28/*! verbosity: set by -v option in each program, defined in dnssectool.c */
29extern int verbose;
30
31/*! program name, statically initialized in each program */
32extern const char *program;
33
796a6c4e
TF
34/*!
35 * List of DS digest types used by dnssec-cds and dnssec-dsfromkey,
36 * defined in dnssectool.c. Filled in by add_dtype() from -a
37 * arguments, sorted (so that DS records are in a canonical order) and
38 * terminated by a zero. The size of the array is an arbitrary limit
39 * which should be greater than the number of known digest types.
40 */
41extern uint8_t dtype[8];
42
c9c630ee
BW
43typedef void (fatalcallback_t)(void);
44
debd489a
FD
45ISC_PLATFORM_NORETURN_PRE void
46fatal(const char *format, ...)
47ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
b1d234eb 48
c9c630ee
BW
49void
50setfatalcallback(fatalcallback_t *callback);
51
7efc8c3f
DL
52void
53check_result(isc_result_t result, const char *message);
54
55void
76c8294c 56vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
7efc8c3f 57
cdacec1d
EH
58ISC_PLATFORM_NORETURN_PRE void
59version(const char *program) ISC_PLATFORM_NORETURN_POST;
42782931 60
4fc4813e 61void
93d6dfaf 62sig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size);
77b8f88f 63#define SIG_FORMATSIZE (DNS_NAME_FORMATSIZE + DNS_SECALG_FORMATSIZE + sizeof("65535"))
565d0dc2 64
7efc8c3f 65void
11463c0a 66setup_logging(isc_mem_t *mctx, isc_log_t **logp);
7efc8c3f 67
db503b6d
BW
68void
69cleanup_logging(isc_log_t **logp);
70
eab9975b
EH
71dns_ttl_t strtottl(const char *str);
72
42848e71 73isc_stdtime_t
cb6a185c 74strtotime(const char *str, int64_t now, int64_t base,
994e6569 75 bool *setp);
39504d45 76
796a6c4e
TF
77dns_rdataclass_t
78strtoclass(const char *str);
79
ba37674d
EH
80unsigned int
81strtodsdigest(const char *str);
82
796a6c4e
TF
83void
84add_dtype(unsigned int dt);
42848e71 85
8f0502e9
EH
86isc_result_t
87try_dir(const char *dirname);
c0214996
EH
88
89void
90check_keyversion(dst_key_t *key, char *keystr);
91
92void
93set_keyversion(dst_key_t *key);
8a198fa7 94
994e6569 95bool
1946c596 96key_collision(dst_key_t *key, dns_name_t *name, const char *dir,
994e6569 97 isc_mem_t *mctx, bool *exact);
1946c596 98
994e6569 99bool
e939674d
MA
100isoptarg(const char *arg, char **argv, void (*usage)(void));
101
358dfaee
WK
102#ifdef _WIN32
103void InitSockets(void);
104void DestroySockets(void);
105#endif
106
7efc8c3f 107#endif /* DNSSEC_DNSSECTOOL_H */