dnssectool.c revision 499b34cea04a46823d003d4c0520c8b03e8513cb
/*
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* 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 INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM 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: dnssectool.c,v 1.27 2001/01/09 21:39:27 bwelling Exp $ */
#include <config.h>
#include <stdlib.h>
#include <isc/keyboard.h>
#include <dns/rdatastruct.h>
#include <dns/rdatatype.h>
#include "dnssectool.h"
extern int verbose;
extern const char *program;
static isc_keyboard_t kbd;
void
exit(1);
}
void
if (result != ISC_R_SUCCESS) {
exit(1);
}
}
void
return;
}
void
isc_buffer_t b;
isc_region_t r;
isc_buffer_usedregion(&b, &r);
}
void
isc_buffer_t b;
isc_region_t r;
isc_buffer_usedregion(&b, &r);
}
void
char namestr[DNS_NAME_FORMATSIZE];
char algstr[DNS_NAME_FORMATSIZE];
}
void
char namestr[DNS_NAME_FORMATSIZE];
char algstr[DNS_NAME_FORMATSIZE];
}
void
int level;
switch (verbose) {
case 0:
/*
* We want to see warnings about things like out-of-zone
* data in the master file even when not verbose.
*/
break;
case 1:
break;
default:
break;
}
/*
* Set up a channel similar to default_stderr except:
* - the logging level is passed in
* - the program name and logging level are printed
* - no time stamp is printed
*/
}
void
return;
}
static isc_result_t
if (!blocking)
return (ISC_R_NOENTROPY);
if (first) {
if (!wantkeyboard) {
"entropy, since your system is lacking\n");
}
}
return (isc_keyboard_open(kbd));
}
static void
if (!isc_keyboard_canceled(kbd))
}
static isc_result_t
isc_time_t t;
unsigned char c;
if (!blocking)
return (ISC_R_NOTBLOCKING);
if (result != ISC_R_SUCCESS)
return (result);
result = isc_time_now(&t);
if (result != ISC_R_SUCCESS)
return (result);
sample = isc_time_nanoseconds(&t);
extra = c;
if (result != ISC_R_SUCCESS) {
return (result);
}
return (result);
}
void
if (result != ISC_R_SUCCESS)
fatal("could not create entropy object");
if (result != ISC_R_SUCCESS)
}
else {
#ifdef PATH_RANDOMDEV
if (randomfile == NULL) {
if (result == ISC_R_SUCCESS)
return;
}
else
#endif
if (result != ISC_R_SUCCESS)
fatal("failed to open keyboard: %s\n",
}
}
void
}
char *endp;
if (str[0] == '+') {
if (*endp != '\0')
if (*endp != '\0')
char timestr[15];
if (result != ISC_R_SUCCESS)
} else {
if (result != ISC_R_SUCCESS)
}
return ((isc_stdtime_t) val);
}