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