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 2003/01/04 03:35:54 martinea Exp $
30 * interface for config file reading code
38 #define CONFFILE_NAME "amanda.conf"
81 CNF_AMRECOVER_CHECK_LABEL,
82 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 /* Compression types */
125 #define COMP_NONE 0 /* No compression */
126 #define COMP_FAST 1 /* Fast compression on client */
127 #define COMP_BEST 2 /* Best compression on client */
128 #define COMP_SERV_FAST 3 /* Fast compression on server */
129 #define COMP_SERV_BEST 4 /* Best compression on server */
132 #define ALGO_FIRSTFIT 1
133 #define ALGO_LARGEST 2
134 #define ALGO_LARGESTFIT 3
135 #define ALGO_SMALLEST 4
138 typedef struct dumptype_s {
139 struct dumptype_s *next;
149 int exclude_optional;
150 int include_optional;
161 float comprate[2]; /* first is full, second is incremental */
163 unsigned int record:1;
164 unsigned int skip_incr:1;
165 unsigned int skip_full:1;
166 unsigned int no_hold:1;
167 unsigned int kencrypt:1;
168 unsigned int ignore:1;
169 unsigned int index:1;
178 int s_exclude_optional;
179 int s_include_optional;
200 /* A network interface */
201 typedef struct interface_s {
202 struct interface_s *next;
207 int maxusage; /* bandwidth we can consume [kb/s] */
213 int curusage; /* current usage */
217 typedef struct holdingdisk_s {
218 struct holdingdisk_s *next;
232 void *up; /* generic user pointer */
235 /* for each column we define some values on how to
236 * format this column element
239 char *Name; /* column name */
240 char PrefixSpace; /* the blank space to print before this
241 * column. It is used to get the space
244 char Width; /* the widht of the column itself */
245 char Precision; /* the precision if its a float */
246 char MaxWidth; /* if set, Width will be recalculated
247 * to the space needed */
248 char *Format; /* the printf format string for this
251 char *Title; /* the title to use for this column */
254 /* this corresponds to the normal output of amanda, but may
255 * be adapted to any spacing as you like.
257 extern ColumnInfo ColumnData[];
259 extern char *config_name;
260 extern char *config_dir;
262 extern holdingdisk_t *holdingdisks;
263 extern int num_holdingdisks;
265 int read_conffile P((char *filename));
266 int getconf_seen P((confparm_t parameter));
267 int getconf_int P((confparm_t parameter));
268 double getconf_real P((confparm_t parameter));
269 char *getconf_str P((confparm_t parameter));
270 char *getconf_byname P((char *confname));
271 dumptype_t *lookup_dumptype P((char *identifier));
272 dumptype_t *read_dumptype P((char *name, FILE *from, char *fname, int *linenum));
273 tapetype_t *lookup_tapetype P((char *identifier));
274 interface_t *lookup_interface P((char *identifier));
275 holdingdisk_t *getconf_holdingdisks P((void));
277 int ColumnDataCount P((void));
278 int StringToColumn P((char *s));
279 char LastChar P((char *s));
280 int SetColumDataFromString P((ColumnInfo* ci, char *s, char **errstr));
282 char *taperalgo2str P((int taperalgo));
284 #endif /* ! CONFFILE_H */