#include <config.h>
#include <stdlib.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/entropy.h>
#include <isc/hash.h>
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/string.h>
#include <isc/util.h>
#include <dns/callbacks.h>
#include <dns/db.h>
#include <dns/dbiterator.h>
#include <dns/ds.h>
#include <dns/fixedname.h>
#include <dns/keyvalues.h>
#include <dns/log.h>
#include <dns/master.h>
#include <dns/name.h>
#include <dns/rdata.h>
#include <dns/rdataclass.h>
#include <dns/rdataset.h>
#include <dns/rdatasetiter.h>
#include <dns/rdatatype.h>
#include <dns/result.h>
#include <dst/dst.h>
#include "dnssectool.h"
Go to the source code of this file.
Defines | |
#define | PATH_MAX 1024 |
#define | CMDLINE_FLAGS "D:f:hK:L:P:v:V" |
Functions | |
static isc_result_t | initname (char *setname) |
static void | db_load_from_stream (dns_db_t *db, FILE *fp) |
static isc_result_t | loadset (const char *filename, dns_rdataset_t *rdataset) |
static void | loadkey (char *filename, unsigned char *key_buf, unsigned int key_buf_size, dns_rdata_t *rdata) |
static void | emit (const char *dir, dns_rdata_t *rdata) |
static ISC_PLATFORM_NORETURN_PRE void | usage (void) |
int | main (int argc, char **argv) |
Variables | |
const char * | program = "dnssec-importkey" |
int | verbose |
static dns_rdataclass_t | rdclass |
static dns_fixedname_t | fixed |
static dns_name_t * | name = NULL |
static isc_mem_t * | mctx = NULL |
static isc_boolean_t | setpub = ISC_FALSE |
static isc_boolean_t | setdel = ISC_FALSE |
static isc_boolean_t | setttl = ISC_FALSE |
static isc_stdtime_t | pub = 0 |
static isc_stdtime_t | del = 0 |
static dns_ttl_t | ttl = 0 |
Definition in file dnssec-importkey.c.
#define PATH_MAX 1024 |
Definition at line 57 of file dnssec-importkey.c.
#define CMDLINE_FLAGS "D:f:hK:L:P:v:V" |
static isc_result_t initname | ( | char * | setname | ) | [static] |
Definition at line 73 of file dnssec-importkey.c.
References dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_rootname, isc_buffer_add, and isc_buffer_init.
static void db_load_from_stream | ( | dns_db_t * | db, | |
FILE * | fp | |||
) | [static] |
Definition at line 87 of file dnssec-importkey.c.
References callbacks, dns_db_beginload(), dns_db_endload(), dns_master_loadstream(), dns_rdatacallbacks_init(), fatal(), ISC_R_SUCCESS, isc_result_totext(), and rdclass.
static isc_result_t loadset | ( | const char * | filename, | |
dns_rdataset_t * | rdataset | |||
) | [static] |
Definition at line 107 of file dnssec-importkey.c.
References db_load_from_stream(), dns_db_create(), dns_db_detach(), dns_db_detachnode(), dns_db_findnode(), dns_db_findrdataset(), dns_db_load3(), dns_dbtype_zone, DNS_MASTER_NOTTL, dns_masterformat_text, dns_name_format(), DNS_NAME_FORMATSIZE, DNS_R_SEENINCLUDE, fatal(), ISC_FALSE, ISC_R_NOTFOUND, ISC_R_SUCCESS, isc_result_totext(), and rdclass.
static void loadkey | ( | char * | filename, | |
unsigned char * | key_buf, | |||
unsigned int | key_buf_size, | |||
dns_rdata_t * | rdata | |||
) | [static] |
Definition at line 151 of file dnssec-importkey.c.
References dns_fixedname_init, dns_fixedname_name, dns_name_copy(), dns_rdata_fromregion(), dns_rdata_init(), dst_key_class(), dst_key_format(), DST_KEY_FORMATSIZE, dst_key_free(), dst_key_fromnamedfile(), dst_key_name(), dst_key_todns(), DST_TYPE_PUBLIC, fatal(), isc_buffer_init, isc_buffer_usedregion, ISC_R_SUCCESS, isc_result_totext(), key, keystr, program, r, rdclass, and verbose.
static void emit | ( | const char * | dir, | |
dns_rdata_t * | rdata | |||
) | [static] |
Definition at line 196 of file dnssec-importkey.c.
References dns_rdata::data, del, dst_key_alg(), dst_key_buildfilename(), dst_key_format(), DST_KEY_FORMATSIZE, dst_key_free(), dst_key_fromdns(), dst_key_fromfile(), dst_key_id(), dst_key_isexternal(), dst_key_isprivate(), dst_key_name(), dst_key_setexternal(), dst_key_settime(), dst_key_setttl(), dst_key_tofile(), DST_TIME_DELETE, DST_TIME_PUBLISH, DST_TYPE_PRIVATE, DST_TYPE_PUBLIC, fatal(), isc_buffer_add, isc_buffer_clear, isc_buffer_init, ISC_R_SUCCESS, isc_result_totext(), ISC_TRUE, key, keystr, dns_rdata::length, pub, rdclass, setdel, setpub, setttl, and ttl.
static ISC_PLATFORM_NORETURN_PRE void usage | ( | void | ) | [static] |
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 288 of file dnssec-importkey.c.
References cleanup_entropy(), cleanup_logging(), CMDLINE_FLAGS, del, dns_name_destroy(), DNS_NAME_MAXWIRE, dns_rdata_init(), dns_rdataset_current(), dns_rdataset_disassociate(), dns_rdataset_first(), dns_rdataset_init(), dns_rdataset_isassociated(), dns_rdataset_next(), dns_result_register(), DST_KEY_MAXSIZE, dst_lib_destroy(), dst_lib_init(), ectx, emit(), fatal(), initname(), isc_commandline_argument, isc_commandline_errprint, isc_commandline_index, isc_commandline_option, isc_commandline_parse(), ISC_ENTROPY_BLOCKING, ISC_ENTROPY_GOODONLY, isc_entropy_stopcallbacksources(), ISC_FALSE, isc_hash_create(), isc_hash_destroy(), isc_mem_create(), isc_mem_destroy(), isc_mem_stats(), ISC_R_SUCCESS, isc_result_totext(), isc_stdtime_get(), ISC_TRUE, loadkey(), loadset(), now, pk11_result_register(), program, pub, rdclass, setdel, setpub, setttl, setup_entropy(), setup_logging(), strtoclass(), strtotime(), strtottl(), ttl, usage(), verbose, and version.
const char* program = "dnssec-importkey" |
Definition at line 60 of file dnssec-importkey.c.
int verbose |
Definition at line 61 of file dnssec-importkey.c.
dns_rdataclass_t rdclass [static] |
Definition at line 63 of file dnssec-importkey.c.
dns_fixedname_t fixed [static] |
Definition at line 64 of file dnssec-importkey.c.
dns_name_t* name = NULL [static] |
Definition at line 65 of file dnssec-importkey.c.
Definition at line 66 of file dnssec-importkey.c.
isc_boolean_t setpub = ISC_FALSE [static] |
isc_boolean_t setdel = ISC_FALSE [static] |
isc_boolean_t setttl = ISC_FALSE [static] |
isc_stdtime_t pub = 0 [static] |
isc_stdtime_t del = 0 [static] |
Definition at line 69 of file dnssec-importkey.c.
Referenced by cleanup_zone(), emit(), main(), and signname().
Definition at line 70 of file dnssec-importkey.c.