2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afs/budb_client.h>
11 #include <afs/afsutil.h>
15 #endif /* HAVE_STDIO_H */
16 #if defined(HAVE_STRING_H)
18 #elif defined(HAVE_STRINGS_H)
20 #endif /* HAVE_STRING_H */
23 * Represents a host in the config database.
26 struct bc_hostEntry *next; /*Ptr to next record */
27 char *name; /*Stringname for host */
28 struct sockaddr_in addr; /*Corresponding sockaddr */
29 afs_int32 portOffset; /*Port=standardPort+portOffset-allows multiple TC on a host */
33 * Global backup program configuration information.
36 char *path; /*Root directory for config info */
37 struct bc_hostEntry *dbaseHosts; /*Hosts providing the backup database service */
38 struct bc_hostEntry *tapeHosts; /*Hosts providing the tape drives */
39 struct bc_volumeSet *vset; /*List of all volume sets */
40 struct bc_dumpSchedule *dsched; /*Dump schedule list */
41 udbClientTextT configText[TB_NUM]; /* configuration text handles */
42 char tmpTextFileNames[TB_NUM][AFSDIR_PATH_MAX]; /* names of temp files created to store config text recd from buserver */
46 * Central status information relating to per-opcode routine information.
49 int isCmdLineOpcode; /*Is this the opcode being done for the command line? */
53 * Representation of a Volume Set, namely the specification for a group of
54 * related volumes. Each volume set has a name and a list of volume
55 * descriptions, one for each line in the volumeset configuration file.
57 #define VSFLAG_TEMPORARY 1 /* Volume set is temporary */
60 struct bc_volumeSet *next; /*Ptr to next volume set record */
61 char *name; /*Volume set name */
62 afs_int32 flags; /* flags */
63 struct bc_volumeEntry *ventries; /*List of component volume entries */
67 * Represents the name of a volume specifier in a volume set.
69 struct bc_volumeEntry {
70 struct bc_volumeEntry *next; /*Ptr to next record in list */
71 char *serverName; /*Host name for volume spec */
72 struct sockaddr_in server; /*Host sockaddr for volume spec */
73 char *partname; /*Partition pattern name */
74 afs_int32 partition; /*Partition number for volume spec */
75 char *name; /*Volume pattern name */
79 * Represents an individual volume to be dumped, not a collection.
81 struct bc_volumeDump {
82 struct bc_volumeDump *next; /*Ptr to next record */
83 afs_int32 vid; /*Volume id, or 0 if not known */
84 struct bc_volumeEntry *entry; /*Back pointer: information about server (obs?) */
85 char *name; /*Individual volume name */
86 afs_int32 volType; /*Volume type */
87 afs_int32 date; /*From date (for full, incremental or whatever) */
88 afs_int32 cloneDate; /* time of this volume's snapshot */
89 afs_int32 partition; /* partition containing this volume */
90 struct sockaddr_in server; /* server to obtain data from */
94 * Represents a dump schedule node, representing one type of dump (e.g. the
95 * safe5 daily incremental)
97 struct bc_dumpSchedule {
98 struct bc_dumpSchedule *next; /*Ptr to next record */
99 char *name; /*Dump sched name */
100 char *vsname; /*Volume set name to dump */
101 afs_int32 period; /*Period in minutes */
102 afs_int32 periodType; /*Qualifier on above, for exceptions like 'monthly' */
103 char *parentName; /*Parent dump schedule name-unused PA */
104 struct bc_dumpSchedule *parent; /*These are built at run-time */
105 struct bc_dumpSchedule *firstChild;
106 struct bc_dumpSchedule *nextSibling;
107 afs_int32 level; /*Level of the dump (do we need this?) */
108 afs_int32 expDate; /* expiration date */
109 afs_int32 expType; /* absolute or relative expiration */
113 * Private: represents a queued dump/restore item.
117 struct bc_config *config;
118 struct bc_volumeDump *volumes;
119 char *dumpName; /*Dump name we're doing */
120 char *volSetName; /*Volume set we're dumping */
122 afs_int32 dumpID; /*Dump ID we're running */
123 int oldFlag; /* if a restore, whether we're doing it to the same vol#s */
124 struct sockaddr_in destServer; /* destination server for restore command */
125 afs_int32 destPartition; /* destination partition for restore command */
126 afs_int32 fromDate; /* date from which to do a restore command */
127 afs_int32 parentDumpID; /* parent dump ID */
128 afs_int32 dumpLevel; /* dump level being performed */
129 char *newExt; /* new volume extension if any, if oldFlag is false */
130 afs_int32 bytesTransferred; /* How many bytes sent */
131 afs_int32 volumeBeingDumped; /* the volume being processed */
132 afs_int32 *portOffset; /* used to derive the ports of the TCs */
133 afs_int32 portCount; /* number of points in the portOffset array */
134 afs_int32 expDate; /* for dumps - expiration date */
135 afs_int32 expType; /* for dumps - abs. or relative expiration */
136 int doAppend; /* for dumps - append this dump to the dump set */
137 int dontExecute; /* dont execute the dump or restore */
140 #define BC_DI_INUSE 1 /* entry not used */
142 #define DBHOSTFILE "dbasehosts"
143 #define TAPEHOSTFILE "tapehosts"
144 #define DSNAME "dumpschedule"
145 #define VSNAME "volumeset"
147 #define BC_MAXSIMDUMPS 64
148 #define BC_MAXPORTS 128 /* max number of port offsets for volrestore */
149 /* debugging support */