]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/stored_conf.h
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / bacula / src / stored / stored_conf.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2017 Kern Sibbald
5
6    The original author of Bacula is Kern Sibbald, with contributions
7    from many others, a complete list can be found in the file AUTHORS.
8
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13
14    This notice must be preserved when any source code is
15    conveyed and/or propagated.
16
17    Bacula(R) is a registered trademark of Kern Sibbald.
18 */
19
20 extern s_kw dev_types[];
21
22 /*
23  * Cloud Truncate Cache options
24  */
25 enum {
26    TRUNC_NO           = 0,             /* default value */
27    TRUNC_AFTER_UPLOAD = 1,
28    TRUNC_AT_ENDOFJOB  = 2
29 };
30
31 /*
32  * Cloud Upload options
33  */
34 enum {
35    UPLOAD_EACHPART      = 0,             /* default value */
36    UPLOAD_NO            = 1,
37    UPLOAD_AT_ENDOFJOB   = 2
38 };
39
40
41 /*
42  * Resource codes -- they must be sequential for indexing
43  *
44  */
45
46 enum {
47    R_DIRECTOR    = 3001,
48    R_STORAGE     = 3002,
49    R_DEVICE      = 3003,
50    R_MSGS        = 3004,
51    R_AUTOCHANGER = 3005,
52    R_CLOUD       = 3006,
53    R_FIRST = R_DIRECTOR,
54    R_LAST  = R_CLOUD                  /* keep this updated */
55 };
56
57 enum {
58    R_NAME = 3020,
59    R_ADDRESS,
60    R_PASSWORD,
61    R_TYPE,
62    R_BACKUP
63 };
64
65
66 /* Definition of the contents of each Resource */
67
68 /*
69  * Cloud drivers
70  */
71 class CLOUD {
72 public:
73    RES   hdr;
74    char *host_name;
75    char *bucket_name;
76    char *access_key;
77    char *secret_key;
78    char *region;
79    int32_t protocol;
80    int32_t uri_style;
81    uint32_t driver_type;          /* Cloud driver type */
82    uint32_t trunc_opt;
83    uint32_t upload_opt;
84    uint32_t max_concurrent_uploads;
85    uint32_t max_concurrent_downloads;
86    uint64_t upload_limit;
87    uint64_t download_limit;
88 };
89
90 /*
91  * Director resource
92  */
93 class DIRRES {
94 public:
95    RES   hdr;
96
97    char *password;                    /* Director password */
98    char *address;                     /* Director IP address or zero */
99    bool monitor;                      /* Have only access to status and .status functions */
100    bool tls_authenticate;             /* Authenticate with TLS */
101    bool tls_enable;                   /* Enable TLS */
102    bool tls_require;                  /* Require TLS */
103    bool tls_verify_peer;              /* TLS Verify Client Certificate */
104    char *tls_ca_certfile;             /* TLS CA Certificate File */
105    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
106    char *tls_certfile;                /* TLS Server Certificate File */
107    char *tls_keyfile;                 /* TLS Server Key File */
108    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
109    alist *tls_allowed_cns;            /* TLS Allowed Clients */
110
111    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
112 };
113
114
115 /* Storage daemon "global" definitions */
116 class s_res_store {
117 public:
118    RES   hdr;
119
120    dlist *sdaddrs;
121    dlist *sddaddrs;
122    char *working_directory;           /* working directory for checkpoints */
123    char *pid_directory;
124    char *subsys_directory;
125    char *plugin_directory;            /* Plugin directory */
126    char *scripts_directory;
127    uint32_t max_concurrent_jobs;      /* maximum concurrent jobs to run */
128    MSGS *messages;                    /* Daemon message handler */
129    utime_t ClientConnectTimeout;      /* Max time to wait to connect client */
130    utime_t heartbeat_interval;        /* Interval to send hb to FD */
131    utime_t client_wait;               /* Time to wait for FD to connect */
132    bool comm_compression;             /* Set to allow comm line compression */
133    bool tls_authenticate;             /* Authenticate with TLS */
134    bool tls_enable;                   /* Enable TLS */
135    bool tls_require;                  /* Require TLS */
136    bool tls_verify_peer;              /* TLS Verify Client Certificate */
137    char *tls_ca_certfile;             /* TLS CA Certificate File */
138    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
139    char *tls_certfile;                /* TLS Server Certificate File */
140    char *tls_keyfile;                 /* TLS Server Key File */
141    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
142    alist *tls_allowed_cns;            /* TLS Allowed Clients */
143    char *verid;                       /* Custom Id to print in version command */
144    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
145
146 };
147 typedef class s_res_store STORES;
148
149 class AUTOCHANGER {
150 public:
151    RES hdr;
152    alist *device;                     /* List of DEVRES device pointers */
153    char *changer_name;                /* Changer device name */
154    char *changer_command;             /* Changer command  -- external program */
155    char *lock_command;                /* Share storage lock command -- external program */
156    brwlock_t changer_lock;            /* One changer operation at a time */
157 };
158
159 /* Device specific definitions */
160 class DEVRES {
161 public:
162    RES   hdr;
163
164    char *media_type;                  /* User assigned media type */
165    char *device_name;                 /* Archive device name */
166    char *adevice_name;                /* Aligned device name */
167    char *changer_name;                /* Changer device name */
168    char *control_name;                /* SCSI control device name */
169    char *changer_command;             /* Changer command  -- external program */
170    char *alert_command;               /* Alert command -- external program */
171    char *lock_command;                /* Share storage lock command -- external program */
172    char *spool_directory;             /* Spool file directory */
173    uint32_t dev_type;                 /* device type */
174    uint32_t label_type;               /* label type */
175    bool enabled;                      /* Set when enabled (default) */
176    bool autoselect;                   /* Automatically select from AutoChanger */
177    bool read_only;                    /* Drive is read only */
178    uint32_t drive_index;              /* Autochanger drive index */
179    uint32_t cap_bits;                 /* Capabilities of this device */
180    utime_t max_changer_wait;          /* Changer timeout */
181    utime_t max_rewind_wait;           /* maximum secs to wait for rewind */
182    utime_t max_open_wait;             /* maximum secs to wait for open */
183    uint32_t padding_size;             /* adata block padding -- bytes */
184    uint32_t file_alignment;           /* adata file alignment -- bytes */
185    uint32_t min_aligned_size;         /* minimum adata size */
186    uint32_t min_block_size;           /* min block size */
187    uint32_t max_block_size;           /* max block size */
188    uint32_t max_volume_jobs;          /* max jobs to put on one volume */
189    uint32_t max_network_buffer_size;  /* max network buf size */
190    uint32_t max_concurrent_jobs;      /* maximum concurrent jobs this drive */
191    utime_t  vol_poll_interval;        /* interval between polling volume during mount */
192    int64_t max_volume_files;          /* max files to put on one volume */
193    int64_t max_volume_size;           /* max bytes to put on one volume */
194    int64_t max_file_size;             /* max file size in bytes */
195    int64_t volume_capacity;           /* advisory capacity */
196    int64_t min_free_space;            /* Minimum disk free space */
197    int64_t max_spool_size;            /* Max spool size for all jobs */
198    int64_t max_job_spool_size;        /* Max spool size for any single job */
199
200    int64_t max_part_size;             /* Max part size */
201    char *mount_point;                 /* Mount point for require mount devices */
202    char *mount_command;               /* Mount command */
203    char *unmount_command;             /* Unmount command */
204    char *write_part_command;          /* Write part command */
205    char *free_space_command;          /* Free space command */
206    CLOUD *cloud;                      /* pointer to cloud resource */
207
208    /* The following are set at runtime */
209    DEVICE *dev;                       /* Pointer to phyical dev -- set at runtime */
210    AUTOCHANGER *changer_res;          /* pointer to changer res if any */
211 };
212
213 union URES {
214    DIRRES      res_dir;
215    STORES      res_store;
216    DEVRES      res_dev;
217    MSGS        res_msgs;
218    AUTOCHANGER res_changer;
219    CLOUD       res_cloud;
220    RES         hdr;
221 };