2000-05-24 19:54:43 -04:00
|
|
|
/*
|
2011-10-20 19:46:51 -04:00
|
|
|
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2000-05-24 19:54:43 -04:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
2021-06-03 02:37:05 -04:00
|
|
|
*
|
2000-05-24 19:54:43 -04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 03:53:12 -05:00
|
|
|
*
|
2000-05-24 19:54:43 -04:00
|
|
|
* See the COPYRIGHT file distributed with this work for additional
|
2000-08-14 00:43:17 -04:00
|
|
|
* information regarding copyright ownership.
|
2000-05-24 19:54:43 -04:00
|
|
|
*/
|
|
|
|
|
|
2021-10-05 10:49:47 -04:00
|
|
|
#pragma once
|
2000-05-24 19:54:43 -04:00
|
|
|
|
2018-03-28 08:19:37 -04:00
|
|
|
#include <inttypes.h>
|
2018-04-17 11:29:14 -04:00
|
|
|
#include <stdbool.h>
|
2018-03-28 08:19:37 -04:00
|
|
|
|
2018-08-07 10:46:53 -04:00
|
|
|
#include <isc/attributes.h>
|
2000-06-19 14:04:22 -04:00
|
|
|
#include <isc/log.h>
|
2000-09-08 04:38:59 -04:00
|
|
|
#include <isc/stdtime.h>
|
2020-02-12 07:59:18 -05:00
|
|
|
|
2023-08-09 08:07:54 -04:00
|
|
|
#include <dns/kasp.h>
|
2000-08-11 19:07:53 -04:00
|
|
|
#include <dns/rdatastruct.h>
|
2020-02-12 07:59:18 -05:00
|
|
|
|
2000-08-14 00:43:17 -04:00
|
|
|
#include <dst/dst.h>
|
2000-06-19 14:04:22 -04:00
|
|
|
|
2023-08-09 08:07:54 -04:00
|
|
|
#include <isccfg/cfg.h>
|
|
|
|
|
#include <isccfg/kaspconf.h>
|
|
|
|
|
#include <isccfg/namedconf.h>
|
|
|
|
|
|
|
|
|
|
#define MAX_RSA 4096 /* should be long enough... */
|
|
|
|
|
#define MAX_DH 4096 /* should be long enough... */
|
|
|
|
|
|
2019-07-22 10:33:17 -04:00
|
|
|
/*! verbosity: set by -v and -q option in each program, defined in dnssectool.c
|
|
|
|
|
*/
|
2019-01-29 11:43:54 -05:00
|
|
|
extern int verbose;
|
2019-07-22 10:33:17 -04:00
|
|
|
extern bool quiet;
|
2019-01-29 11:43:54 -05:00
|
|
|
|
|
|
|
|
/*! program name, statically initialized in each program */
|
|
|
|
|
extern const char *program;
|
|
|
|
|
|
2022-02-04 19:52:22 -05:00
|
|
|
/*! journal file */
|
|
|
|
|
extern const char *journal;
|
|
|
|
|
|
2019-01-31 12:05:57 -05:00
|
|
|
/*!
|
|
|
|
|
* List of DS digest types used by dnssec-cds and dnssec-dsfromkey,
|
|
|
|
|
* defined in dnssectool.c. Filled in by add_dtype() from -a
|
|
|
|
|
* arguments, sorted (so that DS records are in a canonical order) and
|
|
|
|
|
* terminated by a zero. The size of the array is an arbitrary limit
|
|
|
|
|
* which should be greater than the number of known digest types.
|
|
|
|
|
*/
|
|
|
|
|
extern uint8_t dtype[8];
|
|
|
|
|
|
2001-03-30 21:12:26 -05:00
|
|
|
typedef void(fatalcallback_t)(void);
|
|
|
|
|
|
2024-07-11 09:15:40 -04:00
|
|
|
ISC_NORETURN void
|
2018-08-07 10:46:53 -04:00
|
|
|
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
|
2000-05-24 19:54:43 -04:00
|
|
|
|
2001-03-30 21:12:26 -05:00
|
|
|
void
|
|
|
|
|
setfatalcallback(fatalcallback_t *callback);
|
|
|
|
|
|
2000-06-01 14:49:22 -04:00
|
|
|
void
|
|
|
|
|
check_result(isc_result_t result, const char *message);
|
|
|
|
|
|
|
|
|
|
void
|
2001-08-08 18:54:55 -04:00
|
|
|
vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
|
2000-06-01 14:49:22 -04:00
|
|
|
|
2024-07-11 09:15:40 -04:00
|
|
|
ISC_NORETURN void
|
2018-08-07 10:46:53 -04:00
|
|
|
version(const char *program);
|
2014-06-12 20:57:43 -04:00
|
|
|
|
2000-08-14 00:43:17 -04:00
|
|
|
void
|
2003-09-30 02:00:40 -04:00
|
|
|
sig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size);
|
2009-10-12 16:48:12 -04:00
|
|
|
#define SIG_FORMATSIZE \
|
|
|
|
|
(DNS_NAME_FORMATSIZE + DNS_SECALG_FORMATSIZE + sizeof("65535"))
|
2000-08-11 19:07:53 -04:00
|
|
|
|
2000-06-01 14:49:22 -04:00
|
|
|
void
|
2024-08-13 12:20:26 -04:00
|
|
|
setup_logging(void);
|
2000-09-26 18:11:25 -04:00
|
|
|
|
2009-09-02 02:29:01 -04:00
|
|
|
dns_ttl_t
|
|
|
|
|
strtottl(const char *str);
|
|
|
|
|
|
2019-09-12 05:57:55 -04:00
|
|
|
dst_key_state_t
|
|
|
|
|
strtokeystate(const char *str);
|
|
|
|
|
|
2000-09-08 04:38:59 -04:00
|
|
|
isc_stdtime_t
|
2018-03-28 08:19:37 -04:00
|
|
|
strtotime(const char *str, int64_t now, int64_t base, bool *setp);
|
2001-09-20 20:17:01 -04:00
|
|
|
|
2019-01-31 12:05:57 -05:00
|
|
|
dns_rdataclass_t
|
|
|
|
|
strtoclass(const char *str);
|
|
|
|
|
|
2017-10-05 04:04:18 -04:00
|
|
|
unsigned int
|
|
|
|
|
strtodsdigest(const char *str);
|
|
|
|
|
|
2019-01-31 12:05:57 -05:00
|
|
|
void
|
|
|
|
|
add_dtype(unsigned int dt);
|
2000-09-08 04:38:59 -04:00
|
|
|
|
2009-10-23 20:00:06 -04:00
|
|
|
isc_result_t
|
|
|
|
|
try_dir(const char *dirname);
|
2009-10-26 17:18:24 -04:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
check_keyversion(dst_key_t *key, char *keystr);
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
set_keyversion(dst_key_t *key);
|
2010-01-19 15:26:07 -05:00
|
|
|
|
2018-04-17 11:29:14 -04:00
|
|
|
bool
|
2011-10-20 17:20:02 -04:00
|
|
|
key_collision(dst_key_t *key, dns_name_t *name, const char *dir,
|
2024-08-06 00:28:08 -04:00
|
|
|
isc_mem_t *mctx, uint16_t min, uint16_t max, bool *exact);
|
2011-10-20 17:20:02 -04:00
|
|
|
|
2018-04-17 11:29:14 -04:00
|
|
|
bool
|
2015-11-04 20:09:48 -05:00
|
|
|
isoptarg(const char *arg, char **argv, void (*usage)(void));
|
2022-02-04 19:52:22 -05:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
loadjournal(isc_mem_t *mctx, dns_db_t *db, const char *journal);
|
2023-08-09 08:07:54 -04:00
|
|
|
|
|
|
|
|
void
|
2024-08-13 12:20:26 -04:00
|
|
|
kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
|
|
|
|
|
const char *keydir, dns_kasp_t **kaspp);
|