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