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