2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 1991-2000 University of Maryland at College Park
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of U.M. not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. U.M. makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
16 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Author: James da Silva, Systems Design and Analysis Group
24 * Computer Science Department
25 * University of Maryland at College Park
28 * $Id: conffile.h,v 1.60 2005/12/21 19:07:50 paddy_s Exp $
30 * interface for config file reading code
38 #define CONFFILE_NAME "amanda.conf"
82 CNF_AMRECOVER_CHECK_LABEL,
83 CNF_AMRECOVER_CHANGER,
91 typedef struct tapetype_s {
92 struct tapetype_s *next;
100 unsigned long filemark;
114 /* Dump strategies */
115 #define DS_SKIP 0 /* Don't do any dumps at all */
116 #define DS_STANDARD 1 /* Standard (0 1 1 1 1 2 2 2 ...) */
117 #define DS_NOFULL 2 /* No full's (1 1 1 ...) */
118 #define DS_NOINC 3 /* No inc's (0 0 0 ...) */
119 #define DS_4 4 /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */
120 #define DS_5 5 /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */
121 #define DS_HANOI 6 /* Tower of Hanoi (? ? ? ? ? ...) */
122 #define DS_INCRONLY 7 /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */
124 /* Estimate strategies */
125 #define ES_CLIENT 0 /* client estimate */
126 #define ES_SERVER 1 /* server estimate */
127 #define ES_CALCSIZE 2 /* calcsize estimate */
129 /* Compression types */
131 COMP_NONE, /* No compression */
132 COMP_FAST, /* Fast compression on client */
133 COMP_BEST, /* Best compression on client */
134 COMP_CUST, /* Custom compression on client */
135 COMP_SERV_FAST, /* Fast compression on server */
136 COMP_SERV_BEST, /* Best compression on server */
137 COMP_SERV_CUST /* Custom compression on server */
140 /* Encryption types */
142 ENCRYPT_NONE, /* No encryption */
143 ENCRYPT_CUST, /* Custom encryption on client */
144 ENCRYPT_SERV_CUST, /* Custom encryption on server */
148 #define ALGO_FIRSTFIT 1
149 #define ALGO_LARGEST 2
150 #define ALGO_LARGESTFIT 3
151 #define ALGO_SMALLEST 4
154 typedef struct dumptype_s {
155 struct dumptype_s *next;
169 int exclude_optional;
170 int include_optional;
175 char *security_driver;
187 char *srv_decrypt_opt;
188 char *clnt_decrypt_opt;
189 float comprate[2]; /* first is full, second is incremental */
191 char *split_diskbuffer;
192 long fallback_splitsize;
194 unsigned int record:1;
195 unsigned int skip_incr:1;
196 unsigned int skip_full:1;
197 unsigned int no_hold:1;
198 unsigned int kencrypt:1;
199 unsigned int ignore:1;
200 unsigned int index:1;
213 int s_exclude_optional;
214 int s_include_optional;
219 int s_security_driver;
231 int s_srv_decrypt_opt;
232 int s_clnt_decrypt_opt;
241 int s_tape_splitsize;
242 int s_split_diskbuffer;
243 int s_fallback_splitsize;
246 /* A network interface */
247 typedef struct interface_s {
248 struct interface_s *next;
253 int maxusage; /* bandwidth we can consume [kb/s] */
259 int curusage; /* current usage */
263 typedef struct holdingdisk_s {
264 struct holdingdisk_s *next;
278 void *up; /* generic user pointer */
281 /* for each column we define some values on how to
282 * format this column element
285 char *Name; /* column name */
286 char PrefixSpace; /* the blank space to print before this
287 * column. It is used to get the space
290 char Width; /* the widht of the column itself */
291 char Precision; /* the precision if its a float */
292 char MaxWidth; /* if set, Width will be recalculated
293 * to the space needed */
294 char *Format; /* the printf format string for this
297 char *Title; /* the title to use for this column */
300 /* this corresponds to the normal output of amanda, but may
301 * be adapted to any spacing as you like.
303 extern ColumnInfo ColumnData[];
305 extern char *config_name;
306 extern char *config_dir;
308 extern holdingdisk_t *holdingdisks;
309 extern int num_holdingdisks;
311 int read_conffile P((char *filename));
312 int getconf_seen P((confparm_t parameter));
313 int getconf_int P((confparm_t parameter));
314 am64_t getconf_am64 P((confparm_t parameter));
315 double getconf_real P((confparm_t parameter));
316 char *getconf_str P((confparm_t parameter));
317 char *getconf_byname P((char *confname));
318 dumptype_t *lookup_dumptype P((char *identifier));
319 dumptype_t *read_dumptype P((char *name, FILE *from, char *fname, int *linenum));
320 tapetype_t *lookup_tapetype P((char *identifier));
321 interface_t *lookup_interface P((char *identifier));
322 holdingdisk_t *getconf_holdingdisks P((void));
323 long int getconf_unit_divisor P((void));
325 int ColumnDataCount P((void));
326 int StringToColumn P((char *s));
327 char LastChar P((char *s));
328 int SetColumDataFromString P((ColumnInfo* ci, char *s, char **errstr));
330 char *taperalgo2str P((int taperalgo));
332 /* this is in securityconf.h */
333 char *generic_get_security_conf P((char *, void *));
334 #endif /* ! CONFFILE_H */