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