/*
* Copyright (C) 2008-2012 Internet Systems Consortium, Inc. ("ISC")
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id$ */
/*! \file */
#include <config.h>
#include <stdlib.h>
#include <isc/commandline.h>
#include <dns/dbiterator.h>
#include <dns/fixedname.h>
#include <dns/rdataclass.h>
#include <dns/rdataset.h>
#include <dns/rdatasetiter.h>
#include <dns/rdatatype.h>
#include "dnssectool.h"
int verbose;
static void
{
if (result != ISC_R_SUCCESS)
}
}
if (isc_buffer_availablelength(&buf) == 0)
isc_buffer_putuint8(&buf, 0);
if (result != ISC_R_SUCCESS)
fatal("can't create database");
if (result != ISC_R_SUCCESS)
if (result == ISC_R_NOTFOUND)
else if (result != ISC_R_SUCCESS)
fatal("dns_db_findrdataset");
}
static void
{
isc_region_t r;
if (result != ISC_R_SUCCESS)
fatal("invalid keyfile name %s: %s",
if (verbose > 2) {
}
if (result != ISC_R_SUCCESS)
fatal("can't decode key");
isc_buffer_usedregion(&keyb, &r);
dns_rdatatype_dnskey, &r);
if (result != ISC_R_SUCCESS)
fatal("can't copy name");
dst_key_free(&key);
}
static void
{
if (result != ISC_R_SUCCESS)
return;
dst_key_free(&key);
}
static void
{
isc_region_t r;
dns_rdata_init(&ds);
if (result != ISC_R_SUCCESS)
fatal("can't build DS");
if (result != ISC_R_SUCCESS)
fatal("can't print DS rdata");
if (result != ISC_R_SUCCESS)
fatal("can't print DS class");
if (result != ISC_R_SUCCESS)
fatal("can't print DS name");
isc_buffer_usedregion(&classb, &r);
isc_buffer_usedregion(&textb, &r);
}
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
program);
exit (-1);
}
int
char *endp;
int ch;
if (argc == 1)
usage();
if (result != ISC_R_SUCCESS)
fatal("out of memory");
"12a:c:d:sv:h")) != -1) {
switch (ch) {
case '1':
break;
case '2':
break;
case 'a':
break;
case 'c':
break;
case 'd':
break;
case 's':
break;
case 'v':
if (*endp != '\0')
fatal("-v must be followed by a number");
break;
case '?':
if (isc_commandline_option != '?')
/* Falls into */
case 'h':
usage();
default:
exit(1);
}
}
else
}
fatal("the key file name was not specified");
fatal("extraneous arguments");
if (result != ISC_R_SUCCESS)
fatal("could not initialize hash");
if (result != ISC_R_SUCCESS)
fatal("could not initialize dst");
if (usekeyset) {
result == ISC_R_SUCCESS;
if (verbose > 2)
if (both) {
} else
}
} else {
DST_KEY_MAXSIZE, &rdata);
if (both) {
} else
}
if (dns_rdataset_isassociated(&keyset))
dns_db_detach(&db);
if (verbose > 10)
return (1);
} else
return (0);
}