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.24.2.8.4.4.2.9.2.5 2005/03/29 16:35:11 martinea Exp $
30 * interface for config file reading code
38 #define CONFFILE_NAME "amanda.conf"
82 CNF_AMRECOVER_CHECK_LABEL,
83 CNF_AMRECOVER_CHANGER,
93 typedef struct tapetype_s {
94 struct tapetype_s *next;
101 unsigned long length;
102 unsigned long filemark;
116 /* Dump strategies */
117 #define DS_SKIP 0 /* Don't do any dumps at all */
118 #define DS_STANDARD 1 /* Standard (0 1 1 1 1 2 2 2 ...) */
119 #define DS_NOFULL 2 /* No full's (1 1 1 ...) */
120 #define DS_NOINC 3 /* No inc's (0 0 0 ...) */
121 #define DS_4 4 /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */
122 #define DS_5 5 /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */
123 #define DS_HANOI 6 /* Tower of Hanoi (? ? ? ? ? ...) */
124 #define DS_INCRONLY 7 /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */
126 /* Estimate strategies */
127 #define ES_CLIENT 0 /* client estimate */
128 #define ES_SERVER 1 /* server estimate */
129 #define ES_CALCSIZE 2 /* calcsize estimate */
131 /* Compression types */
132 #define COMP_NONE 0 /* No compression */
133 #define COMP_FAST 1 /* Fast compression on client */
134 #define COMP_BEST 2 /* Best compression on client */
135 #define COMP_SERV_FAST 3 /* Fast compression on server */
136 #define COMP_SERV_BEST 4 /* Best compression on server */
139 #define ALGO_FIRSTFIT 1
140 #define ALGO_LARGEST 2
141 #define ALGO_LARGESTFIT 3
142 #define ALGO_SMALLEST 4
145 typedef struct dumptype_s {
146 struct dumptype_s *next;
156 int exclude_optional;
157 int include_optional;
173 float comprate[2]; /* first is full, second is incremental */
175 unsigned int record:1;
176 unsigned int skip_incr:1;
177 unsigned int skip_full:1;
178 unsigned int no_hold:1;
179 unsigned int kencrypt:1;
180 unsigned int ignore:1;
181 unsigned int index:1;
190 int s_exclude_optional;
191 int s_include_optional;
217 /* A network interface */
218 typedef struct interface_s {
219 struct interface_s *next;
224 int maxusage; /* bandwidth we can consume [kb/s] */
230 int curusage; /* current usage */
234 typedef struct holdingdisk_s {
235 struct holdingdisk_s *next;
249 void *up; /* generic user pointer */
252 /* for each column we define some values on how to
253 * format this column element
256 char *Name; /* column name */
257 char PrefixSpace; /* the blank space to print before this
258 * column. It is used to get the space
261 char Width; /* the widht of the column itself */
262 char Precision; /* the precision if its a float */
263 char MaxWidth; /* if set, Width will be recalculated
264 * to the space needed */
265 char *Format; /* the printf format string for this
268 char *Title; /* the title to use for this column */
271 /* this corresponds to the normal output of amanda, but may
272 * be adapted to any spacing as you like.
274 extern ColumnInfo ColumnData[];
276 extern char *config_name;
277 extern char *config_dir;
279 extern holdingdisk_t *holdingdisks;
280 extern int num_holdingdisks;
282 int read_conffile P((char *filename));
283 int getconf_seen P((confparm_t parameter));
284 int getconf_int P((confparm_t parameter));
285 double getconf_real P((confparm_t parameter));
286 char *getconf_str P((confparm_t parameter));
287 char *getconf_byname P((char *confname));
288 dumptype_t *lookup_dumptype P((char *identifier));
289 dumptype_t *read_dumptype P((char *name, FILE *from, char *fname, int *linenum));
290 tapetype_t *lookup_tapetype P((char *identifier));
291 interface_t *lookup_interface P((char *identifier));
292 holdingdisk_t *getconf_holdingdisks P((void));
293 long int getconf_unit_divisor P((void));
295 int ColumnDataCount P((void));
296 int StringToColumn P((char *s));
297 char LastChar P((char *s));
298 int SetColumDataFromString P((ColumnInfo* ci, char *s, char **errstr));
300 char *taperalgo2str P((int taperalgo));
302 #endif /* ! CONFFILE_H */