diff --git a/bin/dnssec/dnssec-makekeyset.c b/bin/dnssec/dnssec-makekeyset.c index 1c25dd9d6d..0a7f0bdc53 100644 --- a/bin/dnssec/dnssec-makekeyset.c +++ b/bin/dnssec/dnssec-makekeyset.c @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssec-makekeyset.c,v 1.35 2000/08/14 20:39:23 bwelling Exp $ */ +/* $Id: dnssec-makekeyset.c,v 1.36 2000/09/08 08:38:55 bwelling Exp $ */ #include @@ -64,31 +64,6 @@ static isc_entropy_t *ectx = NULL; static keylist_t keylist; -static isc_stdtime_t -strtotime(char *str, isc_int64_t now, isc_int64_t base) { - isc_int64_t val, offset; - isc_result_t result; - char *endp; - - if (str[0] == '+') { - offset = strtol(str + 1, &endp, 0); - if (*endp != '\0') - fatal("time value %s is invalid", str); - val = base + offset; - } else if (strncmp(str, "now+", 4) == 0) { - offset = strtol(str + 4, &endp, 0); - if (*endp != '\0') - fatal("time value %s is invalid", str); - val = now + offset; - } else { - result = dns_time64_fromtext(str, &val); - if (result != ISC_R_SUCCESS) - fatal("time %s must be numeric", str); - } - - return ((isc_stdtime_t) val); -} - static void usage(void) { fprintf(stderr, "Usage:\n"); diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c index 20e661e3a2..38a12ed251 100644 --- a/bin/dnssec/dnssec-signzone.c +++ b/bin/dnssec/dnssec-signzone.c @@ -17,7 +17,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssec-signzone.c,v 1.95 2000/09/07 15:53:15 bwelling Exp $ */ +/* $Id: dnssec-signzone.c,v 1.96 2000/09/08 08:38:57 bwelling Exp $ */ #include @@ -1175,31 +1175,6 @@ loadzonekeys(dns_db_t *db) { dns_db_closeversion(db, ¤tversion, ISC_FALSE); } -static isc_stdtime_t -strtotime(char *str, isc_int64_t now, isc_int64_t base) { - isc_int64_t val, offset; - isc_result_t result; - char *endp; - - if (str[0] == '+') { - offset = strtol(str + 1, &endp, 0); - if (*endp != '\0') - fatal("time value %s is invalid", str); - val = base + offset; - } else if (strncmp(str, "now+", 4) == 0) { - offset = strtol(str + 4, &endp, 0); - if (*endp != '\0') - fatal("time value %s is invalid", str); - val = now + offset; - } else { - result = dns_time64_fromtext(str, &val); - if (result != ISC_R_SUCCESS) - fatal("time %s must be numeric", str); - } - - return ((isc_stdtime_t) val); -} - static void usage(void) { fprintf(stderr, "Usage:\n"); diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c index 08408bcdf3..fd120b7654 100644 --- a/bin/dnssec/dnssectool.c +++ b/bin/dnssec/dnssectool.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssectool.c,v 1.20 2000/08/17 19:17:57 bwelling Exp $ */ +/* $Id: dnssectool.c,v 1.21 2000/09/08 08:38:58 bwelling Exp $ */ #include @@ -35,6 +35,7 @@ #include #include #include +#include #include "dnssectool.h" @@ -283,3 +284,28 @@ cleanup_entropy(isc_entropy_t **ectx) { isc_entropy_destroysource(&source); isc_entropy_detach(ectx); } + +isc_stdtime_t +strtotime(char *str, isc_int64_t now, isc_int64_t base) { + isc_int64_t val, offset; + isc_result_t result; + char *endp; + + if (str[0] == '+') { + offset = strtol(str + 1, &endp, 0); + if (*endp != '\0') + fatal("time value %s is invalid", str); + val = base + offset; + } else if (strncmp(str, "now+", 4) == 0) { + offset = strtol(str + 4, &endp, 0); + if (*endp != '\0') + fatal("time value %s is invalid", str); + val = now + offset; + } else { + result = dns_time64_fromtext(str, &val); + if (result != ISC_R_SUCCESS) + fatal("time %s must be numeric", str); + } + + return ((isc_stdtime_t) val); +} diff --git a/bin/dnssec/dnssectool.h b/bin/dnssec/dnssectool.h index dca632efef..78d0f0c5f5 100644 --- a/bin/dnssec/dnssectool.h +++ b/bin/dnssec/dnssectool.h @@ -15,12 +15,13 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssectool.h,v 1.10 2000/08/14 04:43:17 bwelling Exp $ */ +/* $Id: dnssectool.h,v 1.11 2000/09/08 08:38:59 bwelling Exp $ */ #ifndef DNSSECTOOL_H #define DNSSECTOOL_H 1 #include +#include #include #include @@ -58,4 +59,7 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx); void cleanup_entropy(isc_entropy_t **ectx); +isc_stdtime_t +strtotime(char *str, isc_int64_t now, isc_int64_t base); + #endif /* DNSSEC_DNSSECTOOL_H */