]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/dird/ua.h
17Mar06
[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
13    version 2 as amended with additional clauses defined in the
14    file LICENSE in the main source directory.
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 
19    the file LICENSE for additional details.
20
21  */
22
23 #ifndef __UA_H_
24 #define __UA_H_ 1
25
26 struct UAContext {
27    BSOCK *UA_sock;
28    BSOCK *sd;
29    JCR *jcr;
30    B_DB *db;
31    CAT *catalog;
32    CONRES *cons;                      /* console resource */
33    POOLMEM *cmd;                      /* return command/name buffer */
34    POOLMEM *args;                     /* command line arguments */
35    char *argk[MAX_CMD_ARGS];          /* argument keywords */
36    char *argv[MAX_CMD_ARGS];          /* argument values */
37    int argc;                          /* number of arguments */
38    char **prompt;                     /* list of prompts */
39    int max_prompts;                   /* max size of list */
40    int num_prompts;                   /* current number in list */
41    bool auto_display_messages;        /* if set, display messages */
42    bool user_notified_msg_pending;    /* set when user notified */
43    bool automount;                    /* if set, mount after label */
44    bool quit;                         /* if set, quit */
45    bool verbose;                      /* set for normal UA verbosity */
46    bool batch;                        /* set for non-interactive mode */
47    bool gui;                          /* set if talking to GUI program */
48    uint32_t pint32_val;               /* positive integer */
49    int32_t  int32_val;                /* positive/negative */
50    int64_t  int64_val;                /* big int */
51 };
52
53 /* Context for insert_tree_handler() */
54 struct TREE_CTX {
55    TREE_ROOT *root;                   /* root */
56    TREE_NODE *node;                   /* current node */
57    TREE_NODE *avail_node;             /* unused node last insert */
58    int cnt;                           /* count for user feedback */
59    bool all;                          /* if set mark all as default */
60    UAContext *ua;
61    uint32_t FileEstimate;             /* estimate of number of files */
62    uint32_t FileCount;                /* current count of files */
63    uint32_t LastCount;                /* last count of files */
64    uint32_t DeltaCount;               /* trigger for printing */
65 };
66
67 struct NAME_LIST {
68    char **name;                       /* list of names */
69    int num_ids;                       /* ids stored */
70    int max_ids;                       /* size of array */
71    int num_del;                       /* number deleted */
72    int tot_ids;                       /* total to process */
73 };
74
75
76 /* Main structure for obtaining JobIds or Files to be restored */
77 struct RESTORE_CTX {
78    utime_t JobTDate;
79    uint32_t TotalFiles;
80    JobId_t JobId;
81    char ClientName[MAX_NAME_LENGTH];
82    char last_jobid[20];
83    POOLMEM *JobIds;                   /* User entered string of JobIds */
84    STORE  *store;
85    JOB *restore_job;
86    POOL *pool;
87    int restore_jobs;
88    uint32_t selected_files;
89    char *where;
90    RBSR *bsr;
91    POOLMEM *fname;                    /* filename only */
92    POOLMEM *path;                     /* path only */
93    POOLMEM *query;
94    int fnl;                           /* filename length */
95    int pnl;                           /* path length */
96    bool found;
97    bool all;                          /* mark all as default */
98    NAME_LIST name_list;
99 };
100
101 #define MAX_ID_LIST_LEN 2000000
102
103
104 #endif