From: Kern Sibbald Date: Wed, 18 Jun 2008 19:22:03 +0000 (+0000) Subject: More work on word alignments -- eliminate all ints from X-Git-Tag: Release-2.4.1~56 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c974aa14b8a88a7376c03757cb05897519b01b4f;p=bacula%2Fbacula More work on word alignments -- eliminate all ints from the configuration routines. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7164 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/console/console_conf.c b/bacula/src/console/console_conf.c index b6a42ceac0..d2d14bf526 100644 --- a/bacula/src/console/console_conf.c +++ b/bacula/src/console/console_conf.c @@ -104,7 +104,7 @@ static RES_ITEM cons_items[] = { 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}, diff --git a/bacula/src/console/console_conf.h b/bacula/src/console/console_conf.h index 2eb8eb95b2..ab51b80f5f 100644 --- a/bacula/src/console/console_conf.h +++ b/bacula/src/console/console_conf.h @@ -78,7 +78,7 @@ struct CONRES { /* 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 */ diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index 4b25176e93..760c1e5c8d 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -642,7 +642,7 @@ static bool check_resources() /* 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; @@ -692,20 +692,20 @@ static bool check_resources() 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); /* diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 77c74c73c0..25ee74e180 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -117,7 +117,7 @@ static RES_ITEM dir_items[] = { {"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}, @@ -177,7 +177,7 @@ static RES_ITEM cli_items[] = { {"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}, @@ -185,7 +185,7 @@ static RES_ITEM cli_items[] = { {"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}, @@ -203,7 +203,7 @@ static RES_ITEM cli_items[] = { 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}, @@ -213,8 +213,8 @@ static RES_ITEM store_items[] = { {"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}, @@ -234,7 +234,7 @@ static RES_ITEM cat_items[] = { {"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}, @@ -302,11 +302,11 @@ RES_ITEM job_items[] = { {"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}, @@ -356,9 +356,9 @@ static RES_ITEM pool_items[] = { {"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}, @@ -383,8 +383,8 @@ static RES_ITEM pool_items[] = { 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} @@ -1556,7 +1556,7 @@ void store_migtype(LEX *lc, RES_ITEM *item, int index, int pass) /* 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; } @@ -1582,7 +1582,7 @@ void store_jobtype(LEX *lc, RES_ITEM *item, int index, int pass) /* 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; } @@ -1606,7 +1606,7 @@ void store_level(LEX *lc, RES_ITEM *item, int index, int pass) /* 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; } @@ -1626,7 +1626,7 @@ void store_replace(LEX *lc, RES_ITEM *item, int index, int pass) /* 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; } @@ -1674,11 +1674,11 @@ static void store_runscript_when(LEX *lc, RES_ITEM *item, int index, int pass) 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); } diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h index 61e4a32cdb..d2244b0bb7 100644 --- a/bacula/src/dird/dird_conf.h +++ b/bacula/src/dird/dird_conf.h @@ -1,7 +1,7 @@ /* 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. @@ -72,20 +72,20 @@ enum { /* 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 */ @@ -147,10 +147,10 @@ public: 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 */ @@ -220,13 +220,13 @@ class CAT { 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; @@ -243,7 +243,7 @@ class CLIENT { 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 */ @@ -277,8 +277,8 @@ class STORE { 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; @@ -296,7 +296,7 @@ public: 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; @@ -354,10 +354,10 @@ class JOB { 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 */ @@ -370,7 +370,7 @@ public: 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 */ @@ -381,7 +381,7 @@ public: 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 */ @@ -405,7 +405,7 @@ public: 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 */ }; @@ -444,7 +444,7 @@ struct FOPTS { 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 * */ }; @@ -458,9 +458,9 @@ public: 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 */ @@ -514,7 +514,7 @@ public: 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 */ @@ -572,9 +572,9 @@ union URES { 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 */ @@ -587,8 +587,8 @@ public: 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 */ diff --git a/bacula/src/filed/filed_conf.c b/bacula/src/filed/filed_conf.c index 427bc4bcfb..6df06e0a83 100644 --- a/bacula/src/filed/filed_conf.c +++ b/bacula/src/filed/filed_conf.c @@ -1,7 +1,7 @@ /* 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. @@ -96,11 +96,11 @@ static RES_ITEM cli_items[] = { {"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}, diff --git a/bacula/src/filed/filed_conf.h b/bacula/src/filed/filed_conf.h index c64b35d17d..8801f64381 100644 --- a/bacula/src/filed/filed_conf.h +++ b/bacula/src/filed/filed_conf.h @@ -1,7 +1,7 @@ /* 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. @@ -80,7 +80,7 @@ struct CLIENT { 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 */ diff --git a/bacula/src/gnome2-console/console_conf.c b/bacula/src/gnome2-console/console_conf.c index e0e605450d..e3546291fb 100644 --- a/bacula/src/gnome2-console/console_conf.c +++ b/bacula/src/gnome2-console/console_conf.c @@ -1,26 +1,3 @@ -/* - * 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 @@ -48,6 +25,29 @@ (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" @@ -79,7 +79,7 @@ int res_all_size = sizeof(res_all); 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}, diff --git a/bacula/src/gnome2-console/console_conf.h b/bacula/src/gnome2-console/console_conf.h index e5c5426d73..6aa5774757 100644 --- a/bacula/src/gnome2-console/console_conf.h +++ b/bacula/src/gnome2-console/console_conf.h @@ -1,10 +1,3 @@ -/* - * Bacula GNOME User Agent specific configuration and defines - * - * Kern Sibbald, March 2002 - * - * Version $Id$ - */ /* Bacula® - The Network Backup Solution @@ -32,6 +25,13 @@ (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_ @@ -63,7 +63,7 @@ enum { /* 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 */ diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index 8812594861..76a1916e7d 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -127,13 +127,13 @@ typedef void (JCR_free_HANDLER)(JCR *jcr); 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); }; @@ -160,10 +160,10 @@ public: 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 */ @@ -177,7 +177,7 @@ public: 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 */ @@ -224,8 +224,8 @@ public: 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 */ @@ -246,9 +246,9 @@ public: 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 */ @@ -278,8 +278,8 @@ public: 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; @@ -320,7 +320,7 @@ public: 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 */ @@ -328,7 +328,7 @@ public: 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 */ @@ -348,12 +348,12 @@ public: 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 */ @@ -365,10 +365,10 @@ public: */ 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; diff --git a/bacula/src/lib/parse_conf.c b/bacula/src/lib/parse_conf.c index c581c422c3..e03d449a79 100644 --- a/bacula/src/lib/parse_conf.c +++ b/bacula/src/lib/parse_conf.c @@ -130,7 +130,7 @@ RES_ITEM msgs_items[] = { struct s_mtypes { const char *name; - int token; + uint32_t token; }; /* Various message types */ static struct s_mtypes msg_types[] = { @@ -156,7 +156,7 @@ static struct s_mtypes msg_types[] = { /* Used for certain KeyWord tables */ struct s_kw { const char *name; - int token; + uint32_t token; }; /* @@ -212,12 +212,12 @@ static void init_resource(int type, RES_ITEM *items, int pass) 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) { @@ -600,19 +600,19 @@ void store_defs(LEX *lc, RES_ITEM *item, int index, int pass) /* 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); } @@ -716,9 +716,9 @@ void store_bit(LEX *lc, RES_ITEM *item, int index, int pass) { 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 */ } @@ -754,7 +754,7 @@ void store_label(LEX *lc, RES_ITEM *item, int index, int pass) /* 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; } diff --git a/bacula/src/lib/parse_conf.h b/bacula/src/lib/parse_conf.h index 3e630b55fc..58941df4fd 100644 --- a/bacula/src/lib/parse_conf.h +++ b/bacula/src/lib/parse_conf.h @@ -57,9 +57,9 @@ struct RES_ITEM { 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 */ @@ -76,8 +76,8 @@ public: 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 */ }; @@ -90,7 +90,7 @@ public: 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 */ @@ -153,8 +153,8 @@ void store_strname(LEX *lc, RES_ITEM *item, int index, int pass); 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); diff --git a/bacula/src/qt-console/bat_conf.cpp b/bacula/src/qt-console/bat_conf.cpp index 1a08709592..c28febacdc 100644 --- a/bacula/src/qt-console/bat_conf.cpp +++ b/bacula/src/qt-console/bat_conf.cpp @@ -1,7 +1,7 @@ /* 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. @@ -79,7 +79,7 @@ int res_all_size = sizeof(res_all); 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}, diff --git a/bacula/src/qt-console/bat_conf.h b/bacula/src/qt-console/bat_conf.h index bcb6faa988..493d5ef19f 100644 --- a/bacula/src/qt-console/bat_conf.h +++ b/bacula/src/qt-console/bat_conf.h @@ -1,7 +1,7 @@ /* 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. @@ -64,7 +64,7 @@ enum { 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 */ diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index 497c9fae5f..0cc257f4ee 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -75,8 +75,8 @@ static RES_ITEM store_items[] = { {"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}, @@ -143,19 +143,19 @@ static RES_ITEM dev_items[] = { {"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}, @@ -222,7 +222,7 @@ static void store_devtype(LEX *lc, RES_ITEM *item, int index, int pass) /* 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; } diff --git a/bacula/src/stored/stored_conf.h b/bacula/src/stored/stored_conf.h index 3a3ae8082c..5ffc91fa04 100644 --- a/bacula/src/stored/stored_conf.h +++ b/bacula/src/stored/stored_conf.h @@ -124,11 +124,11 @@ public: 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 */ diff --git a/bacula/src/tray-monitor/tray_conf.c b/bacula/src/tray-monitor/tray_conf.c index b881241add..d6d866ef52 100644 --- a/bacula/src/tray-monitor/tray_conf.c +++ b/bacula/src/tray-monitor/tray_conf.c @@ -94,7 +94,7 @@ static RES_ITEM mon_items[] = { 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} @@ -110,7 +110,7 @@ static RES_ITEM cli_items[] = { {"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} @@ -123,7 +123,7 @@ static RES_ITEM cli_items[] = { 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}, diff --git a/bacula/src/tray-monitor/tray_conf.h b/bacula/src/tray-monitor/tray_conf.h index babcf4b9b1..1e8b5caa36 100644 --- a/bacula/src/tray-monitor/tray_conf.h +++ b/bacula/src/tray-monitor/tray_conf.h @@ -65,7 +65,7 @@ enum { /* 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 */ }; @@ -76,7 +76,7 @@ struct DIRRES { */ 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 */ @@ -92,7 +92,7 @@ struct MONITOR { 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 */ @@ -105,7 +105,7 @@ struct CLIENT { 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 */ diff --git a/bacula/src/wx-console/console_conf.c b/bacula/src/wx-console/console_conf.c index 088e41feeb..8d48da2278 100644 --- a/bacula/src/wx-console/console_conf.c +++ b/bacula/src/wx-console/console_conf.c @@ -114,7 +114,7 @@ static RES_ITEM cons_items[] = { 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}, diff --git a/bacula/src/wx-console/console_conf.h b/bacula/src/wx-console/console_conf.h index 45a0dbf63c..1c8e4b091d 100644 --- a/bacula/src/wx-console/console_conf.h +++ b/bacula/src/wx-console/console_conf.h @@ -1,6 +1,3 @@ -/* - * Version $Id$ - */ /* Bacula® - The Network Backup Solution @@ -28,6 +25,9 @@ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * Version $Id$ + */ #ifndef CONSOLECONF_H #define CONSOLECONF_H @@ -75,7 +75,7 @@ struct CONRES { /* 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 */ diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 34891bd9e2..0699fe85f7 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,9 @@ 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