]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/bsr.h
Change copyright as per agreement with FSFE
[bacula/bacula] / bacula / src / stored / bsr.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2016 Kern Sibbald
5
6    The original author of Bacula is Kern Sibbald, with contributions
7    from many others, a complete list can be found in the file AUTHORS.
8
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13
14    This notice must be preserved when any source code is 
15    conveyed and/or propagated.
16
17    Bacula(R) is a registered trademark of Kern Sibbald.
18 */
19 /*
20  * BootStrap record definition -- for restoring files.
21  *
22  *    Kern Sibbald, June 2002
23  *
24  */
25
26
27 #ifndef __BSR_H
28 #define __BSR_H 1
29
30 #ifndef HAVE_REGEX_H
31 #include "lib/bregex.h"
32 #else
33 #include <regex.h>
34 #endif
35
36 /*
37  * List of Volume names to be read by Storage daemon.
38  *  Formed by Storage daemon from BSR
39  */
40 struct VOL_LIST {
41    VOL_LIST *next;
42    char VolumeName[MAX_NAME_LENGTH];
43    char MediaType[MAX_NAME_LENGTH];
44    char device[MAX_NAME_LENGTH];   /* ***FIXME*** use alist here */
45    int Slot;
46    uint32_t start_file;
47 };
48
49
50 /*
51  * !!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
52  * !!!                                               !!!
53  * !!!   All records must have a pointer to          !!!
54  * !!!   the next item as the first item defined.    !!!
55  * !!!                                               !!!
56  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
57  */
58
59 struct BSR_VOLUME {
60    BSR_VOLUME *next;
61    char VolumeName[MAX_NAME_LENGTH];
62    char MediaType[MAX_NAME_LENGTH];
63    char device[MAX_NAME_LENGTH];   /* ***FIXME*** use alist here */
64    int32_t       Slot;                /* Slot */
65 };
66
67 struct BSR_CLIENT {
68    BSR_CLIENT *next;
69    char ClientName[MAX_NAME_LENGTH];
70 };
71
72 struct BSR_SESSID {
73    BSR_SESSID *next;
74    uint32_t sessid;
75    uint32_t sessid2;
76 };
77
78 struct BSR_SESSTIME {
79    BSR_SESSTIME *next;
80    uint32_t sesstime;
81    bool done;                         /* local done */
82 };
83
84 struct BSR_VOLFILE {
85    BSR_VOLFILE *next;
86    uint32_t sfile;                    /* start file */
87    uint32_t efile;                    /* end file */
88    bool done;                         /* local done */
89 };
90
91 struct BSR_VOLBLOCK {
92    BSR_VOLBLOCK *next;
93    uint32_t sblock;                   /* start block */
94    uint32_t eblock;                   /* end block */
95    bool done;                         /* local done */
96 };
97
98 struct BSR_VOLADDR {
99    BSR_VOLADDR *next;
100    uint64_t saddr;                   /* start address */
101    uint64_t eaddr;                   /* end address */
102    bool done;                        /* local done */
103 };
104
105 struct BSR_FINDEX {
106    BSR_FINDEX *next;
107    int32_t findex;                    /* start file index */
108    int32_t findex2;                   /* end file index */
109    bool done;                         /* local done */
110 };
111
112 struct BSR_JOBID {
113    BSR_JOBID *next;
114    uint32_t JobId;
115    uint32_t JobId2;
116 };
117
118 struct BSR_JOBTYPE {
119    BSR_JOBTYPE *next;
120    uint32_t JobType;
121 };
122
123 struct BSR_JOBLEVEL {
124    BSR_JOBLEVEL *next;
125    uint32_t JobLevel;
126 };
127
128 struct BSR_JOB {
129    BSR_JOB *next;
130    char Job[MAX_NAME_LENGTH];
131    bool done;                         /* local done */
132 };
133
134 struct BSR_STREAM {
135    BSR_STREAM *next;
136    int32_t stream;                    /* stream desired */
137 };
138
139 struct BSR {
140    /* NOTE!!! next must be the first item */
141    BSR          *next;                /* pointer to next one */
142    BSR          *prev;                /* pointer to previous one */
143    BSR          *root;                /* root bsr */
144    BSR          *cur_bsr;
145    bool          reposition;          /* set when any bsr is marked done */
146    bool          mount_next_volume;   /* set when next volume should be mounted */
147    bool          done;                /* set when everything found for this bsr */
148    bool          use_fast_rejection;  /* set if fast rejection can be used */
149    bool          use_positioning;     /* set if we can position the archive */
150    bool          skip_file;           /* skip all records for current file */
151    BSR_VOLUME   *volume;
152    uint32_t      count;               /* count of files to restore this bsr */
153    uint32_t      found;               /* count of restored files this bsr */
154    int32_t       LastFI;              /* LastFI seen by this bsr */
155    BSR_VOLFILE  *volfile;
156    BSR_VOLBLOCK *volblock;
157    BSR_VOLADDR  *voladdr;
158    BSR_SESSTIME *sesstime;
159    BSR_SESSID   *sessid;
160    BSR_JOBID    *JobId;
161    BSR_JOB      *job;
162    BSR_CLIENT   *client;
163    BSR_FINDEX   *FileIndex;
164    BSR_JOBTYPE  *JobType;
165    BSR_JOBLEVEL *JobLevel;
166    BSR_STREAM   *stream;
167    char         *fileregex;           /* set if restore is filtered on filename */
168    regex_t      *fileregex_re;
169    ATTR         *attr;                /* scratch space for unpacking */
170 };
171
172
173 #endif