|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* Amanda, The Advanced Maryland Automatic Network Disk Archiver
|
|
Packit Service |
392537 |
* Copyright (c) 1991-1998 University of Maryland at College Park
|
|
Packit Service |
392537 |
* Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
|
|
Packit Service |
392537 |
* Copyright (c) 2013-2016 Carbonite, Inc. All Rights Reserved.
|
|
Packit Service |
392537 |
* All Rights Reserved.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
Packit Service |
392537 |
* documentation for any purpose is hereby granted without fee, provided that
|
|
Packit Service |
392537 |
* the above copyright notice appear in all copies and that both that
|
|
Packit Service |
392537 |
* copyright notice and this permission notice appear in supporting
|
|
Packit Service |
392537 |
* documentation, and that the name of U.M. not be used in advertising or
|
|
Packit Service |
392537 |
* publicity pertaining to distribution of the software without specific,
|
|
Packit Service |
392537 |
* written prior permission. U.M. makes no representations about the
|
|
Packit Service |
392537 |
* suitability of this software for any purpose. It is provided "as is"
|
|
Packit Service |
392537 |
* without express or implied warranty.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
|
Packit Service |
392537 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
|
|
Packit Service |
392537 |
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
Packit Service |
392537 |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
Packit Service |
392537 |
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
Packit Service |
392537 |
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* Author: James da Silva, Systems Design and Analysis Group
|
|
Packit Service |
392537 |
* Computer Science Department
|
|
Packit Service |
392537 |
* University of Maryland at College Park
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
/*
|
|
Packit Service |
392537 |
* $Id: diskfile.h,v 1.38 2006/06/22 20:41:33 martinea Exp $
|
|
Packit Service |
392537 |
*
|
|
Packit Service |
392537 |
* interface for disklist file reading code
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
#ifndef DISKFILE_H
|
|
Packit Service |
392537 |
#define DISKFILE_H
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
#include "amanda.h"
|
|
Packit Service |
392537 |
#include "conffile.h"
|
|
Packit Service |
392537 |
#include "fileheader.h"
|
|
Packit Service |
392537 |
#include "amfeatures.h"
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct netif_s {
|
|
Packit Service |
392537 |
struct netif_s *next;
|
|
Packit Service |
392537 |
interface_t *config;
|
|
Packit Service |
392537 |
unsigned long curusage;
|
|
Packit Service |
392537 |
} netif_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct amhost_s {
|
|
Packit Service |
392537 |
struct amhost_s *next; /* next host */
|
|
Packit Service |
392537 |
char *hostname; /* name of host */
|
|
Packit Service |
392537 |
struct disk_s *disks; /* linked list of disk records */
|
|
Packit Service |
392537 |
int inprogress; /* # dumps in progress */
|
|
Packit Service |
392537 |
int maxdumps; /* maximum dumps in parallel */
|
|
Packit Service |
392537 |
netif_t *netif; /* network interface this host is on */
|
|
Packit Service |
392537 |
time_t start_t; /* time last dump was started on this host */
|
|
Packit Service |
392537 |
am_feature_t *features; /* feature set */
|
|
Packit Service |
392537 |
int pre_script;
|
|
Packit Service |
392537 |
int post_script;
|
|
Packit Service |
392537 |
int status;
|
|
Packit Service |
392537 |
} am_host_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct disk_s {
|
|
Packit Service |
392537 |
int line; /* line number of last definition */
|
|
Packit Service |
392537 |
char *filename; /* the filename where it is read */
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
am_host_t *host; /* host list */
|
|
Packit Service |
392537 |
struct disk_s *hostnext;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *hostname; /* hostname */
|
|
Packit Service |
392537 |
char *name; /* label name for disk */
|
|
Packit Service |
392537 |
char *device; /* device name for disk, eg "sd0g" */
|
|
Packit Service |
392537 |
char *dtype_name; /* name of dump type */
|
|
Packit Service |
392537 |
dumptype_t *config; /* pointer to the dumptype config */
|
|
Packit Service |
392537 |
char *program; /* dump program, eg DUMP, STAR, GNUTAR */
|
|
Packit Service |
392537 |
char *srvcompprog; /* custom compression server filter */
|
|
Packit Service |
392537 |
char *clntcompprog; /* custom compression client filter */
|
|
Packit Service |
392537 |
char *srv_encrypt; /* custom encryption server filter */
|
|
Packit Service |
392537 |
char *clnt_encrypt; /* custom encryption client filter */
|
|
Packit Service |
392537 |
char *amandad_path; /* amandad path on the client */
|
|
Packit Service |
392537 |
char *client_username; /* username to connect on the client */
|
|
Packit Service |
392537 |
char *ssl_fingerprint_file; /* */
|
|
Packit Service |
392537 |
char *ssl_cert_file; /* */
|
|
Packit Service |
392537 |
char *ssl_key_file; /* */
|
|
Packit Service |
392537 |
char *ssl_ca_cert_file; /* */
|
|
Packit Service |
392537 |
char *ssl_cipher_list; /* */
|
|
Packit Service |
392537 |
int ssl_check_host; /* */
|
|
Packit Service |
392537 |
int ssl_check_certificate_host; /* */
|
|
Packit Service |
392537 |
int ssl_check_fingerprint; /* */
|
|
Packit Service |
392537 |
char *client_port; /* port to connect on the client */
|
|
Packit Service |
392537 |
char *ssh_keys; /* ssh_key file to use */
|
|
Packit Service |
392537 |
am_sl_t *exclude_file; /* file exclude spec */
|
|
Packit Service |
392537 |
am_sl_t *exclude_list; /* exclude list */
|
|
Packit Service |
392537 |
am_sl_t *include_file; /* file include spec */
|
|
Packit Service |
392537 |
am_sl_t *include_list; /* include list */
|
|
Packit Service |
392537 |
int exclude_optional; /* exclude list are optional */
|
|
Packit Service |
392537 |
int include_optional; /* include list are optional */
|
|
Packit Service |
392537 |
int priority; /* priority of disk */
|
|
Packit Service |
392537 |
int allow_split;
|
|
Packit Service |
392537 |
int max_warnings;
|
|
Packit Service |
392537 |
off_t tape_splitsize; /* size of dumpfile chunks on tape */
|
|
Packit Service |
392537 |
char *split_diskbuffer; /* place where we can buffer PORT-WRITE dumps other than RAM */
|
|
Packit Service |
392537 |
off_t fallback_splitsize; /* size for in-RAM PORT-WRITE buffers */
|
|
Packit Service |
392537 |
int dumpcycle; /* days between fulls */
|
|
Packit Service |
392537 |
long frequency; /* XXX - not used */
|
|
Packit Service |
392537 |
char *auth; /* type of authentication (per disk) */
|
|
Packit Service |
392537 |
int maxdumps; /* max number of parallel dumps (per system) */
|
|
Packit Service |
392537 |
int maxpromoteday; /* maximum of promote day */
|
|
Packit Service |
392537 |
int bumppercent;
|
|
Packit Service |
392537 |
off_t bumpsize;
|
|
Packit Service |
392537 |
int bumpdays;
|
|
Packit Service |
392537 |
double bumpmult;
|
|
Packit Service |
392537 |
time_t starttime; /* start this dump after this time (integer: HHMM) */
|
|
Packit Service |
392537 |
time_t start_t; /* start this dump after this time (time_t) */
|
|
Packit Service |
392537 |
int strategy; /* what dump strategy to use */
|
|
Packit Service |
392537 |
int ignore; /* ignore */
|
|
Packit Service |
392537 |
estimatelist_t estimatelist; /* what estimate strategy to use */
|
|
Packit Service |
392537 |
int compress; /* type of compression to use */
|
|
Packit Service |
392537 |
int encrypt; /* type of encryption to use */
|
|
Packit Service |
392537 |
char *srv_decrypt_opt; /* server-side decryption option parameter to use */
|
|
Packit Service |
392537 |
char *clnt_decrypt_opt; /* client-side decryption option parameter to use */
|
|
Packit Service |
392537 |
double comprate[2]; /* default compression rates */
|
|
Packit Service |
392537 |
/* flag options */
|
|
Packit Service |
392537 |
int record; /* record dump in /etc/dumpdates ? */
|
|
Packit Service |
392537 |
int skip_incr; /* incs done externally ? */
|
|
Packit Service |
392537 |
int skip_full; /* fulls done externally ? */
|
|
Packit Service |
392537 |
int orig_holdingdisk; /* original holdingdisk setting */
|
|
Packit Service |
392537 |
int to_holdingdisk; /* holding disk setting */
|
|
Packit Service |
392537 |
int kencrypt;
|
|
Packit Service |
392537 |
int index; /* produce an index ? */
|
|
Packit Service |
392537 |
data_path_t data_path; /* defined data-path */
|
|
Packit Service |
392537 |
char *dataport_list; /* list of address to send data */
|
|
Packit Service |
392537 |
char *shm_name; /* shm-ring name to put data to */
|
|
Packit Service |
392537 |
int spindle; /* spindle # - for parallel dumps */
|
|
Packit Service |
392537 |
int inprogress; /* being dumped now? */
|
|
Packit Service |
392537 |
int todo;
|
|
Packit Service |
392537 |
char *application;
|
|
Packit Service |
392537 |
identlist_t pp_scriptlist;
|
|
Packit Service |
392537 |
host_limit_t *dump_limit;
|
|
Packit Service |
392537 |
int retry_dump;
|
|
Packit Service |
392537 |
identlist_t tags;
|
|
Packit Service |
392537 |
int status; /* for amcheck */
|
|
Packit Service |
392537 |
} disk_t;
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
typedef struct disklist_s {
|
|
Packit Service |
392537 |
GList *head, *tail;
|
|
Packit Service |
392537 |
} disklist_t;
|
|
Packit Service |
392537 |
#define get_disk(dlist)((disk_t *)((dlist)->data))
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
#define empty(dlist) ((dlist).head == NULL)
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* This function is integrated with the conffile.c error-handling; handle its return
|
|
Packit Service |
392537 |
* value just as you would the return of config_init() */
|
|
Packit Service |
392537 |
cfgerr_level_t read_diskfile(const char *, disklist_t *);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
disklist_t * get_disklist(void);
|
|
Packit Service |
392537 |
am_host_t *get_hostlist(void);
|
|
Packit Service |
392537 |
am_host_t *lookup_host(const char *hostname);
|
|
Packit Service |
392537 |
disk_t *lookup_disk(const char *hostname, const char *diskname);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
disk_t *add_disk(disklist_t *list, char *hostname, char *diskname);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
void enqueue_disk(disklist_t *list, disk_t *disk);
|
|
Packit Service |
392537 |
void headqueue_disk(disklist_t *list, disk_t *disk);
|
|
Packit Service |
392537 |
void insert_disk(disklist_t *list, disk_t *disk, int (*f)(disk_t *a, disk_t *b));
|
|
Packit Service |
392537 |
int find_disk(disklist_t *list, disk_t *disk);
|
|
Packit Service |
392537 |
void sort_disk(disklist_t *in, disklist_t *out, int (*f)(disk_t *a, disk_t *b));
|
|
Packit Service |
392537 |
disk_t *dequeue_disk(disklist_t *list);
|
|
Packit Service |
392537 |
void remove_disk(disklist_t *list, disk_t *disk);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
void dump_queue(char *str, disklist_t q, int npr, FILE *f);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
char *optionstr(disk_t *dp);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* xml_optionstr()
|
|
Packit Service |
392537 |
* to_server must be set to 1 if the result is sent to another server
|
|
Packit Service |
392537 |
* application, eg. driver to dumper.
|
|
Packit Service |
392537 |
* It must be set to 0 if the result is sent to the client.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
gchar **validate_optionstr(disk_t *dp);
|
|
Packit Service |
392537 |
char *xml_optionstr(disk_t *dp, int to_server);
|
|
Packit Service |
392537 |
char *xml_optionstr_disk(char *hostname, char *diskname);
|
|
Packit Service |
392537 |
char *xml_estimate(estimatelist_t estimatelist, am_feature_t *their_features);
|
|
Packit Service |
392537 |
char *xml_estimate_disk(char *hostname, char *diskname,
|
|
Packit Service |
392537 |
am_feature_t *their_features);
|
|
Packit Service |
392537 |
char *clean_dle_str_for_client(char *dle_str, am_feature_t *their_features);
|
|
Packit Service |
392537 |
char *xml_application(disk_t *dp, application_t *application,
|
|
Packit Service |
392537 |
am_feature_t *their_features);
|
|
Packit Service |
392537 |
char *xml_application_disk(char *hostname, char *diskname,
|
|
Packit Service |
392537 |
am_feature_t *their_features);
|
|
Packit Service |
392537 |
char *xml_scripts(identlist_t pp_scriptlist, am_feature_t *their_features);
|
|
Packit Service |
392537 |
char *xml_dumptype_properties(disk_t *dp);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
/* disable_skip_disk() set the db->todo flag to 0 for each dle with 'ignore'
|
|
Packit Service |
392537 |
* 'strategy skip'. It is useful for all programs that want to skip them,i
|
|
Packit Service |
392537 |
* eg. all amdump process.
|
|
Packit Service |
392537 |
* Program use for listing dump or index should not use it.
|
|
Packit Service |
392537 |
*/
|
|
Packit Service |
392537 |
void disable_skip_disk(disklist_t *origqp);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
GPtrArray *match_disklist(disklist_t *origqp, gboolean exact_match, int sargc,
|
|
Packit Service |
392537 |
char **sargv);
|
|
Packit Service |
392537 |
gboolean match_dumpfile(dumpfile_t *file, gboolean exact_match, int sargc,
|
|
Packit Service |
392537 |
char **sargv);
|
|
Packit Service |
392537 |
void free_disklist(disklist_t *dl);
|
|
Packit Service |
392537 |
void unload_disklist(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
netif_t *disklist_netifs(void);
|
|
Packit Service |
392537 |
|
|
Packit Service |
392537 |
#endif /* ! DISKFILE_H */
|