]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/stored/bsr.h
24Mar06
[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) 2002-2006 Kern Sibbald
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
14    version 2 as amended with additional clauses defined in the
15    file LICENSE in the main source directory.
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 
20    the file LICENSE for additional details.
21
22  */
23
24
25 #ifndef __BSR_H
26 #define __BSR_H 1
27
28 /*
29  * List of Volume names to be read by Storage daemon.
30  *  Formed by Storage daemon from BSR
31  */
32 struct VOL_LIST {
33    VOL_LIST *next;
34    char VolumeName[MAX_NAME_LENGTH];
35    char MediaType[MAX_NAME_LENGTH];
36    char device[MAX_NAME_LENGTH];   /* ***FIXME*** use alist here */
37    int Slot;
38    uint32_t start_file;
39 };
40
41
42 /*
43  * !!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
44  * !!!                                               !!!
45  * !!!   All records must have a pointer to          !!!
46  * !!!   the next item as the first item defined.    !!!
47  * !!!                                               !!!
48  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
49  */
50
51 struct BSR_VOLUME {
52    BSR_VOLUME *next;
53    char VolumeName[MAX_NAME_LENGTH];
54    char MediaType[MAX_NAME_LENGTH];
55    char device[MAX_NAME_LENGTH];   /* ***FIXME*** use alist here */
56    int32_t       Slot;                /* Slot */
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    uint32_t      count;               /* count of files to restore this bsr */
135    uint32_t      found;               /* count of restored files this bsr */
136    BSR_VOLFILE  *volfile;
137    BSR_VOLBLOCK *volblock;
138    BSR_SESSTIME *sesstime;
139    BSR_SESSID   *sessid;
140    BSR_JOBID    *JobId;
141    BSR_JOB      *job;
142    BSR_CLIENT   *client;
143    BSR_FINDEX   *FileIndex;
144    BSR_JOBTYPE  *JobType;
145    BSR_JOBLEVEL *JobLevel;
146    BSR_STREAM   *stream;
147 };
148
149
150 #endif