]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/bsr.h
Make bad Storage check in is_on_same_storage non-fatal
[bacula/bacula] / bacula / src / stored / bsr.h
1 /*
2    Bacula® - The Network Backup Solution
3
4    Copyright (C) 2002-2008 Free Software Foundation Europe e.V.
5
6    The main author of Bacula is Kern Sibbald, with contributions from
7    many others, a complete list can be found in the file AUTHORS.
8    This program is Free Software; you can redistribute it and/or
9    modify it under the terms of version three of the GNU Affero General Public
10    License as published by the Free Software Foundation and included
11    in the file LICENSE.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU Affero General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23    Bacula® is a registered trademark of Kern Sibbald.
24    The licensor of Bacula is the Free Software Foundation Europe
25    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
26    Switzerland, email:ftf@fsfeurope.org.
27 */
28 /*
29  * BootStrap record definition -- for restoring files.
30  *
31  *    Kern Sibbald, June 2002
32  *
33  *   Version $Id$
34  *
35  */
36
37
38 #ifndef __BSR_H
39 #define __BSR_H 1
40
41 #ifndef HAVE_REGEX_H
42 #include "lib/bregex.h"
43 #else
44 #include <regex.h>
45 #endif
46
47 /*
48  * List of Volume names to be read by Storage daemon.
49  *  Formed by Storage daemon from BSR
50  */
51 struct VOL_LIST {
52    VOL_LIST *next;
53    char VolumeName[MAX_NAME_LENGTH];
54    char MediaType[MAX_NAME_LENGTH];
55    char device[MAX_NAME_LENGTH];   /* ***FIXME*** use alist here */
56    int Slot;
57    uint32_t start_file;
58 };
59
60
61 /*
62  * !!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
63  * !!!                                               !!!
64  * !!!   All records must have a pointer to          !!!
65  * !!!   the next item as the first item defined.    !!!
66  * !!!                                               !!!
67  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
68  */
69
70 struct BSR_VOLUME {
71    BSR_VOLUME *next;
72    char VolumeName[MAX_NAME_LENGTH];
73    char MediaType[MAX_NAME_LENGTH];
74    char device[MAX_NAME_LENGTH];   /* ***FIXME*** use alist here */
75    int32_t       Slot;                /* Slot */
76 };
77
78 struct BSR_CLIENT {
79    BSR_CLIENT *next;
80    char ClientName[MAX_NAME_LENGTH];
81 };
82
83 struct BSR_SESSID {
84    BSR_SESSID *next;
85    uint32_t sessid;
86    uint32_t sessid2;
87 };
88
89 struct BSR_SESSTIME {
90    BSR_SESSTIME *next;
91    uint32_t sesstime;
92    bool done;                         /* local done */
93 };
94
95 struct BSR_VOLFILE {
96    BSR_VOLFILE *next;
97    uint32_t sfile;                    /* start file */
98    uint32_t efile;                    /* end file */
99    bool done;                         /* local done */
100 };
101
102 struct BSR_VOLBLOCK {
103    BSR_VOLBLOCK *next;
104    uint32_t sblock;                   /* start block */
105    uint32_t eblock;                   /* end block */
106    bool done;                         /* local done */
107 };
108
109 struct BSR_VOLADDR {
110    BSR_VOLADDR *next;
111    uint64_t saddr;                   /* start address */
112    uint64_t eaddr;                   /* end address */
113    bool done;                        /* local done */
114 };
115
116 struct BSR_FINDEX {
117    BSR_FINDEX *next;
118    int32_t findex;                    /* start file index */
119    int32_t findex2;                   /* end file index */
120    bool done;                         /* local done */
121 };
122
123 struct BSR_JOBID {
124    BSR_JOBID *next;
125    uint32_t JobId;
126    uint32_t JobId2;
127 };
128
129 struct BSR_JOBTYPE {
130    BSR_JOBTYPE *next;
131    uint32_t JobType;
132 };
133
134 struct BSR_JOBLEVEL {
135    BSR_JOBLEVEL *next;
136    uint32_t JobLevel;
137 };
138
139 struct BSR_JOB {
140    BSR_JOB *next;
141    char Job[MAX_NAME_LENGTH];
142    bool done;                         /* local done */
143 };
144
145 struct BSR_STREAM {
146    BSR_STREAM *next;
147    int32_t stream;                    /* stream desired */
148 };
149
150 struct BSR {
151    /* NOTE!!! next must be the first item */
152    BSR          *next;                /* pointer to next one */
153    BSR          *prev;                /* pointer to previous one */
154    BSR          *root;                /* root bsr */
155    bool          reposition;          /* set when any bsr is marked done */
156    bool          mount_next_volume;   /* set when next volume should be mounted */
157    bool          done;                /* set when everything found for this bsr */
158    bool          use_fast_rejection;  /* set if fast rejection can be used */
159    bool          use_positioning;     /* set if we can position the archive */
160    bool          skip_file;           /* skip all records for current file */
161    BSR_VOLUME   *volume;
162    uint32_t      count;               /* count of files to restore this bsr */
163    uint32_t      found;               /* count of restored files this bsr */
164    BSR_VOLFILE  *volfile;
165    BSR_VOLBLOCK *volblock;
166    BSR_VOLADDR  *voladdr;
167    BSR_SESSTIME *sesstime;
168    BSR_SESSID   *sessid;
169    BSR_JOBID    *JobId;
170    BSR_JOB      *job;
171    BSR_CLIENT   *client;
172    BSR_FINDEX   *FileIndex;
173    BSR_JOBTYPE  *JobType;
174    BSR_JOBLEVEL *JobLevel;
175    BSR_STREAM   *stream;
176    char         *fileregex;           /* set if restore is filtered on filename */
177    regex_t      *fileregex_re;
178    ATTR         *attr;                /* scratch space for unpacking */
179 };
180
181
182 #endif