1/* 2 * Copyright (C) 2004, 2007-2011 Internet Systems Consortium, Inc. ("ISC") 3 * Copyright (C) 2000, 2001, 2003 Internet Software Consortium. 4 * 5 * Permission to use, copy, modify, and/or 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.31.162.2 2011/10/20 23:46:27 tbox 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 28typedef void (fatalcallback_t)(void); 29 30ISC_PLATFORM_NORETURN_PRE void 31fatal(const char *format, ...) 32ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST; 33 34void 35setfatalcallback(fatalcallback_t *callback); 36 37void 38check_result(isc_result_t result, const char *message); 39 40void 41vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3); 42 43void 44type_format(const dns_rdatatype_t type, char *cp, unsigned int size); 45#define TYPE_FORMATSIZE 20 46 47void 48sig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size); 49#define SIG_FORMATSIZE (DNS_NAME_FORMATSIZE + DNS_SECALG_FORMATSIZE + sizeof("65535")) 50 51void 52setup_logging(int verbose, isc_mem_t *mctx, isc_log_t **logp); 53 54void 55cleanup_logging(isc_log_t **logp); 56 57void 58setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx); 59 60void 61cleanup_entropy(isc_entropy_t **ectx); 62 63dns_ttl_t strtottl(const char *str); 64 65isc_stdtime_t 66strtotime(const char *str, isc_int64_t now, isc_int64_t base); 67 68dns_rdataclass_t 69strtoclass(const char *str); 70 71isc_result_t 72try_dir(const char *dirname); 73 74void 75check_keyversion(dst_key_t *key, char *keystr); 76 77void 78set_keyversion(dst_key_t *key); 79 80isc_boolean_t 81key_collision(dst_key_t *key, dns_name_t *name, const char *dir, 82 isc_mem_t *mctx, isc_boolean_t *exact); 83 84#endif /* DNSSEC_DNSSECTOOL_H */ 85