]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/stored_conf.h
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / stored / stored_conf.h
1 /*
2  * Resource codes -- they must be sequential for indexing
3  *
4  *   Version $Id$
5  */
6 /*
7    Copyright (C) 2000-2006 Kern Sibbald
8
9    This program is free software; you can redistribute it and/or
10    modify it under the terms of the GNU General Public License
11    version 2 as amended with additional clauses defined in the
12    file LICENSE in the main source directory.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
17    the file LICENSE for additional details.
18
19  */
20
21 enum {
22    R_DIRECTOR = 3001,
23    R_STORAGE,
24    R_DEVICE,
25    R_MSGS,
26    R_AUTOCHANGER,
27    R_FIRST = R_DIRECTOR,
28    R_LAST  = R_AUTOCHANGER            /* keep this updated */
29 };
30
31 enum {
32    R_NAME = 3020,
33    R_ADDRESS,
34    R_PASSWORD,
35    R_TYPE,
36    R_BACKUP
37 };
38
39
40 /* Definition of the contents of each Resource */
41 class DIRRES {
42 public:
43    RES   hdr;
44
45    char *password;                    /* Director password */
46    char *address;                     /* Director IP address or zero */
47    int monitor;                       /* Have only access to status and .status functions */
48    int tls_enable;                    /* Enable TLS */
49    int tls_require;                   /* Require TLS */
50    int tls_verify_peer;              /* TLS Verify Client Certificate */
51    char *tls_ca_certfile;             /* TLS CA Certificate File */
52    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
53    char *tls_certfile;                /* TLS Server Certificate File */
54    char *tls_keyfile;                 /* TLS Server Key File */
55    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
56    alist *tls_allowed_cns;            /* TLS Allowed Clients */
57
58    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
59 };
60
61
62 /* Storage daemon "global" definitions */
63 class s_res_store {
64 public:
65    RES   hdr;
66
67    dlist *sdaddrs;
68    dlist *sddaddrs;
69    char *working_directory;           /* working directory for checkpoints */
70    char *pid_directory;
71    char *subsys_directory;
72    char *scripts_directory;
73    uint32_t max_concurrent_jobs;      /* maximum concurrent jobs to run */
74    MSGS *messages;                    /* Daemon message handler */
75    utime_t heartbeat_interval;        /* Interval to send hb to FD */
76    int tls_enable;                    /* Enable TLS */
77    int tls_require;                   /* Require TLS */
78    int tls_verify_peer;               /* TLS Verify Client Certificate */
79    char *tls_ca_certfile;             /* TLS CA Certificate File */
80    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
81    char *tls_certfile;                /* TLS Server Certificate File */
82    char *tls_keyfile;                 /* TLS Server Key File */
83    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
84    alist *tls_allowed_cns;            /* TLS Allowed Clients */
85
86    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
87 };
88 typedef struct s_res_store STORES;
89
90 class AUTOCHANGER {
91 public:
92    RES hdr;
93    alist *device;                     /* List of DEVRES device pointers */
94    char *changer_name;                /* Changer device name */
95    char *changer_command;             /* Changer command  -- external program */
96    pthread_mutex_t changer_mutex;     /* One changer operation at a time */
97 };
98
99 /* Device specific definitions */
100 class DEVRES {
101 public:
102    RES   hdr;
103
104    char *media_type;                  /* User assigned media type */
105    char *device_name;                 /* Archive device name */
106    char *changer_name;                /* Changer device name */
107    char *changer_command;             /* Changer command  -- external program */
108    char *alert_command;               /* Alert command -- external program */
109    char *spool_directory;             /* Spool file directory */
110    int   dev_type;                    /* device type */
111    int   label_type;                  /* label type */
112    int   autoselect;                  /* Automatically select from AutoChanger */
113    uint32_t drive_index;              /* Autochanger drive index */
114    uint32_t cap_bits;                 /* Capabilities of this device */
115    utime_t max_changer_wait;          /* Changer timeout */
116    utime_t max_rewind_wait;           /* maximum secs to wait for rewind */
117    utime_t max_open_wait;             /* maximum secs to wait for open */
118    uint32_t max_open_vols;            /* maximum simultaneous open volumes */
119    uint32_t min_block_size;           /* min block size */
120    uint32_t max_block_size;           /* max block size */
121    uint32_t max_volume_jobs;          /* max jobs to put on one volume */
122    uint32_t max_network_buffer_size;  /* max network buf size */
123    utime_t  vol_poll_interval;        /* interval between polling volume during mount */
124    int64_t max_volume_files;          /* max files to put on one volume */
125    int64_t max_volume_size;           /* max bytes to put on one volume */
126    int64_t max_file_size;             /* max file size in bytes */
127    int64_t volume_capacity;           /* advisory capacity */
128    int64_t max_spool_size;            /* Max spool size for all jobs */
129    int64_t max_job_spool_size;        /* Max spool size for any single job */
130    
131    int64_t max_part_size;             /* Max part size */
132    char *mount_point;                 /* Mount point for require mount devices */
133    char *mount_command;               /* Mount command */
134    char *unmount_command;             /* Unmount command */
135    char *write_part_command;          /* Write part command */
136    char *free_space_command;          /* Free space command */
137    
138    /* The following are set at runtime */
139    DEVICE *dev;                       /* Pointer to phyical dev -- set at runtime */
140    AUTOCHANGER *changer_res;          /* pointer to changer res if any */
141 };
142
143
144 union URES {
145    DIRRES      res_dir;
146    STORES      res_store;
147    DEVRES      res_dev;
148    MSGS        res_msgs;
149    AUTOCHANGER res_changer;
150    RES         hdr;
151 };