2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 1991-1998 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: diskfile.h,v 1.38 2006/06/22 20:41:33 martinea Exp $
30 * interface for disklist file reading code
37 #include "amfeatures.h"
39 typedef struct amhost_s {
40 struct amhost_s *next; /* next host */
41 char *hostname; /* name of host */
42 struct disk_s *disks; /* linked list of disk records */
43 int inprogress; /* # dumps in progress */
44 int maxdumps; /* maximum dumps in parallel */
45 interface_t *netif; /* network interface this host is on */
46 time_t start_t; /* start dump after this time */
47 char *up; /* generic user pointer */
48 am_feature_t *features; /* feature set */
51 typedef struct disk_s {
52 int line; /* line number of last definition */
53 struct disk_s *prev, *next; /* doubly linked disk list */
55 am_host_t *host; /* host list */
56 struct disk_s *hostnext;
58 char *hostname; /* hostname */
59 char *name; /* label name for disk */
60 char *device; /* device name for disk, eg "sd0g" */
61 char *dtype_name; /* name of dump type XXX shouldn't need this */
62 char *program; /* dump program, eg DUMP, STAR, GNUTAR */
63 char *srvcompprog; /* custom compression server filter */
64 char *clntcompprog; /* custom compression client filter */
65 char *srv_encrypt; /* custom encryption server filter */
66 char *clnt_encrypt; /* custom encryption client filter */
67 char *amandad_path; /* amandad path on the client */
68 char *client_username; /* username to connect on the client */
69 char *ssh_keys; /* ssh_key file to use */
70 sl_t *exclude_file; /* file exclude spec */
71 sl_t *exclude_list; /* exclude list */
72 sl_t *include_file; /* file include spec */
73 sl_t *include_list; /* include list */
74 int exclude_optional; /* exclude list are optional */
75 int include_optional; /* include list are optional */
76 int priority; /* priority of disk */
77 off_t tape_splitsize; /* size of dumpfile chunks on tape */
78 char *split_diskbuffer; /* place where we can buffer PORT-WRITE dumps other than RAM */
79 off_t fallback_splitsize; /* size for in-RAM PORT-WRITE buffers */
80 int dumpcycle; /* days between fulls */
81 long frequency; /* XXX - not used */
82 char *security_driver; /* type of authentication (per disk) */
83 int maxdumps; /* max number of parallel dumps (per system) */
84 int maxpromoteday; /* maximum of promote day */
89 time_t starttime; /* start this dump after this time */
90 time_t start_t; /* start this dump after this time */
91 int strategy; /* what dump strategy to use */
92 int ignore; /* ignore */
93 int estimate; /* what estimate strategy to use */
94 int compress; /* type of compression to use */
95 int encrypt; /* type of encryption to use */
96 char *srv_decrypt_opt; /* server-side decryption option parameter to use */
97 char *clnt_decrypt_opt; /* client-side decryption option parameter to use */
98 double comprate[2]; /* default compression rates */
100 int record; /* record dump in /etc/dumpdates ? */
101 int skip_incr; /* incs done externally ? */
102 int skip_full; /* fulls done externally ? */
103 int to_holdingdisk; /* use holding disk ? */
105 int index; /* produce an index ? */
106 int spindle; /* spindle # - for parallel dumps */
107 int inprogress; /* being dumped now? */
109 void *up; /* generic user pointer */
112 typedef struct disklist_s {
116 #define empty(dlist) ((dlist).head == NULL)
119 int read_diskfile(const char *, disklist_t *);
121 am_host_t *lookup_host(const char *hostname);
122 disk_t *lookup_disk(const char *hostname, const char *diskname);
124 disk_t *add_disk(disklist_t *list, char *hostname, char *diskname);
126 void enqueue_disk(disklist_t *list, disk_t *disk);
127 void headqueue_disk(disklist_t *list, disk_t *disk);
128 void insert_disk(disklist_t *list, disk_t *disk, int (*f)(disk_t *a, disk_t *b));
129 int find_disk(disklist_t *list, disk_t *disk);
130 void sort_disk(disklist_t *in, disklist_t *out, int (*f)(disk_t *a, disk_t *b));
131 disk_t *dequeue_disk(disklist_t *list);
132 void remove_disk(disklist_t *list, disk_t *disk);
134 void dump_queue(char *str, disklist_t q, int npr, FILE *f);
136 char *optionstr(disk_t *dp, am_feature_t *their_features, FILE *fdout);
138 char *match_disklist(disklist_t *origqp, int sargc, char **sargv);
139 void free_disklist(disklist_t *dl);
141 #endif /* ! DISKFILE_H */