Home | History | Annotate | Line # | Download | only in dnssec
dnssectool.h revision 1.2
      1  1.2  christos /*	$NetBSD: dnssectool.h,v 1.2 2018/08/12 13:02:27 christos Exp $	*/
      2  1.1  christos 
      3  1.1  christos /*
      4  1.1  christos  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
      5  1.1  christos  *
      6  1.1  christos  * This Source Code Form is subject to the terms of the Mozilla Public
      7  1.1  christos  * License, v. 2.0. If a copy of the MPL was not distributed with this
      8  1.1  christos  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
      9  1.1  christos  *
     10  1.1  christos  * See the COPYRIGHT file distributed with this work for additional
     11  1.1  christos  * information regarding copyright ownership.
     12  1.1  christos  */
     13  1.1  christos 
     14  1.1  christos 
     15  1.1  christos #ifndef DNSSECTOOL_H
     16  1.1  christos #define DNSSECTOOL_H 1
     17  1.1  christos 
     18  1.1  christos #include <isc/log.h>
     19  1.1  christos #include <isc/stdtime.h>
     20  1.1  christos #include <dns/rdatastruct.h>
     21  1.1  christos #include <dst/dst.h>
     22  1.1  christos 
     23  1.1  christos #define check_dns_dbiterator_current(result) \
     24  1.1  christos 	check_result((result == DNS_R_NEWORIGIN) ? ISC_R_SUCCESS : result, \
     25  1.1  christos 		     "dns_dbiterator_current()")
     26  1.1  christos 
     27  1.1  christos 
     28  1.1  christos typedef void (fatalcallback_t)(void);
     29  1.1  christos 
     30  1.1  christos ISC_PLATFORM_NORETURN_PRE void
     31  1.1  christos fatal(const char *format, ...)
     32  1.1  christos ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
     33  1.1  christos 
     34  1.1  christos void
     35  1.1  christos setfatalcallback(fatalcallback_t *callback);
     36  1.1  christos 
     37  1.1  christos void
     38  1.1  christos check_result(isc_result_t result, const char *message);
     39  1.1  christos 
     40  1.1  christos void
     41  1.1  christos vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
     42  1.1  christos 
     43  1.1  christos ISC_PLATFORM_NORETURN_PRE void
     44  1.1  christos version(const char *program) ISC_PLATFORM_NORETURN_POST;
     45  1.1  christos 
     46  1.1  christos void
     47  1.1  christos type_format(const dns_rdatatype_t type, char *cp, unsigned int size);
     48  1.1  christos #define TYPE_FORMATSIZE 20
     49  1.1  christos 
     50  1.1  christos void
     51  1.1  christos sig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size);
     52  1.1  christos #define SIG_FORMATSIZE (DNS_NAME_FORMATSIZE + DNS_SECALG_FORMATSIZE + sizeof("65535"))
     53  1.1  christos 
     54  1.1  christos void
     55  1.1  christos setup_logging(isc_mem_t *mctx, isc_log_t **logp);
     56  1.1  christos 
     57  1.1  christos void
     58  1.1  christos cleanup_logging(isc_log_t **logp);
     59  1.1  christos 
     60  1.1  christos void
     61  1.1  christos setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx);
     62  1.1  christos 
     63  1.1  christos void
     64  1.1  christos cleanup_entropy(isc_entropy_t **ectx);
     65  1.1  christos 
     66  1.1  christos dns_ttl_t strtottl(const char *str);
     67  1.1  christos 
     68  1.1  christos isc_stdtime_t
     69  1.1  christos strtotime(const char *str, isc_int64_t now, isc_int64_t base,
     70  1.1  christos 	  isc_boolean_t *setp);
     71  1.1  christos 
     72  1.1  christos unsigned int
     73  1.1  christos strtodsdigest(const char *str);
     74  1.1  christos 
     75  1.1  christos dns_rdataclass_t
     76  1.1  christos strtoclass(const char *str);
     77  1.1  christos 
     78  1.1  christos isc_result_t
     79  1.1  christos try_dir(const char *dirname);
     80  1.1  christos 
     81  1.1  christos void
     82  1.1  christos check_keyversion(dst_key_t *key, char *keystr);
     83  1.1  christos 
     84  1.1  christos void
     85  1.1  christos set_keyversion(dst_key_t *key);
     86  1.1  christos 
     87  1.1  christos isc_boolean_t
     88  1.1  christos key_collision(dst_key_t *key, dns_name_t *name, const char *dir,
     89  1.1  christos 	      isc_mem_t *mctx, isc_boolean_t *exact);
     90  1.1  christos 
     91  1.1  christos isc_boolean_t
     92  1.1  christos is_delegation(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
     93  1.1  christos 		      dns_name_t *name, dns_dbnode_t *node, isc_uint32_t *ttlp);
     94  1.1  christos 
     95  1.1  christos /*%
     96  1.1  christos  * Return ISC_TRUE if version 'ver' of database 'db' contains a DNAME RRset at
     97  1.1  christos  * 'node'; return ISC_FALSE otherwise.
     98  1.1  christos  */
     99  1.1  christos isc_boolean_t
    100  1.1  christos has_dname(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node);
    101  1.1  christos 
    102  1.1  christos void
    103  1.1  christos verifyzone(dns_db_t *db, dns_dbversion_t *ver,
    104  1.1  christos 		   dns_name_t *origin, isc_mem_t *mctx,
    105  1.1  christos 		   isc_boolean_t ignore_kskflag, isc_boolean_t keyset_kskonly);
    106  1.1  christos 
    107  1.1  christos isc_boolean_t
    108  1.1  christos isoptarg(const char *arg, char **argv, void (*usage)(void));
    109  1.1  christos 
    110  1.1  christos #ifdef _WIN32
    111  1.1  christos void InitSockets(void);
    112  1.1  christos void DestroySockets(void);
    113  1.1  christos #endif
    114  1.1  christos 
    115  1.1  christos #endif /* DNSSEC_DNSSECTOOL_H */
    116