]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/dird/dird_conf.h
90700e58b75051313f54ac3994d0fdf292d57bff
[bacula/bacula] / bacula / src / dird / dird_conf.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2015 Kern Sibbald
5    Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
6
7    The original author of Bacula is Kern Sibbald, with contributions
8    from many others, a complete list can be found in the file AUTHORS.
9
10    You may use this file and others of this release according to the
11    license defined in the LICENSE file, which includes the Affero General
12    Public License, v3.0 ("AGPLv3") and some additional permissions and
13    terms pursuant to its AGPLv3 Section 7.
14
15    This notice must be preserved when any source code is 
16    conveyed and/or propagated.
17
18    Bacula(R) is a registered trademark of Kern Sibbald.
19 */
20 /*
21  * Director specific configuration and defines
22  *
23  *     Kern Sibbald, Feb MM
24  *
25  */
26
27 /* NOTE:  #includes at the end of this file */
28
29 /*
30  * Resource codes -- they must be sequential for indexing
31  */
32 enum {
33    R_DIRECTOR = 1001,
34    R_CLIENT,
35    R_JOB,
36    R_STORAGE,
37    R_CATALOG,
38    R_SCHEDULE,
39    R_FILESET,
40    R_POOL,
41    R_MSGS,
42    R_COUNTER,
43    R_CONSOLE,
44    R_JOBDEFS,
45    R_DEVICE,       /* This is the real last device class */
46
47    R_FIRST = R_DIRECTOR,
48    R_LAST  = R_DEVICE                 /* keep this updated */
49 };
50
51
52 /*
53  * Some resource attributes
54  */
55 enum {
56    R_NAME = 1020,
57    R_ADDRESS,
58    R_PASSWORD,
59    R_TYPE,
60    R_BACKUP
61 };
62
63 /* Options for FileSet keywords */
64 struct s_fs_opt {
65    const char *name;
66    int keyword;
67    const char *option;
68 };
69
70 /* Job Level keyword structure */
71 struct s_jl {
72    const char *level_name;                 /* level keyword */
73    int32_t  level;                         /* level */
74    int32_t  job_type;                      /* JobType permitting this level */
75 };
76
77 /* Job Type keyword structure */
78 struct s_jt {
79    const char *type_name;
80    int32_t job_type;
81 };
82
83 /* Definition of the contents of each Resource */
84 /* Needed for forward references */
85 class SCHED;
86 class CLIENT;
87 class FILESET;
88 class POOL;
89 class RUN;
90 class DEVICE;
91 class RUNSCRIPT;
92
93 /*
94  *   Director Resource
95  *
96  */
97 class DIRRES {
98 public:
99    RES   hdr;
100    dlist *DIRaddrs;
101    dlist *DIRsrc_addr;                /* address to source connections from */
102    char *password;                    /* Password for UA access */
103    char *query_file;                  /* SQL query file */
104    char *working_directory;           /* WorkingDirectory */
105    const char *scripts_directory;     /* ScriptsDirectory */
106    const char *plugin_directory;      /* Plugin Directory */
107    char *pid_directory;               /* PidDirectory */
108    char *subsys_directory;            /* SubsysDirectory */
109    MSGS *messages;                    /* Daemon message handler */
110    uint32_t MaxConcurrentJobs;        /* Max concurrent jobs for whole director */
111    uint32_t MaxSpawnedJobs;           /* Max Jobs that can be started by Migration/Copy */
112    uint32_t MaxConsoleConnect;        /* Max concurrent console session */
113    uint32_t MaxReload;                /* Maximum reload requests */
114    utime_t FDConnectTimeout;          /* timeout for connect in seconds */
115    utime_t SDConnectTimeout;          /* timeout in seconds */
116    utime_t heartbeat_interval;        /* Interval to send heartbeats */
117    char *tls_ca_certfile;             /* TLS CA Certificate File */
118    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
119    char *tls_certfile;                /* TLS Server Certificate File */
120    char *tls_keyfile;                 /* TLS Server Key File */
121    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
122    alist *tls_allowed_cns;            /* TLS Allowed Clients */
123    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
124    utime_t stats_retention;           /* Stats retention period in seconds */
125    bool tls_authenticate;             /* Authenticated with TLS */
126    bool tls_enable;                   /* Enable TLS */
127    bool tls_require;                  /* Require TLS */
128    bool tls_verify_peer;              /* TLS Verify Client Certificate */
129    char *verid;                       /* Custom Id to print in version command */
130    /* Methods */
131    char *name() const;
132 };
133
134 inline char *DIRRES::name() const { return hdr.name; }
135
136 /*
137  * Device Resource
138  *  This resource is a bit different from the other resources
139  *  because it is not defined in the Director
140  *  by DEVICE { ... }, but rather by a "reference" such as
141  *  DEVICE = xxx; Then when the Director connects to the
142  *  SD, it requests the information about the device.
143  */
144 class DEVICE {
145 public:
146    RES hdr;
147
148    bool found;                        /* found with SD */
149    int32_t num_writers;               /* number of writers */
150    int32_t max_writers;               /* = 1 for files */
151    int32_t reserved;                  /* number of reserves */
152    int32_t num_drives;                /* for autochanger */
153    bool autochanger;                  /* set if device is autochanger */
154    bool open;                         /* drive open */
155    bool append;                       /* in append mode */
156    bool read;                         /* in read mode */
157    bool labeled;                      /* Volume name valid */
158    bool offline;                      /* not available */
159    bool autoselect;                   /* can be selected via autochanger */
160    uint32_t PoolId;
161    char ChangerName[MAX_NAME_LENGTH];
162    char VolumeName[MAX_NAME_LENGTH];
163    char MediaType[MAX_NAME_LENGTH];
164
165    /* Methods */
166    char *name() const;
167 };
168
169 inline char *DEVICE::name() const { return hdr.name; }
170
171 /*
172  * Console ACL positions
173  */
174 enum {
175    Job_ACL = 0,
176    Client_ACL,
177    Storage_ACL,
178    Schedule_ACL,
179    Run_ACL,
180    Pool_ACL,
181    Command_ACL,
182    FileSet_ACL,
183    Catalog_ACL,
184    Where_ACL,
185    PluginOptions_ACL,
186    Num_ACL                            /* keep last */
187 };
188
189 /*
190  *    Console Resource
191  */
192 class CONRES {
193 public:
194    RES   hdr;
195    char *password;                    /* UA server password */
196    alist *ACL_lists[Num_ACL];         /* pointers to ACLs */
197    char *tls_ca_certfile;             /* TLS CA Certificate File */
198    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
199    char *tls_certfile;                /* TLS Server Certificate File */
200    char *tls_keyfile;                 /* TLS Server Key File */
201    char *tls_dhfile;                  /* TLS Diffie-Hellman Parameters */
202    alist *tls_allowed_cns;            /* TLS Allowed Clients */
203    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
204    bool tls_authenticate;             /* Authenticated with TLS */
205    bool tls_enable;                   /* Enable TLS */
206    bool tls_require;                  /* Require TLS */
207    bool tls_verify_peer;              /* TLS Verify Client Certificate */
208
209    /* Methods */
210    char *name() const;
211 };
212
213 inline char *CONRES::name() const { return hdr.name; }
214
215
216 /*
217  *   Catalog Resource
218  *
219  */
220 class CAT {
221 public:
222    RES   hdr;
223
224    uint32_t db_port;                  /* Port */
225    char *db_address;                  /* host name for remote access */
226    char *db_socket;                   /* Socket for local access */
227    char *db_password;
228    char *db_user;
229    char *db_name;
230    char *db_driver;                   /* Select appropriate driver */
231    uint32_t mult_db_connections;      /* set for multiple db connections */
232    bool disable_batch_insert;         /* set to disable batch inserts */
233
234    /* Methods */
235    char *name() const;
236    char *display(POOLMEM *dst);       /* Get catalog information */
237 };
238
239 inline char *CAT::name() const { return hdr.name; }
240
241
242 /*
243  *   Client Resource
244  *
245  */
246 class CLIENT {
247 public:
248    RES   hdr;
249
250    uint32_t FDport;                   /* Where File daemon listens */
251    utime_t FileRetention;             /* file retention period in seconds */
252    utime_t JobRetention;              /* job retention period in seconds */
253    utime_t SnapRetention;             /* Snapshot retention period in seconds */
254    utime_t heartbeat_interval;        /* Interval to send heartbeats */
255    char *address;
256    char *fd_storage_address;          /* Storage address to use from FD side  */
257    char *password;
258    CAT *catalog;                      /* Catalog resource */
259    int32_t MaxConcurrentJobs;         /* Maximum concurrent jobs */
260    int32_t NumConcurrentJobs;         /* number of concurrent jobs running */
261    char *tls_ca_certfile;             /* TLS CA Certificate File */
262    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
263    char *tls_certfile;                /* TLS Client Certificate File */
264    char *tls_keyfile;                 /* TLS Client Key File */
265    alist *tls_allowed_cns;            /* TLS Allowed Clients */
266    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
267    bool tls_authenticate;             /* Authenticated with TLS */
268    bool tls_enable;                   /* Enable TLS */
269    bool tls_require;                  /* Require TLS */
270    bool enabled;                      /* Set if client enabled */
271    bool AutoPrune;                    /* Do automatic pruning? */
272    bool sd_calls_client;              /* SD calls the client */
273    int64_t max_bandwidth;             /* Limit speed on this client */
274
275    /* Methods */
276    char *name() const;
277 };
278
279 inline char *CLIENT::name() const { return hdr.name; }
280
281
282 /*
283  *   Store Resource
284  *
285  */
286 class STORE {
287 public:
288    RES   hdr;
289
290    uint32_t SDport;                   /* port where Directors connect */
291    uint32_t SDDport;                  /* data port for File daemon */
292    char *address;
293    char *fd_storage_address;          /* Storage address to use from FD side  */
294    char *password;
295    char *media_type;
296    alist *device;                     /* Alternate devices for this Storage */
297    int32_t MaxConcurrentJobs;         /* Maximum concurrent jobs */
298    int32_t MaxConcurrentReadJobs;     /* Maximum concurrent jobs reading */
299    int32_t NumConcurrentJobs;         /* number of concurrent jobs running */
300    int32_t NumConcurrentReadJobs;     /* number of jobs reading */
301    char *tls_ca_certfile;             /* TLS CA Certificate File */
302    char *tls_ca_certdir;              /* TLS CA Certificate Directory */
303    char *tls_certfile;                /* TLS Client Certificate File */
304    char *tls_keyfile;                 /* TLS Client Key File */
305    TLS_CONTEXT *tls_ctx;              /* Shared TLS Context */
306    bool tls_authenticate;             /* Authenticated with TLS */
307    bool tls_enable;                   /* Enable TLS */
308    bool tls_require;                  /* Require TLS */
309    bool enabled;                      /* Set if device is enabled */
310    bool AllowCompress;                /* set if this Storage should allow jobs to enable compression */
311    bool autochanger;                  /* set if we are part of an autochanger */
312    int64_t StorageId;                 /* Set from Storage DB record */
313    utime_t heartbeat_interval;        /* Interval to send heartbeats */
314    uint32_t drives;                   /* number of drives in autochanger */
315
316    /* Methods */
317    char *dev_name() const;
318    char *name() const;
319 };
320
321 inline char *STORE::dev_name() const
322 {
323    DEVICE *dev = (DEVICE *)device->first();
324    return dev->name();
325 }
326
327 inline char *STORE::name() const { return hdr.name; }
328
329 /*
330  * This is a sort of "unified" store that has both the
331  *  storage pointer and the text of where the pointer was
332  *  found.
333  */
334 class USTORE {
335 public:
336    STORE *store;
337    POOLMEM *store_source;
338
339    /* Methods */
340    USTORE() { store = NULL; store_source = get_pool_memory(PM_MESSAGE);
341               *store_source = 0; };
342    ~USTORE() { destroy(); }
343    void set_source(const char *where);
344    void destroy();
345 };
346
347 inline void USTORE::destroy()
348 {
349    if (store_source) {
350       free_pool_memory(store_source);
351       store_source = NULL;
352    }
353 }
354
355
356 inline void USTORE::set_source(const char *where)
357 {
358    if (!store_source) {
359       store_source = get_pool_memory(PM_MESSAGE);
360    }
361    pm_strcpy(store_source, where);
362 }
363
364
365 /*
366  *   Job Resource
367  */
368 class JOB {
369 public:
370    RES   hdr;
371
372    uint32_t JobType;                  /* job type (backup, verify, restore */
373    uint32_t JobLevel;                 /* default backup/verify level */
374    uint32_t RestoreJobId;             /* What -- JobId to restore */
375    uint32_t replace;                  /* How (overwrite, ..) */
376    uint32_t selection_type;
377
378    int32_t  Priority;                 /* Job priority */
379    int32_t  RescheduleTimes;          /* Number of times to reschedule job */
380
381    char *RestoreWhere;                /* Where on disk to restore -- directory */
382    char *RegexWhere;                  /* RegexWhere option */
383    char *strip_prefix;                /* remove prefix from filename  */
384    char *add_prefix;                  /* add prefix to filename  */
385    char *add_suffix;                  /* add suffix to filename -- .old */
386    char *RestoreBootstrap;            /* Bootstrap file */
387    char *PluginOptions;               /* Options to pass to plugin */
388    union {
389       char *WriteBootstrap;           /* Where to write bootstrap Job updates */
390       char *WriteVerifyList;          /* List of changed files */
391    };
392    utime_t MaxRunTime;                /* max run time in seconds */
393    utime_t MaxWaitTime;               /* max blocking time in seconds */
394    utime_t FullMaxRunTime;            /* Max Full job run time */
395    utime_t DiffMaxRunTime;            /* Max Differential job run time */
396    utime_t IncMaxRunTime;             /* Max Incremental job run time */
397    utime_t MaxStartDelay;             /* max start delay in seconds */
398    utime_t MaxRunSchedTime;           /* max run time in seconds from Scheduled time*/
399    utime_t RescheduleInterval;        /* Reschedule interval */
400    utime_t MaxFullInterval;           /* Maximum time interval between Fulls */
401    utime_t MaxDiffInterval;           /* Maximum time interval between Diffs */
402    utime_t DuplicateJobProximity;     /* Permitted time between duplicicates */
403    utime_t SnapRetention;             /* Snapshot retention period in seconds */
404    int64_t spool_size;                /* Size of spool file for this job */
405    int32_t MaxConcurrentJobs;         /* Maximum concurrent jobs */
406    int32_t NumConcurrentJobs;         /* number of concurrent jobs running */
407    uint32_t MaxSpawnedJobs;           /* Max Jobs that can be started by Migration/Copy */
408    bool allow_mixed_priority;         /* Allow jobs with higher priority concurrently with this */
409
410    MSGS      *messages;               /* How and where to send messages */
411    SCHED     *schedule;               /* When -- Automatic schedule */
412    CLIENT    *client;                 /* Who to backup */
413    FILESET   *fileset;                /* What to backup -- Fileset */
414    alist     *storage;                /* Where is device -- list of Storage to be used */
415    POOL      *pool;                   /* Where is media -- Media Pool */
416    POOL      *next_pool;              /* Next Pool for Copy/Migrate/VirtualFull */
417    POOL      *full_pool;              /* Pool for Full backups */
418    POOL      *inc_pool;               /* Pool for Incremental backups */
419    POOL      *diff_pool;              /* Pool for Differental backups */
420    char      *selection_pattern;
421    union {
422       JOB    *verify_job;             /* Job name to verify */
423    };
424    JOB       *jobdefs;                /* Job defaults */
425    alist     *run_cmds;               /* Run commands */
426    alist *RunScripts;                 /* Run {client} program {after|before} Job */
427
428    bool where_use_regexp;             /* true if RestoreWhere is a BREGEXP */
429    bool RescheduleOnError;            /* Set to reschedule on error */
430    bool RescheduleIncompleteJobs;     /* Set to reschedule incomplete Jobs */
431    bool PrefixLinks;                  /* prefix soft links with Where path */
432    bool PruneJobs;                    /* Force pruning of Jobs */
433    bool PruneFiles;                   /* Force pruning of Files */
434    bool PruneVolumes;                 /* Force pruning of Volumes */
435    bool SpoolAttributes;              /* Set to spool attributes in SD */
436    bool spool_data;                   /* Set to spool data in SD */
437    bool rerun_failed_levels;          /* Upgrade to rerun failed levels */
438    bool PreferMountedVolumes;         /* Prefer vols mounted rather than new one */
439    bool write_part_after_job;         /* Set to write part after job in SD */
440    bool enabled;                      /* Set if job enabled */
441    bool accurate;                     /* Set if it is an accurate backup job */
442    bool AllowDuplicateJobs;           /* Allow duplicate jobs */
443    bool AllowHigherDuplicates;        /* Permit Higher Level */
444    bool CancelLowerLevelDuplicates;   /* Cancel lower level backup jobs */
445    bool CancelQueuedDuplicates;       /* Cancel queued jobs */
446    bool CancelRunningDuplicates;      /* Cancel Running jobs */
447    bool PurgeMigrateJob;              /* Purges source job on completion */
448    bool IgnoreDuplicateJobChecking;   /* Set to ignore Duplicate Job Checking */
449
450    alist *base;                       /* Base jobs */
451    int64_t max_bandwidth;             /* Speed limit on this job */
452
453    /* Methods */
454    char *name() const;
455 };
456
457 inline char *JOB::name() const { return hdr.name; }
458
459 /* Define FileSet Options keyword values */
460 enum {
461    INC_KW_NONE,
462    INC_KW_COMPRESSION,
463    INC_KW_DIGEST,
464    INC_KW_ENCRYPTION,
465    INC_KW_VERIFY,
466    INC_KW_BASEJOB,
467    INC_KW_ACCURATE,
468    INC_KW_ONEFS,
469    INC_KW_RECURSE,
470    INC_KW_SPARSE,
471    INC_KW_HARDLINK,
472    INC_KW_REPLACE,               /* restore options */
473    INC_KW_READFIFO,              /* Causes fifo data to be read */
474    INC_KW_PORTABLE,
475    INC_KW_MTIMEONLY,
476    INC_KW_KEEPATIME,
477    INC_KW_EXCLUDE,
478    INC_KW_ACL,
479    INC_KW_IGNORECASE,
480    INC_KW_HFSPLUS,
481    INC_KW_NOATIME,
482    INC_KW_ENHANCEDWILD,
483    INC_KW_CHKCHANGES,
484    INC_KW_STRIPPATH,
485    INC_KW_HONOR_NODUMP,
486    INC_KW_XATTR,
487    INC_KW_MAX                   /* Keep this last */
488 };
489
490
491 #undef  MAX_FOPTS
492 #define MAX_FOPTS 50
493
494 /* File options structure */
495 struct FOPTS {
496    char opts[MAX_FOPTS];              /* options string */
497    alist regex;                       /* regex string(s) */
498    alist regexdir;                    /* regex string(s) for directories */
499    alist regexfile;                   /* regex string(s) for files */
500    alist wild;                        /* wild card strings */
501    alist wilddir;                     /* wild card strings for directories */
502    alist wildfile;                    /* wild card strings for files */
503    alist wildbase;                    /* wild card strings for files without '/' */
504    alist base;                        /* list of base names */
505    alist fstype;                      /* file system type limitation */
506    alist drivetype;                   /* drive type limitation */
507    char *reader;                      /* reader program */
508    char *writer;                      /* writer program */
509    char *plugin;                      /* plugin program */
510 };
511
512
513 /* This is either an include item or an exclude item */
514 struct INCEXE {
515    char  opt_present[INC_KW_MAX+1]; /* set if option is present in conf file */
516    FOPTS *current_opts;               /* points to current options structure */
517    FOPTS **opts_list;                 /* options list */
518    int32_t num_opts;                  /* number of options items */
519    alist name_list;                   /* filename list -- holds char * */
520    alist plugin_list;                 /* filename list for plugins */
521    char *ignoredir;                   /* ignoredir string */
522 };
523
524 /*
525  *   FileSet Resource
526  *
527  */
528 class FILESET {
529 public:
530    RES   hdr;
531
532    bool new_include;                  /* Set if new include used */
533    INCEXE **include_items;            /* array of incexe structures */
534    int32_t num_includes;              /* number in array */
535    INCEXE **exclude_items;
536    int32_t num_excludes;
537    bool have_MD5;                     /* set if MD5 initialized */
538    struct MD5Context md5c;            /* MD5 of include/exclude */
539    char MD5[30];                      /* base 64 representation of MD5 */
540    bool ignore_fs_changes;            /* Don't force Full if FS changed */
541    bool enable_vss;                   /* Enable Volume Shadow Copy */
542    bool enable_snapshot;              /* Enable Snapshot */
543
544    /* Methods */
545    char *name() const;
546 };
547
548 inline char *FILESET::name() const { return hdr.name; }
549
550 /*
551  *   Schedule Resource
552  *
553  */
554 class SCHED {
555 public:
556    RES   hdr;
557
558    RUN *run;
559    bool enabled;                      /* set if enabled */
560    /* Methods */
561    char *name() const;
562 };
563
564 inline char *SCHED::name() const { return hdr.name; }
565
566 /*
567  *   Counter Resource
568  */
569 class COUNTER {
570 public:
571    RES   hdr;
572
573    int32_t  MinValue;                 /* Minimum value */
574    int32_t  MaxValue;                 /* Maximum value */
575    int32_t  CurrentValue;             /* Current value */
576    COUNTER *WrapCounter;              /* Wrap counter name */
577    CAT     *Catalog;                  /* Where to store */
578    bool     created;                  /* Created in DB */
579    /* Methods */
580    char *name() const;
581 };
582
583 inline char *COUNTER::name() const { return hdr.name; }
584
585 /*
586  *   Pool Resource
587  *
588  */
589 class POOL {
590 public:
591    RES   hdr;
592
593    char *pool_type;                   /* Pool type */
594    char *label_format;                /* Label format string */
595    char *cleaning_prefix;             /* Cleaning label prefix */
596    int32_t LabelType;                 /* Bacula/ANSI/IBM label type */
597    uint32_t max_volumes;              /* max number of volumes */
598    utime_t VolRetention;              /* volume retention period in seconds */
599    utime_t VolUseDuration;            /* duration volume can be used */
600    uint32_t MaxVolJobs;               /* Maximum jobs on the Volume */
601    uint32_t MaxVolFiles;              /* Maximum files on the Volume */
602    uint64_t MaxVolBytes;              /* Maximum bytes on the Volume */
603    utime_t MigrationTime;             /* Time to migrate to next pool */
604    uint64_t MigrationHighBytes;       /* When migration starts */
605    uint64_t MigrationLowBytes;        /* When migration stops */
606    POOL  *NextPool;                   /* Next pool for migration */
607    alist *storage;                    /* Where is device -- list of Storage to be used */
608    bool  use_catalog;                 /* maintain catalog for media */
609    bool  catalog_files;               /* maintain file entries in catalog */
610    bool  use_volume_once;             /* write on volume only once */
611    bool  purge_oldest_volume;         /* purge oldest volume */
612    bool  recycle_oldest_volume;       /* attempt to recycle oldest volume */
613    bool  recycle_current_volume;      /* attempt recycle of current volume */
614    bool  AutoPrune;                   /* default for pool auto prune */
615    bool  Recycle;                     /* default for media recycle yes/no */
616    uint32_t action_on_purge;          /* action on purge, e.g. truncate the disk volume */
617    POOL  *RecyclePool;                /* RecyclePool destination when media is purged */
618    POOL  *ScratchPool;                /* ScratchPool source when requesting media */
619    alist *CopyPool;                   /* List of copy pools */
620    CAT *catalog;                      /* Catalog to be used */
621    utime_t FileRetention;             /* file retention period in seconds */
622    utime_t JobRetention;              /* job retention period in seconds */
623
624    /* Methods */
625    char *name() const;
626 };
627
628 inline char *POOL::name() const { return hdr.name; }
629
630
631 /* Define the Union of all the above
632  * resource structure definitions.
633  */
634 union URES {
635    DIRRES     res_dir;
636    CONRES     res_con;
637    CLIENT     res_client;
638    STORE      res_store;
639    CAT        res_cat;
640    JOB        res_job;
641    FILESET    res_fs;
642    SCHED      res_sch;
643    POOL       res_pool;
644    MSGS       res_msgs;
645    COUNTER    res_counter;
646    DEVICE     res_dev;
647    RES        hdr;
648    RUNSCRIPT  res_runscript;
649 };
650
651
652
653 /* Run structure contained in Schedule Resource */
654 class RUN {
655 public:
656    RUN *next;                         /* points to next run record */
657    uint32_t level;                    /* level override */
658    int32_t Priority;                  /* priority override */
659    uint32_t job_type;
660    utime_t MaxRunSchedTime;           /* max run time in sec from Sched time */
661    bool MaxRunSchedTime_set;          /* MaxRunSchedTime given */
662    bool spool_data;                   /* Data spooling override */
663    bool spool_data_set;               /* Data spooling override given */
664    bool accurate;                     /* accurate */
665    bool accurate_set;                 /* accurate given */
666    bool write_part_after_job;         /* Write part after job override */
667    bool write_part_after_job_set;     /* Write part after job override given */
668    bool priority_set;                 /* priority override given */
669    bool level_set;                    /* level override given */
670
671    POOL *pool;                        /* Pool override */
672    POOL *next_pool;                   /* Next pool override */
673    POOL *full_pool;                   /* Pool override */
674    POOL *inc_pool;                    /* Pool override */
675    POOL *diff_pool;                   /* Pool override */
676    STORE *storage;                    /* Storage override */
677    MSGS *msgs;                        /* Messages override */
678    char *since;
679    uint32_t level_no;
680    uint32_t minute;                   /* minute to run job */
681    time_t last_run;                   /* last time run */
682    time_t next_run;                   /* next time to run */
683    bool last_day_set;                 /* set if last_day is used */
684    char hour[nbytes_for_bits(24)];    /* bit set for each hour */
685    char mday[nbytes_for_bits(32)];    /* bit set for each day of month */
686    char month[nbytes_for_bits(12)];   /* bit set for each month */
687    char wday[nbytes_for_bits(7)];     /* bit set for each day of the week */
688    char wom[nbytes_for_bits(6)];      /* week of month */
689    char woy[nbytes_for_bits(54)];     /* week of year */
690 };
691
692 #define GetPoolResWithName(x) ((POOL *)GetResWithName(R_POOL, (x)))
693 #define GetStoreResWithName(x) ((STORE *)GetResWithName(R_STORAGE, (x)))
694 #define GetClientResWithName(x) ((CLIENT *)GetResWithName(R_CLIENT, (x)))
695 #define GetJobResWithName(x) ((JOB *)GetResWithName(R_JOB, (x)))
696 #define GetFileSetResWithName(x) ((FILESET *)GetResWithName(R_FILESET, (x)))
697 #define GetCatalogResWithName(x) ((CAT *)GetResWithName(R_CATALOG, (x)))
698
699 /* Imported subroutines */
700 void store_jobtype(LEX *lc, RES_ITEM *item, int index, int pass);
701 void store_level(LEX *lc, RES_ITEM *item, int index, int pass);
702 void store_replace(LEX *lc, RES_ITEM *item, int index, int pass);
703 void store_migtype(LEX *lc, RES_ITEM *item, int index, int pass);
704 void store_acl(LEX *lc, RES_ITEM *item, int index, int pass);
705 void store_ac_res(LEX *lc, RES_ITEM *item, int index, int pass);
706 void store_actiononpurge(LEX *lc, RES_ITEM *item, int index, int pass);
707 void store_inc(LEX *lc, RES_ITEM *item, int index, int pass);
708 void store_regex(LEX *lc, RES_ITEM *item, int index, int pass);
709 void store_wild(LEX *lc, RES_ITEM *item, int index, int pass);
710 void store_fstype(LEX *lc, RES_ITEM *item, int index, int pass);
711 void store_drivetype(LEX *lc, RES_ITEM *item, int index, int pass);
712 void store_opts(LEX *lc, RES_ITEM *item, int index, int pass);
713 void store_lopts(LEX *lc, RES_ITEM *item, int index, int pass);
714 void store_base(LEX *lc, RES_ITEM *item, int index, int pass);
715 void store_plugin(LEX *lc, RES_ITEM *item, int index, int pass);
716 void store_run(LEX *lc, RES_ITEM *item, int index, int pass);
717 void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass);