]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/bsr.h
Fix a few more Coverity reported problems.
[bacula/bacula] / bacula / src / stored / bsr.h
1 /*
2  * BootStrap record definition -- for restoring files.
3  *
4  *    Kern Sibbald, June 2002
5  *
6  *   Version $Id$
7  *
8  */
9 /*
10    Bacula® - The Network Backup Solution
11
12    Copyright (C) 2002-2006 Free Software Foundation Europe e.V.
13
14    The main author of Bacula is Kern Sibbald, with contributions from
15    many others, a complete list can be found in the file AUTHORS.
16    This program is Free Software; you can redistribute it and/or
17    modify it under the terms of version two of the GNU General Public
18    License as published by the Free Software Foundation and included
19    in the file LICENSE.
20
21    This program is distributed in the hope that it will be useful, but
22    WITHOUT ANY WARRANTY; without even the implied warranty of
23    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24    General Public License for more details.
25
26    You should have received a copy of the GNU General Public License
27    along with this program; if not, write to the Free Software
28    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29    02110-1301, USA.
30
31    Bacula® is a registered trademark of John Walker.
32    The licensor of Bacula is the Free Software Foundation Europe
33    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
34    Switzerland, email:ftf@fsfeurope.org.
35 */
36
37
38 #ifndef __BSR_H
39 #define __BSR_H 1
40
41 /*
42  * List of Volume names to be read by Storage daemon.
43  *  Formed by Storage daemon from BSR
44  */
45 struct VOL_LIST {
46    VOL_LIST *next;
47    char VolumeName[MAX_NAME_LENGTH];
48    char MediaType[MAX_NAME_LENGTH];
49    char device[MAX_NAME_LENGTH];   /* ***FIXME*** use alist here */
50    int Slot;
51    uint32_t start_file;
52 };
53
54
55 /*
56  * !!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
57  * !!!                                               !!!
58  * !!!   All records must have a pointer to          !!!
59  * !!!   the next item as the first item defined.    !!!
60  * !!!                                               !!!
61  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
62  */
63
64 struct BSR_VOLUME {
65    BSR_VOLUME *next;
66    char VolumeName[MAX_NAME_LENGTH];
67    char MediaType[MAX_NAME_LENGTH];
68    char device[MAX_NAME_LENGTH];   /* ***FIXME*** use alist here */
69    int32_t       Slot;                /* Slot */
70 };
71
72 struct BSR_CLIENT {
73    BSR_CLIENT *next;
74    char ClientName[MAX_NAME_LENGTH];
75 };
76
77 struct BSR_SESSID {
78    BSR_SESSID *next;
79    uint32_t sessid;
80    uint32_t sessid2;
81 };
82
83 struct BSR_SESSTIME {
84    BSR_SESSTIME *next;
85    uint32_t sesstime;
86    bool done;                         /* local done */
87 };
88
89 struct BSR_VOLFILE {
90    BSR_VOLFILE *next;
91    uint32_t sfile;                    /* start file */
92    uint32_t efile;                    /* end file */
93    bool done;                         /* local done */
94 };
95
96 struct BSR_VOLBLOCK {
97    BSR_VOLBLOCK *next;
98    uint32_t sblock;                   /* start block */
99    uint32_t eblock;                   /* end block */
100    bool done;                         /* local done */
101 };
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    BSR          *next;                /* pointer to next one */
140    BSR          *root;                /* root bsr */
141    bool          reposition;          /* set when any bsr is marked done */
142    bool          mount_next_volume;   /* set when next volume should be mounted */
143    bool          done;                /* set when everything found for this bsr */
144    bool          use_fast_rejection;  /* set if fast rejection can be used */
145    bool          use_positioning;     /* set if we can position the archive */
146    BSR_VOLUME   *volume;
147    uint32_t      count;               /* count of files to restore this bsr */
148    uint32_t      found;               /* count of restored files this bsr */
149    BSR_VOLFILE  *volfile;
150    BSR_VOLBLOCK *volblock;
151    BSR_SESSTIME *sesstime;
152    BSR_SESSID   *sessid;
153    BSR_JOBID    *JobId;
154    BSR_JOB      *job;
155    BSR_CLIENT   *client;
156    BSR_FINDEX   *FileIndex;
157    BSR_JOBTYPE  *JobType;
158    BSR_JOBLEVEL *JobLevel;
159    BSR_STREAM   *stream;
160 };
161
162
163 #endif