]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/dird/ua.h
Fix out of order volumes during restore.
[bacula/bacula] / bacula / src / dird / ua.h
1 /*
2  * Includes specific to the Director User Agent Server
3  *
4  *     Kern Sibbald, August MMI
5  *
6  *     Version $Id$
7  */
8 /*
9    Copyright (C) 2000-2005 Kern Sibbald
10
11    This program is free software; you can redistribute it and/or
12    modify it under the terms of the GNU General Public License as
13    published by the Free Software Foundation; either version 2 of
14    the License, or (at your option) any later version.
15
16    This program is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19    General Public License for more details.
20
21    You should have received a copy of the GNU General Public
22    License along with this program; if not, write to the Free
23    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24    MA 02111-1307, USA.
25
26  */
27
28 #ifndef __UA_H_
29 #define __UA_H_ 1
30
31 struct UAContext {
32    BSOCK *UA_sock;
33    BSOCK *sd;
34    JCR *jcr;
35    B_DB *db;
36    CAT *catalog;
37    CONRES *cons;                      /* console resource */
38    POOLMEM *cmd;                      /* return command/name buffer */
39    POOLMEM *args;                     /* command line arguments */
40    char *argk[MAX_CMD_ARGS];          /* argument keywords */
41    char *argv[MAX_CMD_ARGS];          /* argument values */
42    int argc;                          /* number of arguments */
43    char **prompt;                     /* list of prompts */
44    int max_prompts;                   /* max size of list */
45    int num_prompts;                   /* current number in list */
46    bool auto_display_messages;        /* if set, display messages */
47    bool user_notified_msg_pending;    /* set when user notified */
48    bool automount;                    /* if set, mount after label */
49    bool quit;                         /* if set, quit */
50    bool verbose;                      /* set for normal UA verbosity */
51    bool batch;                        /* set for non-interactive mode */
52    uint32_t pint32_val;               /* positive integer */
53    int32_t  int32_val;                /* positive/negative */
54    int64_t  int64_val;                /* big int */
55 };
56
57 /* Context for insert_tree_handler() */
58 struct TREE_CTX {
59    TREE_ROOT *root;                   /* root */
60    TREE_NODE *node;                   /* current node */
61    TREE_NODE *avail_node;             /* unused node last insert */
62    int cnt;                           /* count for user feedback */
63    bool all;                          /* if set mark all as default */
64    UAContext *ua;
65    uint32_t FileEstimate;             /* estimate of number of files */
66    uint32_t FileCount;                /* current count of files */
67    uint32_t LastCount;                /* last count of files */
68    uint32_t DeltaCount;               /* trigger for printing */
69 };
70
71 struct NAME_LIST {
72    char **name;                       /* list of names */
73    int num_ids;                       /* ids stored */
74    int max_ids;                       /* size of array */
75    int num_del;                       /* number deleted */
76    int tot_ids;                       /* total to process */
77 };
78
79
80 /* Main structure for obtaining JobIds or Files to be restored */
81 struct RESTORE_CTX {
82    utime_t JobTDate;
83    uint32_t TotalFiles;
84    JobId_t JobId;
85    char ClientName[MAX_NAME_LENGTH];
86    char last_jobid[20];
87    POOLMEM *JobIds;                   /* User entered string of JobIds */
88    STORE  *store;
89    JOB *restore_job;
90    POOL *pool;
91    int restore_jobs;
92    uint32_t selected_files;
93    char *where;
94    RBSR *bsr;
95    POOLMEM *fname;                    /* filename only */
96    POOLMEM *path;                     /* path only */
97    POOLMEM *query;
98    int fnl;                           /* filename length */
99    int pnl;                           /* path length */
100    bool found;
101    bool all;                          /* mark all as default */
102    NAME_LIST name_list;
103 };
104
105 #define MAX_ID_LIST_LEN 1000000
106
107
108 #endif