dnssectool.h revision 3398334b3acda24b086957286288ca9852662b12
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews/*
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2004, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews *
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and/or distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews * copyright notice and this permission notice appear in all copies.
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews *
a094c46640de70bb03a9351211fb17c41b6fbbb5Automatic Updater * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews */
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews/* $Id: dnssectool.h,v 1.22 2008/09/25 04:02:38 tbox Exp $ */
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrews#ifndef DNSSECTOOL_H
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews#define DNSSECTOOL_H 1
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews#include <isc/log.h>
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews#include <isc/stdtime.h>
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews#include <dns/rdatastruct.h>
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews#include <dst/dst.h>
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewstypedef void (fatalcallback_t)(void);
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsvoid
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsfatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntvoid
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrewssetfatalcallback(fatalcallback_t *callback);
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsvoid
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewscheck_result(isc_result_t result, const char *message);
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsvoid
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsvbprintf(int level, const char *fmt, ...) ISC_FORMAT_PRINTF(2, 3);
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsvoid
aaaf8d4f4873d21e55c3ffb4f656203d08339865Mark Andrewstype_format(const dns_rdatatype_t type, char *cp, unsigned int size);
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews#define TYPE_FORMATSIZE 20
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsvoid
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrewsalg_format(const dns_secalg_t alg, char *cp, unsigned int size);
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrews#define ALG_FORMATSIZE 10
aaaf8d4f4873d21e55c3ffb4f656203d08339865Mark Andrews
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntvoid
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Huntsig_format(dns_rdata_rrsig_t *sig, char *cp, unsigned int size);
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrews#define SIG_FORMATSIZE (DNS_NAME_FORMATSIZE + ALG_FORMATSIZE + sizeof("65535"))
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
93d6dfaf66258337985427c86181f01fc51f0bb4Mark Andrewsvoid
93d6dfaf66258337985427c86181f01fc51f0bb4Mark Andrewskey_format(const dst_key_t *key, char *cp, unsigned int size);
93d6dfaf66258337985427c86181f01fc51f0bb4Mark Andrews#define KEY_FORMATSIZE (DNS_NAME_FORMATSIZE + ALG_FORMATSIZE + sizeof("65535"))
058e44186b74531402c1f99088eb9dbe4926f8daMark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsvoid
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewssetup_logging(int verbose, isc_mem_t *mctx, isc_log_t **logp);
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsvoid
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewscleanup_logging(isc_log_t **logp);
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewsvoid
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrewssetup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx);
0b09763c354ec91fb352b6b4cea383bd0195b2d8Mark Andrews
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrewsvoid
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrewscleanup_entropy(isc_entropy_t **ectx);
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrews
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrewsisc_stdtime_t
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrewsstrtotime(const char *str, isc_int64_t now, isc_int64_t base);
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrews
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrewsdns_rdataclass_t
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrewsstrtoclass(const char *str);
c5387e694299c41361660e54f23e89c7da3ede1dMark Andrews
37dee1ff94960a61243f611c0f87f8c316815c53Mark Andrews#endif /* DNSSEC_DNSSECTOOL_H */
aaaf8d4f4873d21e55c3ffb4f656203d08339865Mark Andrews