Home | History | Annotate | Line # | Download | only in dnssec
dnssectool.h revision 1.1
      1 /*	$NetBSD: dnssectool.h,v 1.1 2018/08/12 12:07:21 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 <isc/log.h>
     19 #include <isc/stdtime.h>
     20 #include <dns/rdatastruct.h>
     21 #include <dst/dst.h>
     22 
     23 #define check_dns_dbiterator_current(result) \
     24 	check_result((result == DNS_R_NEWORIGIN) ? ISC_R_SUCCESS : result, \
     25 		     "dns_dbiterator_current()")
     26 
     27 
     28 typedef void (fatalcallback_t)(void);
     29 
     30 ISC_PLATFORM_NORETURN_PRE void
     31 fatal(const char *format, ...)
     32 ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
     33 
     34 void
     35 setfatalcallback(fatalcallback_t *callback);
     36 
     37 void
     38 check_result(isc_result_t result, const char *message);
     39 
     40 void
     41 vbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
     42 
     43 ISC_PLATFORM_NORETURN_PRE void
     44 version(const char *program) ISC_PLATFORM_NORETURN_POST;
     45 
     46 void
     47 type_format(const dns_rdatatype_t type, char *cp, unsigned int size);
     48 #define TYPE_FORMATSIZE 20
     49 
     50 void
     51 sig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size);
     52 #define SIG_FORMATSIZE (DNS_NAME_FORMATSIZE + DNS_SECALG_FORMATSIZE + sizeof("65535"))
     53 
     54 void
     55 setup_logging(isc_mem_t *mctx, isc_log_t **logp);
     56 
     57 void
     58 cleanup_logging(isc_log_t **logp);
     59 
     60 void
     61 setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx);
     62 
     63 void
     64 cleanup_entropy(isc_entropy_t **ectx);
     65 
     66 dns_ttl_t strtottl(const char *str);
     67 
     68 isc_stdtime_t
     69 strtotime(const char *str, isc_int64_t now, isc_int64_t base,
     70 	  isc_boolean_t *setp);
     71 
     72 unsigned int
     73 strtodsdigest(const char *str);
     74 
     75 dns_rdataclass_t
     76 strtoclass(const char *str);
     77 
     78 isc_result_t
     79 try_dir(const char *dirname);
     80 
     81 void
     82 check_keyversion(dst_key_t *key, char *keystr);
     83 
     84 void
     85 set_keyversion(dst_key_t *key);
     86 
     87 isc_boolean_t
     88 key_collision(dst_key_t *key, dns_name_t *name, const char *dir,
     89 	      isc_mem_t *mctx, isc_boolean_t *exact);
     90 
     91 isc_boolean_t
     92 is_delegation(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
     93 		      dns_name_t *name, dns_dbnode_t *node, isc_uint32_t *ttlp);
     94 
     95 /*%
     96  * Return ISC_TRUE if version 'ver' of database 'db' contains a DNAME RRset at
     97  * 'node'; return ISC_FALSE otherwise.
     98  */
     99 isc_boolean_t
    100 has_dname(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node);
    101 
    102 void
    103 verifyzone(dns_db_t *db, dns_dbversion_t *ver,
    104 		   dns_name_t *origin, isc_mem_t *mctx,
    105 		   isc_boolean_t ignore_kskflag, isc_boolean_t keyset_kskonly);
    106 
    107 isc_boolean_t
    108 isoptarg(const char *arg, char **argv, void (*usage)(void));
    109 
    110 #ifdef _WIN32
    111 void InitSockets(void);
    112 void DestroySockets(void);
    113 #endif
    114 
    115 #endif /* DNSSEC_DNSSECTOOL_H */
    116