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