#ifndef ZCONF_H
# define ZCONF_H
# define MINSEC 60
# define HOURSEC (MINSEC * 60)
# define DAYSEC (HOURSEC * 24)
# define WEEKSEC (DAYSEC * 7)
# define YEARSEC (DAYSEC * 365)
# define DAY (1)
# define WEEK (DAY * 7)
# define MONTH (DAY * 30)
# define YEAR (DAY * 365)
# define SIG_VALID_DAYS (10)
# define SIG_VALIDITY (SIG_VALID_DAYS * DAYSEC)
# define MAX_TTL ( 8 * HOURSEC)
# define KEY_TTL ( 4 * HOURSEC)
# define PROPTIME ( 5 * MINSEC)
#if defined (DEF_TTL)
# define DEF_TTL (MAX_TTL/2)
#endif
# define RESIGN_INT ((SIG_VALID_DAYS - (SIG_VALID_DAYS / 3)) * DAYSEC)
# define KSK_LIFETIME (1 * YEARSEC)
#if 0
# define ZSK_LIFETIME ((SIG_VALID_DAYS * 3) * DAYSEC)
#else
# define ZSK_LIFETIME ((MONTH * 3) * DAYSEC)
#endif
# define KSK_ALGO (DK_ALGO_RSASHA1)
# define KSK_BITS (1300)
# define KSK_RANDOM "/dev/urandom"
# define ZSK_ALGO (DK_ALGO_RSASHA1)
# define ZSK_BITS (512)
# define ZSK_RANDOM "/dev/urandom"
# define ZONEDIR "."
# define RECURSIVE 0
# define PRINTTIME 1
# define PRINTAGE 0
# define LJUST 0
# define KEYSETDIR NULL
# define LOGFILE ""
# define LOGLEVEL "error"
# define SYSLOGFACILITY "none"
# define SYSLOGLEVEL "notice"
# define VERBOSELOG 0
# define ZONEFILE "zone.db"
# define DNSKEYFILE "dnskey.db"
# define LOOKASIDEDOMAIN ""
# define SIG_RANDOM NULL
# define SIG_PSEUDO 1
# define SIG_GENDS 1
# define SIG_PARAM ""
# define DIST_CMD NULL
#ifndef CONFIG_PATH
# define CONFIG_PATH "/var/named/"
#endif
# define CONFIG_FILE CONFIG_PATH "dnssec.conf"
# define LOCALCONF_FILE "dnssec.conf"
#ifndef BIND_UTIL_PATH
# define BIND_UTIL_PATH "/usr/local/sbin/"
#endif
# define SIGNCMD BIND_UTIL_PATH "dnssec-signzone"
# define KEYGENCMD BIND_UTIL_PATH "dnssec-keygen"
# define RELOADCMD BIND_UTIL_PATH "rndc"
typedef enum {
Unixtime = 1,
Incremental
} serial_form_t;
typedef enum {
none = 0,
user,
local0, local1, local2, local3, local4, local5, local6, local7
} syslog_facility_t;
typedef struct zconf {
char *zonedir;
int recursive;
int printtime;
int printage;
int ljust;
int sigvalidity;
int max_ttl;
int key_ttl;
int proptime;
#if defined (DEF_TTL)
int def_ttl;
#endif
serial_form_t serialform;
int resign;
int k_life;
int k_algo;
int k_bits;
char *k_random;
int z_life;
int z_algo;
int z_bits;
char *z_random;
char *view;
char *logfile;
char *loglevel;
char *syslogfacility;
char *sysloglevel;
int verboselog;
int verbosity;
char *keyfile;
char *zonefile;
char *keysetdir;
char *lookaside;
char *sig_random;
int sig_pseudo;
int sig_gends;
char *sig_param;
char *dist_cmd;
} zconf_t;
extern zconf_t *loadconfig (const char *filename, zconf_t *z);
extern zconf_t *loadconfig_fromstr (const char *str, zconf_t *z);
extern zconf_t *dupconfig (const zconf_t *conf);
extern int setconfigpar (zconf_t *conf, char *entry, const void *pval);
extern int printconfig (const char *fname, const zconf_t *cp);
extern int checkconfig (const zconf_t *z);
#endif