static RES_ITEM dir_items[] = {
{"name", store_name, ITEM(res_dir.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0},
- {"dirport", store_int, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101},
+ {"dirport", store_pint32, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101},
{"address", store_str, ITEM(res_dir.address), 0, 0, 0},
{"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0},
{"tlsenable", store_bool, ITEM(res_dir.tls_enable), 1, 0, 0},
/* Director */
struct DIRRES {
RES hdr;
- int DIRport; /* UA server port */
+ uint32_t DIRport; /* UA server port */
char *address; /* UA server address */
char *password; /* UA server password */
char *tls_ca_certfile; /* TLS CA Certificate File */
/* Transfer default items from JobDefs Resource */
for (i=0; job_items[i].name; i++) {
char **def_svalue, **svalue; /* string value */
- int *def_ivalue, *ivalue; /* integer value */
+ uint32_t *def_ivalue, *ivalue; /* integer value */
bool *def_bvalue, *bvalue; /* bool value */
int64_t *def_lvalue, *lvalue; /* 64 bit values */
uint32_t offset;
set_bit(i, job->hdr.item_present);
}
/*
- * Handle integer fields
+ * Handle 32 bit integer fields
* Note, our store_bit does not handle bitmaped fields
*/
} else if (job_items[i].handler == store_bit ||
- job_items[i].handler == store_pint ||
+ job_items[i].handler == store_pint32 ||
job_items[i].handler == store_jobtype ||
job_items[i].handler == store_level ||
- job_items[i].handler == store_pint ||
+ job_items[i].handler == store_int32 ||
job_items[i].handler == store_migtype ||
job_items[i].handler == store_replace) {
- def_ivalue = (int *)((char *)(job->jobdefs) + offset);
+ def_ivalue = (uint32_t *)((char *)(job->jobdefs) + offset);
Dmsg5(400, "Job \"%s\", field \"%s\" def_ivalue=%d item %d offset=%u\n",
job->name(), job_items[i].name, *def_ivalue, i, offset);
- ivalue = (int *)((char *)job + offset);
+ ivalue = (uint32_t *)((char *)job + offset);
*ivalue = *def_ivalue;
set_bit(i, job->hdr.item_present);
/*
{"scriptsdirectory", store_dir, ITEM(res_dir.scripts_directory), 0, 0, 0},
{"piddirectory",store_dir, ITEM(res_dir.pid_directory), 0, ITEM_REQUIRED, 0},
{"subsysdirectory", store_dir, ITEM(res_dir.subsys_directory), 0, 0, 0},
- {"maximumconcurrentjobs", store_pint, ITEM(res_dir.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
+ {"maximumconcurrentjobs", store_pint32, ITEM(res_dir.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
{"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0},
{"fdconnecttimeout", store_time,ITEM(res_dir.FDConnectTimeout), 0, ITEM_DEFAULT, 60 * 30},
{"sdconnecttimeout", store_time,ITEM(res_dir.SDConnectTimeout), 0, ITEM_DEFAULT, 60 * 30},
{"description", store_str, ITEM(res_client.hdr.desc), 0, 0, 0},
{"address", store_str, ITEM(res_client.address), 0, ITEM_REQUIRED, 0},
{"fdaddress", store_str, ITEM(res_client.address), 0, 0, 0},
- {"fdport", store_pint, ITEM(res_client.FDport), 0, ITEM_DEFAULT, 9102},
+ {"fdport", store_pint32, ITEM(res_client.FDport), 0, ITEM_DEFAULT, 9102},
{"password", store_password, ITEM(res_client.password), 0, ITEM_REQUIRED, 0},
{"fdpassword", store_password, ITEM(res_client.password), 0, 0, 0},
{"catalog", store_res, ITEM(res_client.catalog), R_CATALOG, ITEM_REQUIRED, 0},
{"jobretention", store_time, ITEM(res_client.JobRetention), 0, ITEM_DEFAULT, 60*60*24*180},
{"heartbeatinterval", store_time, ITEM(res_client.heartbeat_interval), 0, ITEM_DEFAULT, 0},
{"autoprune", store_bool, ITEM(res_client.AutoPrune), 0, ITEM_DEFAULT, true},
- {"maximumconcurrentjobs", store_pint, ITEM(res_client.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
+ {"maximumconcurrentjobs", store_pint32, ITEM(res_client.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
{"tlsenable", store_bool, ITEM(res_client.tls_enable), 0, 0, 0},
{"tlsrequire", store_bool, ITEM(res_client.tls_require), 0, 0, 0},
{"tlscacertificatefile", store_dir, ITEM(res_client.tls_ca_certfile), 0, 0, 0},
static RES_ITEM store_items[] = {
{"name", store_name, ITEM(res_store.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(res_store.hdr.desc), 0, 0, 0},
- {"sdport", store_pint, ITEM(res_store.SDport), 0, ITEM_DEFAULT, 9103},
+ {"sdport", store_pint32, ITEM(res_store.SDport), 0, ITEM_DEFAULT, 9103},
{"address", store_str, ITEM(res_store.address), 0, ITEM_REQUIRED, 0},
{"sdaddress", store_str, ITEM(res_store.address), 0, 0, 0},
{"password", store_password, ITEM(res_store.password), 0, ITEM_REQUIRED, 0},
{"autochanger", store_bool, ITEM(res_store.autochanger), 0, ITEM_DEFAULT, 0},
{"enabled", store_bool, ITEM(res_store.enabled), 0, ITEM_DEFAULT, true},
{"heartbeatinterval", store_time, ITEM(res_store.heartbeat_interval), 0, ITEM_DEFAULT, 0},
- {"maximumconcurrentjobs", store_pint, ITEM(res_store.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
- {"sddport", store_pint, ITEM(res_store.SDDport), 0, 0, 0}, /* deprecated */
+ {"maximumconcurrentjobs", store_pint32, ITEM(res_store.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
+ {"sddport", store_pint32, ITEM(res_store.SDDport), 0, 0, 0}, /* deprecated */
{"tlsenable", store_bool, ITEM(res_store.tls_enable), 0, 0, 0},
{"tlsrequire", store_bool, ITEM(res_store.tls_require), 0, 0, 0},
{"tlscacertificatefile", store_dir, ITEM(res_store.tls_ca_certfile), 0, 0, 0},
{"description", store_str, ITEM(res_cat.hdr.desc), 0, 0, 0},
{"address", store_str, ITEM(res_cat.db_address), 0, 0, 0},
{"dbaddress", store_str, ITEM(res_cat.db_address), 0, 0, 0},
- {"dbport", store_pint, ITEM(res_cat.db_port), 0, 0, 0},
+ {"dbport", store_pint32, ITEM(res_cat.db_port), 0, 0, 0},
/* keep this password as store_str for the moment */
{"password", store_str, ITEM(res_cat.db_password), 0, 0, 0},
{"dbpassword", store_str, ITEM(res_cat.db_password), 0, 0, 0},
{"runafterfailedjob", store_short_runscript, ITEM(res_job.RunScripts), 0, 0, 0},
{"clientrunbeforejob", store_short_runscript, ITEM(res_job.RunScripts), 0, 0, 0},
{"clientrunafterjob", store_short_runscript, ITEM(res_job.RunScripts), 0, 0, 0},
- {"maximumconcurrentjobs", store_pint, ITEM(res_job.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
+ {"maximumconcurrentjobs", store_pint32, ITEM(res_job.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
{"rescheduleonerror", store_bool, ITEM(res_job.RescheduleOnError), 0, ITEM_DEFAULT, false},
{"rescheduleinterval", store_time, ITEM(res_job.RescheduleInterval), 0, ITEM_DEFAULT, 60 * 30},
- {"rescheduletimes", store_pint, ITEM(res_job.RescheduleTimes), 0, 0, 0},
- {"priority", store_pint, ITEM(res_job.Priority), 0, ITEM_DEFAULT, 10},
+ {"rescheduletimes", store_pint32, ITEM(res_job.RescheduleTimes), 0, 0, 0},
+ {"priority", store_pint32, ITEM(res_job.Priority), 0, ITEM_DEFAULT, 10},
{"writepartafterjob", store_bool, ITEM(res_job.write_part_after_job), 0, ITEM_DEFAULT, true},
{"selectionpattern", store_str, ITEM(res_job.selection_pattern), 0, 0, 0},
{"runscript", store_runscript, ITEM(res_job.RunScripts), 0, ITEM_NO_EQUALS, 0},
{"purgeoldestvolume", store_bool, ITEM(res_pool.purge_oldest_volume), 0, 0, 0},
{"recycleoldestvolume", store_bool, ITEM(res_pool.recycle_oldest_volume), 0, 0, 0},
{"recyclecurrentvolume", store_bool, ITEM(res_pool.recycle_current_volume), 0, 0, 0},
- {"maximumvolumes", store_pint, ITEM(res_pool.max_volumes), 0, 0, 0},
- {"maximumvolumejobs", store_pint, ITEM(res_pool.MaxVolJobs), 0, 0, 0},
- {"maximumvolumefiles", store_pint, ITEM(res_pool.MaxVolFiles), 0, 0, 0},
+ {"maximumvolumes", store_pint32, ITEM(res_pool.max_volumes), 0, 0, 0},
+ {"maximumvolumejobs", store_pint32, ITEM(res_pool.MaxVolJobs), 0, 0, 0},
+ {"maximumvolumefiles", store_pint32, ITEM(res_pool.MaxVolFiles), 0, 0, 0},
{"maximumvolumebytes", store_size, ITEM(res_pool.MaxVolBytes), 0, 0, 0},
{"catalogfiles", store_bool, ITEM(res_pool.catalog_files), 0, ITEM_DEFAULT, true},
{"volumeretention", store_time, ITEM(res_pool.VolRetention), 0, ITEM_DEFAULT, 60*60*24*365},
static RES_ITEM counter_items[] = {
{"name", store_name, ITEM(res_counter.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(res_counter.hdr.desc), 0, 0, 0},
- {"minimum", store_int, ITEM(res_counter.MinValue), 0, ITEM_DEFAULT, 0},
- {"maximum", store_pint, ITEM(res_counter.MaxValue), 0, ITEM_DEFAULT, INT32_MAX},
+ {"minimum", store_int32, ITEM(res_counter.MinValue), 0, ITEM_DEFAULT, 0},
+ {"maximum", store_pint32, ITEM(res_counter.MaxValue), 0, ITEM_DEFAULT, INT32_MAX},
{"wrapcounter", store_res, ITEM(res_counter.WrapCounter), R_COUNTER, 0, 0},
{"catalog", store_res, ITEM(res_counter.Catalog), R_CATALOG, 0, 0},
{NULL, NULL, {0}, 0, 0, 0}
/* Store the type both pass 1 and pass 2 */
for (i=0; migtypes[i].type_name; i++) {
if (strcasecmp(lc->str, migtypes[i].type_name) == 0) {
- *(int *)(item->value) = migtypes[i].job_type;
+ *(uint32_t *)(item->value) = migtypes[i].job_type;
i = 0;
break;
}
/* Store the type both pass 1 and pass 2 */
for (i=0; jobtypes[i].type_name; i++) {
if (strcasecmp(lc->str, jobtypes[i].type_name) == 0) {
- *(int *)(item->value) = jobtypes[i].job_type;
+ *(uint32_t *)(item->value) = jobtypes[i].job_type;
i = 0;
break;
}
/* Store the level pass 2 so that type is defined */
for (i=0; joblevels[i].level_name; i++) {
if (strcasecmp(lc->str, joblevels[i].level_name) == 0) {
- *(int *)(item->value) = joblevels[i].level;
+ *(uint32_t *)(item->value) = joblevels[i].level;
i = 0;
break;
}
/* Scan Replacement options */
for (i=0; ReplaceOptions[i].name; i++) {
if (strcasecmp(lc->str, ReplaceOptions[i].name) == 0) {
- *(int *)(item->value) = ReplaceOptions[i].token;
+ *(uint32_t *)(item->value) = ReplaceOptions[i].token;
i = 0;
break;
}
lex_get_token(lc, T_NAME);
if (strcasecmp(lc->str, "before") == 0) {
- *(int *)(item->value) = SCRIPT_Before ;
+ *(uint32_t *)(item->value) = SCRIPT_Before ;
} else if (strcasecmp(lc->str, "after") == 0) {
- *(int *)(item->value) = SCRIPT_After;
+ *(uint32_t *)(item->value) = SCRIPT_After;
} else if (strcasecmp(lc->str, "always") == 0) {
- *(int *)(item->value) = SCRIPT_Any;
+ *(uint32_t *)(item->value) = SCRIPT_Any;
} else {
scan_err2(lc, _("Expect %s, got: %s"), "Before, After or Always", lc->str);
}
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
/* Used for certain KeyWord tables */
struct s_kw {
const char *name;
- int token;
+ int32_t token;
};
/* Job Level keyword structure */
struct s_jl {
- const char *level_name; /* level keyword */
- int level; /* level */
- int job_type; /* JobType permitting this level */
+ const char *level_name; /* level keyword */
+ int32_t level; /* level */
+ int32_t job_type; /* JobType permitting this level */
};
/* Job Type keyword structure */
struct s_jt {
const char *type_name;
- int job_type;
+ int32_t job_type;
};
/* Definition of the contents of each Resource */
RES hdr;
bool found; /* found with SD */
- int num_writers; /* number of writers */
- int max_writers; /* = 1 for files */
- int reserved; /* number of reserves */
- int num_drives; /* for autochanger */
+ uint32_t num_writers; /* number of writers */
+ uint32_t max_writers; /* = 1 for files */
+ uint32_t reserved; /* number of reserves */
+ int32_t num_drives; /* for autochanger */
bool autochanger; /* set if device is autochanger */
bool open; /* drive open */
bool append; /* in append mode */
public:
RES hdr;
- int db_port; /* Port */
+ uint32_t db_port; /* Port */
char *db_address; /* host name for remote access */
char *db_socket; /* Socket for local access */
char *db_password;
char *db_user;
char *db_name;
- int mult_db_connections; /* set if multiple connections wanted */
+ uint32_t mult_db_connections; /* set if multiple connections wanted */
/* Methods */
char *name() const;
public:
RES hdr;
- int FDport; /* Where File daemon listens */
+ uint32_t FDport; /* Where File daemon listens */
utime_t FileRetention; /* file retention period in seconds */
utime_t JobRetention; /* job retention period in seconds */
utime_t heartbeat_interval; /* Interval to send heartbeats */
public:
RES hdr;
- int SDport; /* port where Directors connect */
- int SDDport; /* data port for File daemon */
+ uint32_t SDport; /* port where Directors connect */
+ uint32_t SDDport; /* data port for File daemon */
char *address;
char *password;
char *media_type;
bool autochanger; /* set if autochanger */
int64_t StorageId; /* Set from Storage DB record */
utime_t heartbeat_interval; /* Interval to send heartbeats */
- int drives; /* number of drives in autochanger */
+ uint32_t drives; /* number of drives in autochanger */
/* Methods */
char *dev_name() const;
public:
RES hdr;
- int JobType; /* job type (backup, verify, restore */
- int JobLevel; /* default backup/verify level */
- int Priority; /* Job priority */
- int RestoreJobId; /* What -- JobId to restore */
+ uint32_t JobType; /* job type (backup, verify, restore */
+ uint32_t JobLevel; /* default backup/verify level */
+ uint32_t Priority; /* Job priority */
+ uint32_t RestoreJobId; /* What -- JobId to restore */
char *RestoreWhere; /* Where on disk to restore -- directory */
char *RegexWhere; /* RegexWhere option */
char *strip_prefix; /* remove prefix from filename */
char *WriteBootstrap; /* Where to write bootstrap Job updates */
char *WriteVerifyList; /* List of changed files */
};
- int replace; /* How (overwrite, ..) */
+ uint32_t replace; /* How (overwrite, ..) */
utime_t MaxRunTime; /* max run time in seconds */
utime_t MaxWaitTime; /* max blocking time in seconds */
utime_t FullMaxWaitTime; /* Max Full job wait time */
utime_t JobRetention; /* job retention period in seconds */
uint32_t MaxConcurrentJobs; /* Maximum concurrent jobs */
int64_t spool_size; /* Size of spool file for this job */
- int RescheduleTimes; /* Number of times to reschedule job */
+ int32_t RescheduleTimes; /* Number of times to reschedule job */
bool RescheduleOnError; /* Set to reschedule on error */
bool PrefixLinks; /* prefix soft links with Where path */
bool PruneJobs; /* Force pruning of Jobs */
POOL *inc_pool; /* Pool for Incremental backups */
POOL *diff_pool; /* Pool for Differental backups */
char *selection_pattern;
- int selection_type;
+ uint32_t selection_type;
union {
JOB *verify_job; /* Job name to verify */
};
struct INCEXE {
FOPTS *current_opts; /* points to current options structure */
FOPTS **opts_list; /* options list */
- int num_opts; /* number of options items */
+ int32_t num_opts; /* number of options items */
alist name_list; /* filename list -- holds char * */
};
bool new_include; /* Set if new include used */
INCEXE **include_items; /* array of incexe structures */
- int num_includes; /* number in array */
+ int32_t num_includes; /* number in array */
INCEXE **exclude_items;
- int num_excludes;
+ int32_t num_excludes;
bool have_MD5; /* set if MD5 initialized */
struct MD5Context md5c; /* MD5 of include/exclude */
char MD5[30]; /* base 64 representation of MD5 */
char *pool_type; /* Pool type */
char *label_format; /* Label format string */
char *cleaning_prefix; /* Cleaning label prefix */
- int32_t LabelType; /* Bacula/ANSI/IBM label type */
+ uint32_t LabelType; /* Bacula/ANSI/IBM label type */
uint32_t max_volumes; /* max number of volumes */
utime_t VolRetention; /* volume retention period in seconds */
utime_t VolUseDuration; /* duration volume can be used */
class RUN {
public:
RUN *next; /* points to next run record */
- int level; /* level override */
- int Priority; /* priority override */
- int job_type;
+ uint32_t level; /* level override */
+ uint32_t Priority; /* priority override */
+ uint32_t job_type;
bool spool_data; /* Data spooling override */
bool spool_data_set; /* Data spooling override given */
bool write_part_after_job; /* Write part after job override */
STORE *storage; /* Storage override */
MSGS *msgs; /* Messages override */
char *since;
- int level_no;
- int minute; /* minute to run job */
+ uint32_t level_no;
+ uint32_t minute; /* minute to run job */
time_t last_run; /* last time run */
time_t next_run; /* next time to run */
char hour[nbytes_for_bits(24)]; /* bit set for each hour */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
{"piddirectory", store_dir, ITEM(res_client.pid_directory), 0, ITEM_REQUIRED, 0},
{"subsysdirectory", store_dir, ITEM(res_client.subsys_directory), 0, 0, 0},
{"scriptsdirectory", store_dir, ITEM(res_client.scripts_directory), 0, 0, 0},
- {"maximumconcurrentjobs", store_pint, ITEM(res_client.MaxConcurrentJobs), 0, ITEM_DEFAULT, 20},
+ {"maximumconcurrentjobs", store_pint32, ITEM(res_client.MaxConcurrentJobs), 0, ITEM_DEFAULT, 20},
{"messages", store_res, ITEM(res_client.messages), R_MSGS, 0, 0},
{"sdconnecttimeout", store_time,ITEM(res_client.SDConnectTimeout), 0, ITEM_DEFAULT, 60 * 30},
{"heartbeatinterval", store_time, ITEM(res_client.heartbeat_interval), 0, ITEM_DEFAULT, 0},
- {"maximumnetworkbuffersize", store_pint, ITEM(res_client.max_network_buffer_size), 0, 0, 0},
+ {"maximumnetworkbuffersize", store_pint32, ITEM(res_client.max_network_buffer_size), 0, 0, 0},
#ifdef DATA_ENCRYPTION
{"pkisignatures", store_bool, ITEM(res_client.pki_sign), 0, ITEM_DEFAULT, 0},
{"pkiencryption", store_bool, ITEM(res_client.pki_encrypt), 0, ITEM_DEFAULT, 0},
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-20087 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
char *subsys_directory;
char *scripts_directory;
MSGS *messages; /* daemon message handler */
- int MaxConcurrentJobs;
+ uint32_t MaxConcurrentJobs;
utime_t SDConnectTimeout; /* timeout in seconds */
utime_t heartbeat_interval; /* Interval to send heartbeats */
uint32_t max_network_buffer_size; /* max network buf size */
-/*
- * Main configuration file parser for Bacula User Agent
- * some parts may be split into separate files such as
- * the schedule configuration (sch_config.c).
- *
- * Note, the configuration file parser consists of three parts
- *
- * 1. The generic lexical scanner in lib/lex.c and lib/lex.h
- *
- * 2. The generic config scanner in lib/parse_config.c and
- * lib/parse_config.h.
- * These files contain the parser code, some utility
- * routines, and the common store routines (name, int,
- * string).
- *
- * 3. The daemon specific file, which contains the Resource
- * definitions as well as any specific store routines
- * for the resource records.
- *
- * Kern Sibbald, January MM, September MM
- *
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ * Main configuration file parser for Bacula User Agent
+ * some parts may be split into separate files such as
+ * the schedule configuration (sch_config.c).
+ *
+ * Note, the configuration file parser consists of three parts
+ *
+ * 1. The generic lexical scanner in lib/lex.c and lib/lex.h
+ *
+ * 2. The generic config scanner in lib/parse_config.c and
+ * lib/parse_config.h.
+ * These files contain the parser code, some utility
+ * routines, and the common store routines (name, int,
+ * string).
+ *
+ * 3. The daemon specific file, which contains the Resource
+ * definitions as well as any specific store routines
+ * for the resource records.
+ *
+ * Kern Sibbald, January MM, September MM
+ *
+ * Version $Id$
+ */
#include "bacula.h"
#include "console_conf.h"
static RES_ITEM dir_items[] = {
{"name", store_name, ITEM(dir_res.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(dir_res.hdr.desc), 0, 0, 0},
- {"dirport", store_int, ITEM(dir_res.DIRport), 0, ITEM_DEFAULT, 9101},
+ {"dirport", store_pint32, ITEM(dir_res.DIRport), 0, ITEM_DEFAULT, 9101},
{"address", store_str, ITEM(dir_res.address), 0, ITEM_REQUIRED, 0},
{"password", store_password, ITEM(dir_res.password), 0, 0, 0},
{"tlsenable", store_bool, ITEM(dir_res.tls_enable), 1, 0, 0},
-/*
- * Bacula GNOME User Agent specific configuration and defines
- *
- * Kern Sibbald, March 2002
- *
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ * Bacula GNOME User Agent specific configuration and defines
+ *
+ * Kern Sibbald, March 2002
+ *
+ * Version $Id$
+ */
#ifndef __CONSOLE_CONF_H_
#define __CONSOLE_CONF_H_
/* Definition of the contents of each Resource */
struct DIRRES {
RES hdr;
- int DIRport; /* UA server port */
+ uint32_t DIRport; /* UA server port */
char *address; /* UA server address */
char *password; /* UA server password */
bool tls_enable; /* Enable TLS */
class JCR {
private:
pthread_mutex_t mutex; /* jcr mutex */
- volatile int _use_count; /* use count */
+ volatile int32_t _use_count; /* use count */
public:
void lock() {P(mutex); };
void unlock() {V(mutex); };
void inc_use_count(void) {lock(); _use_count++; unlock(); };
void dec_use_count(void) {lock(); _use_count--; unlock(); };
- int use_count() { return _use_count; };
+ int32_t use_count() { return _use_count; };
void init_mutex(void) {pthread_mutex_init(&mutex, NULL); };
void destroy_mutex(void) {pthread_mutex_destroy(&mutex); };
bool is_job_canceled() {return job_canceled(this); };
uint64_t JobBytes; /* Number of bytes processed this job */
uint64_t ReadBytes; /* Bytes read -- before compression */
uint32_t Errors; /* Number of non-fatal errors */
- volatile int JobStatus; /* ready, running, blocked, terminated */
- int JobType; /* backup, restore, verify ... */
- int JobLevel; /* Job level */
- int JobPriority; /* Job priority */
+ volatile int32_t JobStatus; /* ready, running, blocked, terminated */
+ int32_t JobType; /* backup, restore, verify ... */
+ int32_t JobLevel; /* Job level */
+ int32_t JobPriority; /* Job priority */
time_t sched_time; /* job schedule time, i.e. when it should start */
time_t start_time; /* when job actually started */
time_t run_time; /* used for computing speed */
char *where; /* prefix to restore files to */
char *RegexWhere; /* file relocation in restore */
alist *where_bregexp; /* BREGEXP alist for path manipulation */
- int cached_pnl; /* cached path length */
+ int32_t cached_pnl; /* cached path length */
POOLMEM *cached_path; /* cached path */
bool prefix_links; /* Prefix links with Where path */
bool gui; /* set if gui using console */
uint32_t SDJobFiles; /* Number of files written, this job */
uint64_t SDJobBytes; /* Number of bytes processed this job */
uint32_t SDErrors; /* Number of non-fatal errors */
- volatile int SDJobStatus; /* Storage Job Status */
- volatile int FDJobStatus; /* File daemon Job Status */
+ volatile int32_t SDJobStatus; /* Storage Job Status */
+ volatile int32_t FDJobStatus; /* File daemon Job Status */
uint32_t ExpectedFiles; /* Expected restore files */
uint32_t MediaId; /* DB record IDs associated with this job */
FileId_t FileId; /* Last file id inserted */
POOLMEM *rpool_source; /* Where migrate read pool came from */
POOLMEM *rstore_source; /* Where read storage came from */
POOLMEM *wstore_source; /* Where write storage came from */
- int replace; /* Replace option */
- int NumVols; /* Number of Volume used in pool */
- int reschedule_count; /* Number of times rescheduled */
+ int32_t replace; /* Replace option */
+ int32_t NumVols; /* Number of Volume used in pool */
+ int32_t reschedule_count; /* Number of times rescheduled */
int64_t spool_size; /* Spool size for this job */
bool spool_data; /* Spool data in SD */
bool acquired_resource_locks; /* set if resource locks acquired */
POOLMEM *compress_buf; /* Compression buffer */
int32_t compress_buf_size; /* Length of compression buffer */
void *pZLIB_compress_workset; /* zlib compression session data */
- int replace; /* Replace options */
- int buf_size; /* length of buffer */
+ int32_t replace; /* Replace options */
+ int32_t buf_size; /* length of buffer */
FF_PKT *ff; /* Find Files packet */
char stored_addr[MAX_NAME_LENGTH]; /* storage daemon address */
uint32_t StartFile;
int32_t NumWriteVolumes; /* number of volumes written */
int32_t NumReadVolumes; /* total number of volumes to read */
int32_t CurReadVolume; /* current read volume number */
- int label_errors; /* count of label errors */
+ int32_t label_errors; /* count of label errors */
bool session_opened;
long Ticket; /* ticket for this job */
bool ignore_label_errors; /* ignore Volume label errors */
bool no_attributes; /* set if no attributes wanted */
int64_t spool_size; /* Spool size for this job */
bool spool_data; /* set to spool data */
- int CurVol; /* Current Volume count */
+ int32_t CurVol; /* Current Volume count */
DIRRES* director; /* Director resource */
alist *write_store; /* list of write storage devices sent by DIR */
alist *read_store; /* list of read devices sent by DIR */
uint32_t read_StartBlock;
uint32_t read_EndBlock;
/* Device wait times */
- int min_wait;
- int max_wait;
- int max_num_wait;
- int wait_sec;
- int rem_wait_sec;
- int num_wait;
+ int32_t min_wait;
+ int32_t max_wait;
+ int32_t max_num_wait;
+ int32_t wait_sec;
+ int32_t rem_wait_sec;
+ int32_t num_wait;
#endif /* STORAGE_DAEMON */
*/
struct s_last_job {
dlink link;
- int Errors; /* FD/SD errors */
- int JobType;
- int JobStatus;
- int JobLevel;
+ int32_t Errors; /* FD/SD errors */
+ int32_t JobType;
+ int32_t JobStatus;
+ int32_t JobLevel;
uint32_t JobId;
uint32_t VolSessionId;
uint32_t VolSessionTime;
struct s_mtypes {
const char *name;
- int token;
+ uint32_t token;
};
/* Various message types */
static struct s_mtypes msg_types[] = {
/* Used for certain KeyWord tables */
struct s_kw {
const char *name;
- int token;
+ uint32_t token;
};
/*
items[i].default_value);
if (items[i].flags & ITEM_DEFAULT && items[i].default_value != 0) {
if (items[i].handler == store_bit) {
- *(int *)(items[i].value) |= items[i].code;
+ *(uint32_t *)(items[i].value) |= items[i].code;
} else if (items[i].handler == store_bool) {
*(bool *)(items[i].value) = items[i].default_value != 0;
- } else if (items[i].handler == store_pint ||
- items[i].handler == store_int) {
- *(int *)(items[i].value) = items[i].default_value;
+ } else if (items[i].handler == store_pint32 ||
+ items[i].handler == store_int32) {
+ *(int32_t *)(items[i].value) = items[i].default_value;
} else if (items[i].handler == store_int64) {
*(int64_t *)(items[i].value) = items[i].default_value;
} else if (items[i].handler == store_size) {
/* Store an integer at specified address */
-void store_int(LEX *lc, RES_ITEM *item, int index, int pass)
+void store_int32(LEX *lc, RES_ITEM *item, int index, int pass)
{
lex_get_token(lc, T_INT32);
- *(int *)(item->value) = lc->int32_val;
+ *(int32_t *)(item->value) = lc->int32_val;
scan_to_eol(lc);
set_bit(index, res_all.hdr.item_present);
}
/* Store a positive integer at specified address */
-void store_pint(LEX *lc, RES_ITEM *item, int index, int pass)
+void store_pint32(LEX *lc, RES_ITEM *item, int index, int pass)
{
lex_get_token(lc, T_PINT32);
- *(int *)(item->value) = lc->pint32_val;
+ *(uint32_t *)(item->value) = lc->pint32_val;
scan_to_eol(lc);
set_bit(index, res_all.hdr.item_present);
}
{
lex_get_token(lc, T_NAME);
if (strcasecmp(lc->str, "yes") == 0 || strcasecmp(lc->str, "true") == 0) {
- *(int *)(item->value) |= item->code;
+ *(uint32_t *)(item->value) |= item->code;
} else if (strcasecmp(lc->str, "no") == 0 || strcasecmp(lc->str, "false") == 0) {
- *(int *)(item->value) &= ~(item->code);
+ *(uint32_t *)(item->value) &= ~(item->code);
} else {
scan_err2(lc, _("Expect %s, got: %s"), "YES, NO, TRUE, or FALSE", lc->str); /* YES and NO must not be translated */
}
/* Store the label pass 2 so that type is defined */
for (i=0; tapelabels[i].name; i++) {
if (strcasecmp(lc->str, tapelabels[i].name) == 0) {
- *(int *)(item->value) = tapelabels[i].token;
+ *(uint32_t *)(item->value) = tapelabels[i].token;
i = 0;
break;
}
RES *resvalue;
RES **presvalue;
};
- int code; /* item code/additional info */
- int flags; /* flags: default, required, ... */
- int default_value; /* default value */
+ int32_t code; /* item code/additional info */
+ int32_t flags; /* flags: default, required, ... */
+ int32_t default_value; /* default value */
};
/* For storing name_addr items in res_items table */
RES *next; /* pointer to next resource of this type */
char *name; /* resource name */
char *desc; /* resource description */
- int rcode; /* resource id or type */
- int refcnt; /* reference count for releasing */
+ uint32_t rcode; /* resource id or type */
+ int32_t refcnt; /* reference count for releasing */
char item_present[MAX_RES_ITEMS]; /* set if item is present in conf file */
};
struct RES_TABLE {
const char *name; /* resource name */
RES_ITEM *items; /* list of resource keywords */
- int rcode; /* code if needed */
+ uint32_t rcode; /* code if needed */
};
/* Common Resource definitions */
void store_res(LEX *lc, RES_ITEM *item, int index, int pass);
void store_alist_res(LEX *lc, RES_ITEM *item, int index, int pass);
void store_alist_str(LEX *lc, RES_ITEM *item, int index, int pass);
-void store_int(LEX *lc, RES_ITEM *item, int index, int pass);
-void store_pint(LEX *lc, RES_ITEM *item, int index, int pass);
+void store_int32(LEX *lc, RES_ITEM *item, int index, int pass);
+void store_pint32(LEX *lc, RES_ITEM *item, int index, int pass);
void store_msgs(LEX *lc, RES_ITEM *item, int index, int pass);
void store_int64(LEX *lc, RES_ITEM *item, int index, int pass);
void store_bit(LEX *lc, RES_ITEM *item, int index, int pass);
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
static RES_ITEM dir_items[] = {
{"name", store_name, ITEM(dir_res.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(dir_res.hdr.desc), 0, 0, 0},
- {"dirport", store_int, ITEM(dir_res.DIRport), 0, ITEM_DEFAULT, 9101},
+ {"dirport", store_pint32, ITEM(dir_res.DIRport), 0, ITEM_DEFAULT, 9101},
{"address", store_str, ITEM(dir_res.address), 0, ITEM_REQUIRED, 0},
{"password", store_password, ITEM(dir_res.password), 0, 0, 0},
{"tlsenable", store_bool, ITEM(dir_res.tls_enable), 1, 0, 0},
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2002-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2002-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
class DIRRES {
public:
RES hdr;
- int DIRport; /* UA server port */
+ uint32_t DIRport; /* UA server port */
char *address; /* UA server address */
char *password; /* UA server password */
bool tls_enable; /* Enable TLS */
{"piddirectory", store_dir, ITEM(res_store.pid_directory), 0, ITEM_REQUIRED, 0},
{"subsysdirectory", store_dir, ITEM(res_store.subsys_directory), 0, 0, 0},
{"scriptsdirectory", store_dir, ITEM(res_store.scripts_directory), 0, 0, 0},
- {"maximumconcurrentjobs", store_pint, ITEM(res_store.max_concurrent_jobs), 0, ITEM_DEFAULT, 20},
- {"heartbeatinterval", store_time, ITEM(res_store.heartbeat_interval), 0, ITEM_DEFAULT, 0},
+ {"maximumconcurrentjobs", store_pint32, ITEM(res_store.max_concurrent_jobs), 0, ITEM_DEFAULT, 20},
+ {"heartbeatinterval", store_time, ITEM(res_store.heartbeat_interval), 0, ITEM_DEFAULT, 0},
{"tlsenable", store_bool, ITEM(res_store.tls_enable), 1, 0, 0},
{"tlsrequire", store_bool, ITEM(res_store.tls_require), 1, 0, 0},
{"tlsverifypeer", store_bool, ITEM(res_store.tls_verify_peer), 1, ITEM_DEFAULT, 1},
{"alertcommand", store_strname,ITEM(res_dev.alert_command), 0, 0, 0},
{"maximumchangerwait", store_time, ITEM(res_dev.max_changer_wait), 0, ITEM_DEFAULT, 5 * 60},
{"maximumopenwait", store_time, ITEM(res_dev.max_open_wait), 0, ITEM_DEFAULT, 5 * 60},
- {"maximumopenvolumes", store_pint, ITEM(res_dev.max_open_vols), 0, ITEM_DEFAULT, 1},
- {"maximumnetworkbuffersize", store_pint, ITEM(res_dev.max_network_buffer_size), 0, 0, 0},
+ {"maximumopenvolumes", store_pint32, ITEM(res_dev.max_open_vols), 0, ITEM_DEFAULT, 1},
+ {"maximumnetworkbuffersize", store_pint32, ITEM(res_dev.max_network_buffer_size), 0, 0, 0},
{"volumepollinterval", store_time, ITEM(res_dev.vol_poll_interval), 0, 0, 0},
{"maximumrewindwait", store_time, ITEM(res_dev.max_rewind_wait), 0, ITEM_DEFAULT, 5 * 60},
- {"minimumblocksize", store_pint, ITEM(res_dev.min_block_size), 0, 0, 0},
- {"maximumblocksize", store_pint, ITEM(res_dev.max_block_size), 0, 0, 0},
+ {"minimumblocksize", store_pint32, ITEM(res_dev.min_block_size), 0, 0, 0},
+ {"maximumblocksize", store_pint32, ITEM(res_dev.max_block_size), 0, 0, 0},
{"maximumvolumesize", store_size, ITEM(res_dev.max_volume_size), 0, 0, 0},
{"maximumfilesize", store_size, ITEM(res_dev.max_file_size), 0, ITEM_DEFAULT, 1000000000},
{"volumecapacity", store_size, ITEM(res_dev.volume_capacity), 0, 0, 0},
{"spooldirectory", store_dir, ITEM(res_dev.spool_directory), 0, 0, 0},
{"maximumspoolsize", store_size, ITEM(res_dev.max_spool_size), 0, 0, 0},
{"maximumjobspoolsize", store_size, ITEM(res_dev.max_job_spool_size), 0, 0, 0},
- {"driveindex", store_pint, ITEM(res_dev.drive_index), 0, 0, 0},
+ {"driveindex", store_pint32, ITEM(res_dev.drive_index), 0, 0, 0},
{"maximumpartsize", store_size, ITEM(res_dev.max_part_size), 0, ITEM_DEFAULT, 0},
{"mountpoint", store_strname,ITEM(res_dev.mount_point), 0, 0, 0},
{"mountcommand", store_strname,ITEM(res_dev.mount_command), 0, 0, 0},
/* Store the label pass 2 so that type is defined */
for (i=0; dev_types[i].name; i++) {
if (strcasecmp(lc->str, dev_types[i].name) == 0) {
- *(int *)(item->value) = dev_types[i].token;
+ *(uint32_t *)(item->value) = dev_types[i].token;
i = 0;
break;
}
char *changer_command; /* Changer command -- external program */
char *alert_command; /* Alert command -- external program */
char *spool_directory; /* Spool file directory */
- int dev_type; /* device type */
- int label_type; /* label type */
+ uint32_t dev_type; /* device type */
+ uint32_t label_type; /* label type */
bool autoselect; /* Automatically select from AutoChanger */
uint32_t drive_index; /* Autochanger drive index */
- int cap_bits; /* Capabilities of this device */
+ uint32_t cap_bits; /* Capabilities of this device */
utime_t max_changer_wait; /* Changer timeout */
utime_t max_rewind_wait; /* maximum secs to wait for rewind */
utime_t max_open_wait; /* maximum secs to wait for open */
static RES_ITEM dir_items[] = {
{"name", store_name, ITEM(res_dir.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0},
- {"dirport", store_int, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101},
+ {"dirport", store_pint32, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101},
{"address", store_str, ITEM(res_dir.address), 0, 0, 0},
{"enablessl", store_bool, ITEM(res_dir.enable_ssl), 1, ITEM_DEFAULT, 0},
{NULL, NULL, {0}, 0, 0, 0}
{"name", store_name, ITEM(res_client.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(res_client.hdr.desc), 0, 0, 0},
{"address", store_str, ITEM(res_client.address), 0, ITEM_REQUIRED, 0},
- {"fdport", store_pint, ITEM(res_client.FDport), 0, ITEM_DEFAULT, 9102},
+ {"fdport", store_pint32, ITEM(res_client.FDport), 0, ITEM_DEFAULT, 9102},
{"password", store_password, ITEM(res_client.password), 0, ITEM_REQUIRED, 0},
{"enablessl", store_bool, ITEM(res_client.enable_ssl), 1, ITEM_DEFAULT, 0},
{NULL, NULL, {0}, 0, 0, 0}
static RES_ITEM store_items[] = {
{"name", store_name, ITEM(res_store.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(res_store.hdr.desc), 0, 0, 0},
- {"sdport", store_pint, ITEM(res_store.SDport), 0, ITEM_DEFAULT, 9103},
+ {"sdport", store_pint32, ITEM(res_store.SDport), 0, ITEM_DEFAULT, 9103},
{"address", store_str, ITEM(res_store.address), 0, ITEM_REQUIRED, 0},
{"sdaddress", store_str, ITEM(res_store.address), 0, 0, 0},
{"password", store_password, ITEM(res_store.password), 0, ITEM_REQUIRED, 0},
/* Director */
struct DIRRES {
RES hdr;
- int DIRport; /* UA server port */
+ uint32_t DIRport; /* UA server port */
char *address; /* UA server address */
bool enable_ssl; /* Use SSL */
};
*/
struct MONITOR {
RES hdr;
- int require_ssl; /* Require SSL for all connections */
+ bool require_ssl; /* Require SSL for all connections */
MSGS *messages; /* Daemon message handler */
char *password; /* UA server password */
utime_t RefreshInterval; /* Status refresh interval */
struct CLIENT {
RES hdr;
- int FDport; /* Where File daemon listens */
+ uint32_t FDport; /* Where File daemon listens */
char *address;
char *password;
bool enable_ssl; /* Use SSL */
struct STORE {
RES hdr;
- int SDport; /* port where Directors connect */
+ uint32_t SDport; /* port where Directors connect */
char *address;
char *password;
bool enable_ssl; /* Use SSL */
static RES_ITEM dir_items[] = {
{"name", store_name, ITEM(res_dir.hdr.name), 0, ITEM_REQUIRED, 0},
{"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0},
- {"dirport", store_int, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101},
+ {"dirport", store_pint32, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101},
{"address", store_str, ITEM(res_dir.address), 0, 0, 0},
{"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0},
{"tlscacertificatefile", store_dir, ITEM(res_dir.tls_ca_certfile), 0, 0, 0},
-/*
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ * Version $Id$
+ */
#ifndef CONSOLECONF_H
#define CONSOLECONF_H
/* Director */
struct DIRRES {
RES hdr;
- int DIRport; /* UA server port */
+ uint32_t DIRport; /* UA server port */
char *address; /* UA server address */
char *password; /* UA server password */
char *tls_ca_certfile; /* TLS CA Certificate File */
Technical notes on version 2.2
General:
+18Jun08
+kes More work on word alignments -- eliminate all ints from
+ the configuration routines.
17Jun08
kes Fix bug reported by Scott Barninger where the bacula script
refers to scripts in the wrong directory. Needed to meet the