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
13 /* version numbers. This version information is accessed from more than
14 * one module. Version information is kept for:
15 * bucoord <-> butc interface
16 * butc <-> butm interface
17 * bu* <-> budb interface
19 * and as an interim measure, for
21 * dump database files i.e. D*.db
24 /* Version of butc <-> butm interface
25 * These are not version flags as the name suggests.
28 #define BUTM_VERSIONFLAG_0 0 /* every size measure is in bytes */
29 #define BUTM_VERSIONFLAG_1 1 /* every size measure is in kbytes */
30 #define BUTM_VERSIONFLAG_2 2 /* afs 3.1 features */
32 /* current version of the interface */
33 #define BUTM_MAJORVERSION BUTM_VERSIONFLAG_2
35 /* versions for the bucoord <-> butc interface */
36 #define BUTC_VERSION_1 1 /* initial version, afs 3.1 */
37 #define BUTC_VERSION_2 2 /* 3.4 version - added voltype to tc_dumpDesc */
38 #define BUTC_VERSION_3 3 /* 3.4 version - labeltape change */
39 #define CUR_BUTC_VERSION BUTC_VERSION_3
41 /* TAPE_VERSION Version of the current tape format used by butc
44 * version 0: ?? - sizes in bytes
45 * version 1: Sizes in kbytes.
47 * 1) Tape expiration information in label
48 * 2) backup systems's EOT markers at the end of a dump
50 * 1) dump id and tape use count in label
52 * 1) Got rid of large EOT markers
53 * 2) Supports appended dumps
56 #define TAPE_VERSION_0 0
57 #define TAPE_VERSION_1 1
58 #define TAPE_VERSION_2 2
59 #define TAPE_VERSION_3 3
60 #define TAPE_VERSION_4 4
61 #define CUR_TAPE_VERSION TAPE_VERSION_4
63 #define BC_SCHEDULE_MAGIC 0x74327285 /* magic # for schedules */
64 #define BC_SCHEDULE_V3_1 1 /* afs 3.1 */
65 #define BC_SCHEDULE_VERSION BC_SCHEDULE_V3_1 /* current version */
67 #define BC_DUMPDB_MAGIC 0x10381645 /* magic # for dump db */
68 #define BC_DUMPDB_V3_1 1 /* afs 3.1 */
69 #define BC_DUMPDB_VERSION BC_DUMPDB_V3_1 /* current version */
71 /* define ports that move to system configuration later */
72 #define BC_MESSAGEPORT 7020 /* for communicating with backup coordinator */
73 #define BC_TAPEPORT 7025 /* for communicating with tape controller */
75 #ifndef AFSCONF_BUDBPORT
76 #define AFSCONF_BUDBPORT 7021 /* for communicating with backup database */
78 #define BUDB_SERVICE 22314 /* service id */
80 /* maximums for various text strings
81 * DON'T alter these values until all disk/tape structures can be handled
82 * correctly. In particular, volume names are 64.
86 #define DUMP_FAILED 1 /* outright failed */
87 #define DUMP_PARTIAL 2 /* partial on tape */
88 #define DUMP_SUCCESS 3 /* all ok */
89 #define DUMP_RETRY 4 /* failed, but retry */
90 #define DUMP_NORETRYEOT 5 /* failed, and don't retry */
91 #define DUMP_NOTHING 6 /* Nothing was dumped */
92 #define DUMP_NODUMP 7 /* don't dump, and don't retry */
95 #define BU_MAXNAMELEN 32 /* max for misc. names: eg volumes */
96 #define BU_MAXTAPELEN 32 /* for tape names */
97 #define BU_MAXHOSTLEN 32 /* for server (machine) names */
98 #define BU_MAXTOKENLEN 16 /* identifiers */
99 #define BU_MAXUNAMELEN 256 /* length of a user name */
100 #define BU_MAXCELLLEN 256 /* length of a cell name */
102 /* proposed maximum name lengths PA */
103 #define BU_MAX_NAME 64 /* misc. names */
104 #define BU_MAX_DUMP_PATH 256 /* length of schedule path name */
106 #define BC_MAXPORTOFFSET 58510 /* max number of port offsets in database */
109 #define NEVERDATE 037777777777 /* a date that will never come */
112 #define NEVERSTRING "NEVER \n"
114 #define cTIME(t) ( (*(t) == NEVERDATE) ? (char *)NEVERSTRING : (char *)ctime(t) )
117 #define Date afs_uint32
120 #define DUMP_TAPE_NAME "Ubik_db_dump" /* base database tape name */
122 /* for expiration date processing */
123 #define BC_NO_EXPDATE 0 /* no expiration date */
124 #define BC_ABS_EXPDATE 1 /* absolute expiration date */
125 #define BC_REL_EXPDATE 2 /* relative expiration date */
127 /*macro which generates tape names from tapeSetName */
128 #define tc_MakeTapeName(name,set,seq) \
129 sprintf (name, (set)->format, (seq) + (set)->b)
131 /* common structure definitions */
133 struct dlqlink
*dlq_next
;
134 struct dlqlink
*dlq_prev
;
136 void *dlq_structPtr
; /* enclosing structure */
139 typedef struct dlqlink dlqlinkT
;
140 typedef dlqlinkT
*dlqlinkP
;
144 #define DLQ_HEAD 1001
146 #define DLQ_VOLENTRY 10
147 #define DLQ_FINISHTAPE 11
148 #define DLQ_USETAPE 12
149 #define DLQ_FINISHDUMP 13
150 #define DLQ_USEDUMP 14
152 /* simple assertion - for testing, don't halt processing */
154 #define DLQASSERT(condition) \
155 if ( (condition) == 0 ) \
157 printf("DLQASSERT: %s failed\n", #condition); \
160 /* function typing */
161 extern dlqlinkP
dlqFront(dlqlinkP
);
162 extern dlqlinkP
dlqUnlinkb(dlqlinkP
);
163 extern dlqlinkP
dlqUnlinkf(dlqlinkP
);
165 /* -----------------------------
167 * -----------------------------
170 /* status management flags
173 * C - client side only
174 * S - server side only
175 * B - client or server
178 #define STARTING 0x1 /* C; still setting up, no server task yet */
179 #define ABORT_REQUEST 0x2 /* B; user requested abort */
180 #define ABORT_SENT 0x4 /* C; abort sent to server (REQ cleared) */
181 #define ABORT_DONE 0x8 /* S; abort complete on server */
182 #define ABORT_LOCAL 0x10 /* C; abort local task if contact lost */
183 #define TASK_DONE 0x20 /* B; task complete */
184 #define SILENT 0x400 /* C; don't be verbose about termination */
185 #define NOREMOVE 0x1000 /* C; don't remove from queue */
188 #define CONTACT_LOST 0x40 /* B; contact lost */
190 /* errror handling */
191 #define TASK_ERROR 0x80 /* S; had fatal error, will terminate */
193 /* general status - copied back to client for jobs status */
194 #define DRIVE_WAIT 0x100 /* S; waiting for drive to become free */
195 #define OPR_WAIT 0x200 /* S; waiting for operator action */
196 #define CALL_WAIT 0x800 /* S; waiting for callout routine completion */
201 afs_uint32 taskId
; /* task identifier */
202 afs_uint32 dbDumpId
; /* dump id */
203 afs_uint32 flags
; /* as above */
204 afs_uint32 nKBytes
; /* bytes xferred */
205 char volumeName
[BU_MAXNAMELEN
]; /* current volume (if any) */
206 afs_int32 volsFailed
; /* # operation failures */
207 afs_int32 lastPolled
; /* last successful poll */
210 char taskName
[64]; /* type of task */
213 afs_int32 volsTotal
; /* total # vols */
214 afs_int32 scheduledDump
; /* Time this dump was scheduled */
215 char *cmdLine
; /* Command to exectute for this dump */
218 typedef struct statusS statusT
;
219 typedef statusT
*statusP
;