]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/stored_conf.h
Backport from BEE
[bacula/bacula] / bacula / src / stored / stored_conf.h
1 /*
2    Bacula® - The Network Backup Solution
3
4    Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
5
6    The main author of Bacula is Kern Sibbald, with contributions from many
7    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    Bacula® is a registered trademark of Kern Sibbald.
15 */
16
17
18 /*
19  * Resource codes -- they must be sequential for indexing
20  *
21  */
22
23 enum {
24    R_DIRECTOR = 3001,
25    R_STORAGE,
26    R_DEVICE,
27    R_MSGS,
28    R_AUTOCHANGER,
29    R_FIRST = R_DIRECTOR,
30    R_LAST  = R_AUTOCHANGER            /* keep this updated */
31 };
32
33 enum {
34    R_NAME = 3020,
35    R_ADDRESS,
36    R_PASSWORD,
37    R_TYPE,
38    R_BACKUP
39 };
40
41
42 /* Definition of the contents of each Resource */
43 class DIRRES {
44 public:
45    RES   hdr;
46
47    char *password;                    /* Director password */
48    char *address;                     /* Director IP address or zero */
49    bool monitor;                      /* Have only access to status and .status functions */
50    bool tls_authenticate;             /* Authenticate with TLS */
51    bool tls_enable;                   /* Enable TLS */
52    bool tls_require;                  /* Require TLS */
53    bool tls_verify_peer;              /* TLS Verify Client Certificate */
54    char *tls_ca_certfile;             /* TLS CA Certificate File */
55    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
56    char *tls_certfile;                /* TLS Server Certificate File */
57    char *tls_keyfile;                 /* TLS Server Key File */
58    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
59    alist *tls_allowed_cns;            /* TLS Allowed Clients */
60
61    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
62 };
63
64
65 /* Storage daemon "global" definitions */
66 class s_res_store {
67 public:
68    RES   hdr;
69
70    dlist *sdaddrs;
71    dlist *sddaddrs;
72    char *working_directory;           /* working directory for checkpoints */
73    char *pid_directory;
74    char *subsys_directory;
75    char *plugin_directory;            /* Plugin directory */
76    char *scripts_directory;
77    uint32_t max_concurrent_jobs;      /* maximum concurrent jobs to run */
78    MSGS *messages;                    /* Daemon message handler */
79    utime_t ClientConnectTimeout;      /* Max time to wait to connect client */
80    utime_t heartbeat_interval;        /* Interval to send hb to FD */
81    utime_t client_wait;               /* Time to wait for FD to connect */
82    bool tls_authenticate;             /* Authenticate with TLS */
83    bool tls_enable;                   /* Enable TLS */
84    bool tls_require;                  /* Require TLS */
85    bool tls_verify_peer;              /* TLS Verify Client Certificate */
86    char *tls_ca_certfile;             /* TLS CA Certificate File */
87    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
88    char *tls_certfile;                /* TLS Server Certificate File */
89    char *tls_keyfile;                 /* TLS Server Key File */
90    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
91    alist *tls_allowed_cns;            /* TLS Allowed Clients */
92    char *verid;                       /* Custom Id to print in version command */
93    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
94 };
95 typedef class s_res_store STORES;
96
97 class AUTOCHANGER {
98 public:
99    RES hdr;
100    alist *device;                     /* List of DEVRES device pointers */
101    char *changer_name;                /* Changer device name */
102    char *changer_command;             /* Changer command  -- external program */
103    brwlock_t changer_lock;            /* One changer operation at a time */
104 };
105
106 /* Device specific definitions */
107 class DEVRES {
108 public:
109    RES   hdr;
110
111    char *media_type;                  /* User assigned media type */
112    char *device_name;                 /* Archive device name */
113    char *changer_name;                /* Changer device name */
114    char *control_name;                /* SCSI control device name */
115    char *changer_command;             /* Changer command  -- external program */
116    char *alert_command;               /* Alert command -- external program */
117    char *spool_directory;             /* Spool file directory */
118    uint32_t dev_type;                 /* device type */
119    uint32_t label_type;               /* label type */
120    bool autoselect;                   /* Automatically select from AutoChanger */
121    bool read_only;                    /* Drive is read only */
122    uint32_t drive_index;              /* Autochanger drive index */
123    uint32_t cap_bits;                 /* Capabilities of this device */
124    utime_t max_changer_wait;          /* Changer timeout */
125    utime_t max_rewind_wait;           /* maximum secs to wait for rewind */
126    utime_t max_open_wait;             /* maximum secs to wait for open */
127    uint32_t min_block_size;           /* min block size */
128    uint32_t max_block_size;           /* max block size */
129    uint32_t max_volume_jobs;          /* max jobs to put on one volume */
130    uint32_t max_network_buffer_size;  /* max network buf size */
131    uint32_t max_concurrent_jobs;      /* maximum concurrent jobs this drive */
132    utime_t  vol_poll_interval;        /* interval between polling volume during mount */
133    int64_t max_volume_files;          /* max files to put on one volume */
134    int64_t max_volume_size;           /* max bytes to put on one volume */
135    int64_t max_file_size;             /* max file size in bytes */
136    int64_t volume_capacity;           /* advisory capacity */
137    int64_t min_free_space;            /* Minimum disk free space */
138    int64_t max_spool_size;            /* Max spool size for all jobs */
139    int64_t max_job_spool_size;        /* Max spool size for any single job */
140
141    int64_t max_part_size;             /* Max part size */
142    char *mount_point;                 /* Mount point for require mount devices */
143    char *mount_command;               /* Mount command */
144    char *unmount_command;             /* Unmount command */
145    char *write_part_command;          /* Write part command */
146    char *free_space_command;          /* Free space command */
147
148    /* The following are set at runtime */
149    DEVICE *dev;                       /* Pointer to phyical dev -- set at runtime */
150    AUTOCHANGER *changer_res;          /* pointer to changer res if any */
151 };
152
153
154 union URES {
155    DIRRES      res_dir;
156    STORES      res_store;
157    DEVRES      res_dev;
158    MSGS        res_msgs;
159    AUTOCHANGER res_changer;
160    RES         hdr;
161 };