]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/bsr.h
First cut SIGHUM + misc
[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    Copyright (C) 2000-2003 Kern Sibbald and John Walker
11
12    This program is free software; you can redistribute it and/or
13    modify it under the terms of the GNU General Public License as
14    published by the Free Software Foundation; either version 2 of
15    the License, or (at your option) any later version.
16
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20    General Public License for more details.
21
22    You should have received a copy of the GNU General Public
23    License along with this program; if not, write to the Free
24    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25    MA 02111-1307, USA.
26
27  */
28
29
30 #ifndef __BSR_H
31 #define __BSR_H 1
32
33 /*
34  * List of Volume names to be read by Storage daemon.
35  *  Formed by Storage daemon from BSR  
36  */
37 struct VOL_LIST {
38    VOL_LIST *next;
39    char VolumeName[MAX_NAME_LENGTH];
40    int Slot; 
41    uint32_t start_file;
42 };
43
44
45 /*
46  * !!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
47  * !!!                                               !!!
48  * !!!   All records must have a pointer to          !!!
49  * !!!   the next item as the first item defined.    !!!
50  * !!!                                               !!!
51  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
52  */
53
54 struct BSR_VOLUME {
55    BSR_VOLUME *next;
56    char VolumeName[MAX_NAME_LENGTH];
57 };           
58
59 struct BSR_CLIENT {
60    BSR_CLIENT *next;
61    char ClientName[MAX_NAME_LENGTH];
62 };           
63
64 struct BSR_SESSID {
65    BSR_SESSID *next;
66    uint32_t sessid;
67    uint32_t sessid2;
68 };
69
70 struct BSR_SESSTIME {
71    BSR_SESSTIME *next;
72    uint32_t sesstime;
73    bool done;                         /* local done */
74 };             
75
76 struct BSR_VOLFILE {
77    BSR_VOLFILE *next;
78    uint32_t sfile;                    /* start file */
79    uint32_t efile;                    /* end file */
80    bool done;                         /* local done */
81 };
82
83 struct BSR_VOLBLOCK {
84    BSR_VOLBLOCK *next;
85    uint32_t sblock;                   /* start block */
86    uint32_t eblock;                   /* end block */
87    bool done;                         /* local done */
88 };             
89
90
91 struct BSR_FINDEX {
92    BSR_FINDEX *next;
93    int32_t findex;                    /* start file index */
94    int32_t findex2;                   /* end file index */
95    bool done;                         /* local done */
96 };           
97
98 struct BSR_JOBID {
99    BSR_JOBID *next;
100    uint32_t JobId;
101    uint32_t JobId2;
102 };          
103
104 struct BSR_JOBTYPE {
105    BSR_JOBTYPE *next;
106    uint32_t JobType;
107 };            
108
109 struct BSR_JOBLEVEL {
110    BSR_JOBLEVEL *next;
111    uint32_t JobLevel;
112 };             
113
114 struct BSR_JOB {
115    BSR_JOB *next;
116    char Job[MAX_NAME_LENGTH];
117    bool done;                         /* local done */
118 };
119
120 struct BSR_STREAM {
121    BSR_STREAM *next;
122    int32_t stream;                    /* stream desired */
123 };           
124
125 struct BSR {
126    BSR          *next;                /* pointer to next one */
127    BSR          *root;                /* root bsr */
128    bool          reposition;          /* set when any bsr is marked done */
129    bool          mount_next_volume;   /* set when next volume should be mounted */
130    bool          done;                /* set when everything found for this bsr */
131    bool          use_fast_rejection;  /* set if fast rejection can be used */
132    bool          use_positioning;     /* set if we can position the archive */
133    BSR_VOLUME   *volume;
134    int32_t       Slot;                /* Slot */
135    uint32_t      count;               /* count of files to restore this bsr */
136    uint32_t      found;               /* count of restored files this bsr */
137    BSR_VOLFILE  *volfile;
138    BSR_VOLBLOCK *volblock;
139    BSR_SESSTIME *sesstime;
140    BSR_SESSID   *sessid;
141    BSR_JOBID    *JobId;
142    BSR_JOB      *job;
143    BSR_CLIENT   *client;
144    BSR_FINDEX   *FileIndex;
145    BSR_JOBTYPE  *JobType;
146    BSR_JOBLEVEL *JobLevel;
147    BSR_STREAM   *stream;
148 };
149
150
151 #endif