Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / bind / dist / contrib / zkt / zconf.h
blob3c4249bac50552a557ef5af58528d2c41a741da3
1 /* $NetBSD$ */
3 /*****************************************************************
4 **
5 ** @(#) zconf.h
6 **
7 ** Copyright (c) Jan 2005, Jeroen Masar, Holger Zuleger.
8 ** All rights reserved.
9 **
10 ** This software is open source.
11 **
12 ** Redistribution and use in source and binary forms, with or without
13 ** modification, are permitted provided that the following conditions
14 ** are met:
15 **
16 ** Redistributions of source code must retain the above copyright notice,
17 ** this list of conditions and the following disclaimer.
18 **
19 ** Redistributions in binary form must reproduce the above copyright notice,
20 ** this list of conditions and the following disclaimer in the documentation
21 ** and/or other materials provided with the distribution.
22 **
23 ** Neither the name of Jeroen Masar and Holger Zuleger nor the
24 ** names of its contributors may be used to endorse or promote products
25 ** derived from this software without specific prior written permission.
26 **
27 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 ** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 ** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
31 ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 ** POSSIBILITY OF SUCH DAMAGE.
39 *****************************************************************/
40 #ifndef ZCONF_H
41 # define ZCONF_H
44 # define MINSEC 60L
45 # define HOURSEC (MINSEC * 60)
46 # define DAYSEC (HOURSEC * 24)
47 # define WEEKSEC (DAYSEC * 7)
48 # define YEARSEC (DAYSEC * 365)
49 # define DAY (1)
50 # define WEEK (DAY * 7)
51 # define MONTH (DAY * 30)
52 # define YEAR (DAY * 365)
54 # define SIG_VALID_DAYS (10) /* or 3 Weeks ? */
55 # define SIG_VALIDITY (SIG_VALID_DAYS * DAYSEC)
56 # define MAX_TTL ( 8 * HOURSEC) /* default value of maximum ttl time */
57 # define KEY_TTL ( 4 * HOURSEC) /* default value of KEY TTL */
58 # define PROPTIME ( 5 * MINSEC) /* expected slave propagation time */
59 /* should be small if notify is used */
60 #if defined (DEF_TTL)
61 # define DEF_TTL (MAX_TTL/2) /* currently not used */
62 #endif
64 # define RESIGN_INT ((SIG_VALID_DAYS - (SIG_VALID_DAYS / 3)) * DAYSEC)
65 # define KSK_LIFETIME (1 * YEARSEC)
66 #if 0
67 # define ZSK_LIFETIME ((SIG_VALID_DAYS * 3) * DAYSEC) /* set to three times the sig validity */
68 #else
69 # if 0
70 # define ZSK_LIFETIME ((MONTH * 3) * DAYSEC) /* set fixed to 3 month */
71 # else
72 # define ZSK_LIFETIME (12 * WEEKSEC) /* set fixed to 3 month */
73 # endif
74 #endif
76 /* # define KSK_ALGO (DK_ALGO_RSASHA1) KSK_ALGO renamed to KEY_ALGO (v0.99) */
77 # define KEY_ALGO (DK_ALGO_RSASHA1) /* general KEY_ALGO used for both ksk and zsk */
78 # define ADDITIONAL_KEY_ALGO 0
79 # define KSK_BITS (1300)
80 # define KSK_RANDOM "/dev/urandom" /* was NULL before v0.94 */
81 /* # define ZSK_ALGO (DK_ALGO_RSASHA1) ZSK_ALGO has to be the same as KSK, so this is no longer used (v0.99) */
82 # define ZSK_BITS (512)
83 # define ZSK_RANDOM "/dev/urandom"
84 # define SALTLEN 24 /* salt length in bits (resolution is 4 bits)*/
86 # define ZONEDIR "."
87 # define RECURSIVE 0
88 # define PRINTTIME 1
89 # define PRINTAGE 0
90 # define LJUST 0
91 # define KEYSETDIR NULL /* keysets */
92 # define LOGFILE ""
93 # define LOGLEVEL "error"
94 # define SYSLOGFACILITY "none"
95 # define SYSLOGLEVEL "notice"
96 # define VERBOSELOG 0
97 # define ZONEFILE "zone.db"
98 # define DNSKEYFILE "dnskey.db"
99 # define LOOKASIDEDOMAIN "" /* "dlv.trusted-keys.de" */
100 # define SIG_RANDOM NULL /* "/dev/urandom" */
101 # define SIG_PSEUDO 0
102 # define SIG_GENDS 1
103 # define SIG_PARAM ""
104 # define DIST_CMD NULL /* default is to run "rndc reload" */
105 # define NAMED_CHROOT NULL /* default is none */
107 #ifndef CONFIG_PATH
108 # define CONFIG_PATH "/var/named/"
109 #endif
110 # define CONFIG_FILE CONFIG_PATH "dnssec.conf"
111 # define LOCALCONF_FILE "dnssec.conf"
113 /* external command execution path (should be set via config.h) */
114 #ifndef BIND_UTIL_PATH
115 # define BIND_UTIL_PATH "/usr/local/sbin/" /* beware of trailing '/' */
116 #endif
117 # define SIGNCMD BIND_UTIL_PATH "dnssec-signzone"
118 # define KEYGENCMD BIND_UTIL_PATH "dnssec-keygen"
119 # define RELOADCMD BIND_UTIL_PATH "rndc"
121 typedef enum {
122 Unixtime = 1,
123 Incremental
124 } serial_form_t;
126 typedef enum {
127 none = 0,
128 user,
129 local0, local1, local2, local3, local4, local5, local6, local7
130 } syslog_facility_t;
132 typedef struct zconf {
133 char *zonedir;
134 int recursive;
135 int printtime;
136 int printage;
137 int ljust;
138 long sigvalidity; /* should be less than expire time */
139 long max_ttl; /* should be set to the maximum used ttl in the zone */
140 long key_ttl;
141 long proptime; /* expected time offset for zone propagation */
142 #if defined (DEF_TTL)
143 long def_ttl; /* default ttl set in soa record */
144 #endif
145 serial_form_t serialform; /* format of serial no */
146 long resign; /* resign interval */
148 int k_algo;
149 int k2_algo;
150 long k_life;
151 int k_bits;
152 char *k_random;
153 long z_life;
154 /* int z_algo; no longer used; renamed to k2_algo (v0.99) */
155 int z_bits;
156 char *z_random;
157 int saltbits;
159 char *view;
160 int noexec;
161 // char *errlog;
162 char *logfile;
163 char *loglevel;
164 char *syslogfacility;
165 char *sysloglevel;
166 int verboselog;
167 int verbosity;
168 char *keyfile;
169 char *zonefile;
170 char *keysetdir;
171 char *lookaside;
172 char *sig_random;
173 int sig_pseudo;
174 int sig_gends;
175 char *sig_param;
176 char *dist_cmd; /* cmd to run instead of "rndc reload" */
177 char *chroot_dir; /* chroot directory of named */
178 } zconf_t;
180 extern zconf_t *loadconfig (const char *filename, zconf_t *z);
181 extern zconf_t *loadconfig_fromstr (const char *str, zconf_t *z);
182 extern zconf_t *dupconfig (const zconf_t *conf);
183 extern int setconfigpar (zconf_t *conf, char *entry, const void *pval);
184 extern int printconfig (const char *fname, const zconf_t *cp);
185 extern int checkconfig (const zconf_t *z);
187 #endif