]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/stored_conf.h
a262f1f8d6c368126eeed824324e0df0e36cdd4d
[bacula/bacula] / bacula / src / stored / stored_conf.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2015 Kern Sibbald
5    Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
6
7    The original author of Bacula is Kern Sibbald, with contributions
8    from many others, a complete list can be found in the file AUTHORS.
9
10    You may use this file and others of this release according to the
11    license defined in the LICENSE file, which includes the Affero General
12    Public License, v3.0 ("AGPLv3") and some additional permissions and
13    terms pursuant to its AGPLv3 Section 7.
14
15    This notice must be preserved when any source code is 
16    conveyed and/or propagated.
17
18    Bacula(R) is a registered trademark of Kern Sibbald.
19 */
20
21 extern s_kw dev_types[];
22
23 /*
24  * Resource codes -- they must be sequential for indexing
25  *
26  */
27
28 enum {
29    R_DIRECTOR = 3001,
30    R_STORAGE,
31    R_DEVICE,
32    R_MSGS,
33    R_AUTOCHANGER,
34    R_FIRST = R_DIRECTOR,
35    R_LAST  = R_AUTOCHANGER            /* keep this updated */
36 };
37
38 enum {
39    R_NAME = 3020,
40    R_ADDRESS,
41    R_PASSWORD,
42    R_TYPE,
43    R_BACKUP
44 };
45
46
47 /* Definition of the contents of each Resource */
48 class DIRRES {
49 public:
50    RES   hdr;
51
52    char *password;                    /* Director password */
53    char *address;                     /* Director IP address or zero */
54    bool monitor;                      /* Have only access to status and .status functions */
55    bool tls_authenticate;             /* Authenticate with TLS */
56    bool tls_enable;                   /* Enable TLS */
57    bool tls_require;                  /* Require TLS */
58    bool tls_verify_peer;              /* TLS Verify Client Certificate */
59    char *tls_ca_certfile;             /* TLS CA Certificate File */
60    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
61    char *tls_certfile;                /* TLS Server Certificate File */
62    char *tls_keyfile;                 /* TLS Server Key File */
63    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
64    alist *tls_allowed_cns;            /* TLS Allowed Clients */
65
66    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
67 };
68
69
70 /* Storage daemon "global" definitions */
71 class s_res_store {
72 public:
73    RES   hdr;
74
75    dlist *sdaddrs;
76    dlist *sddaddrs;
77    char *working_directory;           /* working directory for checkpoints */
78    char *pid_directory;
79    char *subsys_directory;
80    char *plugin_directory;            /* Plugin directory */
81    char *scripts_directory;
82    uint32_t max_concurrent_jobs;      /* maximum concurrent jobs to run */
83    MSGS *messages;                    /* Daemon message handler */
84    utime_t ClientConnectTimeout;      /* Max time to wait to connect client */
85    utime_t heartbeat_interval;        /* Interval to send hb to FD */
86    utime_t client_wait;               /* Time to wait for FD to connect */
87    bool tls_authenticate;             /* Authenticate with TLS */
88    bool tls_enable;                   /* Enable TLS */
89    bool tls_require;                  /* Require TLS */
90    bool tls_verify_peer;              /* TLS Verify Client Certificate */
91    char *tls_ca_certfile;             /* TLS CA Certificate File */
92    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
93    char *tls_certfile;                /* TLS Server Certificate File */
94    char *tls_keyfile;                 /* TLS Server Key File */
95    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
96    alist *tls_allowed_cns;            /* TLS Allowed Clients */
97    char *verid;                       /* Custom Id to print in version command */
98    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
99
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    brwlock_t changer_lock;            /* 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 *control_name;                /* SCSI control device name */
121    char *changer_command;             /* Changer command  -- external program */
122    char *alert_command;               /* Alert command -- external program */
123    char *spool_directory;             /* Spool file directory */
124    uint32_t dev_type;                 /* device type */
125    uint32_t label_type;               /* label type */
126    bool enabled;                      /* Set when enabled (default) */
127    bool autoselect;                   /* Automatically select from AutoChanger */
128    bool read_only;                    /* Drive is read only */
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 padding_size;             /* adata block padding -- bytes */
135    uint32_t file_alignment;           /* adata file alignment -- bytes */
136    uint32_t min_block_size;           /* min block size */
137    uint32_t max_block_size;           /* max block size */
138    uint32_t max_volume_jobs;          /* max jobs to put on one volume */
139    uint32_t max_network_buffer_size;  /* max network buf size */
140    uint32_t max_concurrent_jobs;      /* maximum concurrent jobs this drive */
141    utime_t  vol_poll_interval;        /* interval between polling volume during mount */
142    int64_t max_volume_files;          /* max files to put on one volume */
143    int64_t max_volume_size;           /* max bytes to put on one volume */
144    int64_t max_file_size;             /* max file size in bytes */
145    int64_t volume_capacity;           /* advisory capacity */
146    int64_t min_free_space;            /* Minimum disk free space */
147    int64_t max_spool_size;            /* Max spool size for all jobs */
148    int64_t max_job_spool_size;        /* Max spool size for any single job */
149
150    int64_t max_part_size;             /* Max part size */
151    char *mount_point;                 /* Mount point for require mount devices */
152    char *mount_command;               /* Mount command */
153    char *unmount_command;             /* Unmount command */
154    char *write_part_command;          /* Write part command */
155    char *free_space_command;          /* Free space command */
156
157    /* The following are set at runtime */
158    DEVICE *dev;                       /* Pointer to phyical dev -- set at runtime */
159    AUTOCHANGER *changer_res;          /* pointer to changer res if any */
160 };
161
162
163 union URES {
164    DIRRES      res_dir;
165    STORES      res_store;
166    DEVRES      res_dev;
167    MSGS        res_msgs;
168    AUTOCHANGER res_changer;
169    RES         hdr;
170 };