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 <afsconfig.h>
11 #include <afs/param.h>
20 #include <netinet/in.h>
23 #include <sys/types.h>
25 #include <afs/bubasics.h>
30 #include "budb_errs.h"
32 #include "budb_prototypes.h"
34 /* ----------------------------------
35 * structure printing utilities
36 * ----------------------------------
40 printDbHeader(struct DbHeader *ptr)
42 time_t created = ptr->created;
43 printf("version = %d\n", ptr->dbversion);
44 printf("created = %s", ctime(&created));
45 printf("cell = %s\n", ptr->cell);
46 printf("lastDumpId = %u\n", ptr->lastDumpId);
47 printf("lastInstanceId = %d\n", ptr->lastInstanceId);
48 printf("lastTapeId = %d\n", ptr->lastTapeId);
52 printDump(FILE *fid, struct dump *dptr)
54 time_t created = dptr->created;
55 fprintf(fid, "id = %u\n", dptr->id);
56 fprintf(fid, "idHashChain = %d\n", dptr->idHashChain);
57 fprintf(fid, "name = %s\n", dptr->dumpName);
58 fprintf(fid, "vsname = %s\n", dptr->volumeSet);
59 fprintf(fid, "dumpPath = %s\n", dptr->dumpPath);
60 fprintf(fid, "nameHashChain = %d\n", dptr->nameHashChain);
61 fprintf(fid, "flags = 0x%x\n", dptr->flags);
62 fprintf(fid, "parent = %u\n", dptr->parent);
63 fprintf(fid, "created = %s", ctime(&created));
64 fprintf(fid, "nVolumes = %d\n", dptr->nVolumes);
65 /* printTapeSet(&dptr->tapes); */
66 fprintf(fid, "firstTape = %d\n", dptr->firstTape);
67 /* printKtcPrincipal(&dptr->dumper); */
72 printDumpEntry(struct budb_dumpEntry *deptr)
74 time_t created = deptr->created;
75 printf("id = %u\n", deptr->id);
76 printf("Initial id = %u\n", deptr->initialDumpID);
77 printf("Appended id = %u\n", deptr->appendedDumpID);
78 printf("parent = %u\n", deptr->parent);
79 printf("level = %d\n", deptr->level);
80 printf("flags = 0x%x", deptr->flags);
81 if (deptr->flags == 0)
82 printf(": Successful");
83 if (deptr->flags & BUDB_DUMP_INCOMPLETE)
84 printf(": Incomplete");
85 if (deptr->flags & BUDB_DUMP_TAPEERROR)
86 printf(": Tape error");
87 if (deptr->flags & BUDB_DUMP_INPROGRESS)
88 printf(": In progress");
89 if (deptr->flags & BUDB_DUMP_ABORTED)
91 if (deptr->flags & BUDB_DUMP_ADSM)
92 printf(": (ADSM)"); /* XBSA interface to ADSM */
93 if (deptr->flags & BUDB_DUMP_BUTA)
94 printf(": (BUTA)"); /* buta dump */
96 printf("volumeSet = %s\n", deptr->volumeSetName);
97 printf("dump path = %s\n", deptr->dumpPath);
98 printf("name = %s\n", deptr->name);
99 printf("created = %s", ctime(&created));
100 printf("nVolumes = %d\n", deptr->nVolumes);
102 printTapeSet(&deptr->tapes, (deptr->flags & BUDB_DUMP_XBSA_NSS));
103 printPrincipal(&deptr->dumper);
107 * print the hash table structure, i.e. the header structure.
111 printHashTable(FILE *fid, struct hashTable *htptr)
113 fprintf(fid, "functionType = %d\n", htptr->functionType);
114 fprintf(fid, "threadOffset = %d\n", htptr->threadOffset);
115 fprintf(fid, "entries = %d\n", htptr->entries);
116 fprintf(fid, "length = %d\n", htptr->length);
117 fprintf(fid, "table = %d\n", htptr->table);
118 fprintf(fid, "progress = %d\n", htptr->progress);
119 fprintf(fid, "oldLength = %d\n", htptr->oldLength);
120 fprintf(fid, "oldTable = %d\n", htptr->oldTable);
123 /* printMemoryHashTable
124 * print the hash table structure, i.e. the header structure.
127 printMemoryHashTable(FILE *fid, struct memoryHashTable *mhtptr)
129 fprintf(fid, "threadOffset = %d\n", mhtptr->threadOffset);
130 fprintf(fid, "length = %d\n", mhtptr->length);
131 fprintf(fid, "progress = %d\n", mhtptr->progress);
132 fprintf(fid, "size = %d\n", mhtptr->size);
133 fprintf(fid, "oldsize = %d\n", mhtptr->oldSize);
138 printPrincipal(struct budb_principal *ptr)
140 printf("name = %s\n", ptr->name);
141 printf("instance = %s\n", ptr->instance);
142 printf("cell = %s\n", ptr->cell);
147 printStructDumpHeader(struct structDumpHeader *ptr)
149 printf("type = %d\n", ptr->type);
150 printf("structure version = %d\n", ptr->structversion);
151 printf("size = %d bytes\n", ptr->size);
156 printTape(FILE *fid, struct tape *tptr)
158 time_t written = tptr->written;
159 fprintf(fid, "name = %s\n", tptr->name);
160 fprintf(fid, "nameHashChain = %d\n", tptr->nameHashChain);
161 fprintf(fid, "flags = 0x%x\n", tptr->flags);
162 fprintf(fid, "written = %s", ctime(&written));
163 fprintf(fid, "nMBytes = %d\n", tptr->nMBytes);
164 fprintf(fid, "nBytes = %d\n", tptr->nBytes);
165 fprintf(fid, "nFiles = %d\n", tptr->nFiles);
166 fprintf(fid, "nVolumes = %d\n", tptr->nVolumes);
167 fprintf(fid, "seq = %d\n", tptr->seq);
168 fprintf(fid, "dump = %d\n", tptr->dump);
169 fprintf(fid, "nextTape = %d\n", tptr->nextTape);
170 fprintf(fid, "firstVol = %d\n", tptr->firstVol);
171 fprintf(fid, "labelPos = %d\n", tptr->labelpos);
172 fprintf(fid, "useCount = %d\n", tptr->useCount);
177 printTapeEntry(struct budb_tapeEntry *teptr)
179 time_t written = teptr->written;
180 time_t expires = teptr->expires;
182 printf("name = %s\n", teptr->name);
183 printf("flags = 0x%x", teptr->flags);
184 if (teptr->flags & BUDB_TAPE_TAPEERROR)
186 if (teptr->flags & BUDB_TAPE_DELETED)
188 if (teptr->flags & BUDB_TAPE_BEINGWRITTEN)
189 printf(": In progress");
190 if (teptr->flags & BUDB_TAPE_ABORTED)
192 if (teptr->flags & BUDB_TAPE_STAGED)
194 if (teptr->flags & BUDB_TAPE_WRITTEN)
195 printf(": Successful");
197 printf("written = %s", ctime(&written));
198 printf("expires = %s", cTIME(&expires));
199 printf("kBytes Tape Used = %u\n", teptr->useKBytes);
200 printf("nMBytes Data = %d\n", teptr->nMBytes);
201 printf("nBytes Data = %d\n", teptr->nBytes);
202 printf("nFiles = %d\n", teptr->nFiles);
203 printf("nVolumes = %d\n", teptr->nVolumes);
204 printf("seq = %d\n", teptr->seq);
205 printf("labelPos = %d\n", teptr->labelpos);
206 printf("useCount = %d\n", teptr->useCount);
207 printf("dump = %d\n", teptr->dump);
212 printTapeSet(struct budb_tapeSet *tsptr,
213 afs_int32 nss) /* is the tapeserver name an accurate name */
215 printf("Group id = %d\n", tsptr->id);
216 printf("tapeServer = %s%s\n", tsptr->tapeServer,
217 (nss ? " (single server)" : ""));
218 printf("format = %s\n", tsptr->format);
219 printf("maxTapes = %d\n", tsptr->maxTapes);
220 /* printf("a = %d\n",tsptr->a ); */
221 /* printf("b = %d\n",tsptr->b); */
222 printf("Start Tape Seq = %d\n", tsptr->b);
227 printVolumeEntry(struct budb_volumeEntry *veptr)
229 time_t clone = veptr->clone;
230 printf("name = %s\n", veptr->name);
231 printf("flags = 0x%x", veptr->flags);
232 if (veptr->flags & BUDB_VOL_TAPEERROR)
233 printf(": Tape Error");
234 if (veptr->flags & BUDB_VOL_FILEERROR)
235 printf(": File Error");
236 if (veptr->flags & BUDB_VOL_BEINGWRITTEN)
237 printf(": In progress");
238 if (veptr->flags & BUDB_VOL_FIRSTFRAG)
239 printf(": First fragment");
240 if (veptr->flags & BUDB_VOL_LASTFRAG)
241 printf(": Last fragment");
242 if (veptr->flags & BUDB_VOL_ABORTED)
245 printf("id = %d\n", veptr->id);
246 printf("server = %s\n", veptr->server);
247 printf("partition = %d\n", veptr->partition);
248 printf("tapeSeq = %d\n", veptr->tapeSeq);
250 printf("position = %d\n", veptr->position);
251 printf("clone = %s", ctime(&clone));
252 printf("startByte = %d\n", veptr->startByte);
253 printf("nBytes = %d\n", veptr->nBytes);
254 printf("seq = %d\n", veptr->seq);
256 printf("dump = %d\n", veptr->dump);
257 printf("tape = %s\n", veptr->tape);
262 printVolFragment(FILE *fid, struct volFragment *vfptr)
264 time_t clone = vfptr->clone;
265 time_t incTime = vfptr->incTime;
266 fprintf(fid, "vol = %d\n", vfptr->vol);
267 fprintf(fid, "sameNameChain = %d\n", vfptr->sameNameChain);
268 fprintf(fid, "tape = %d\n", vfptr->tape);
269 fprintf(fid, "sameTapeChain = %d\n", vfptr->sameTapeChain);
270 fprintf(fid, "position = %d\n", vfptr->position);
271 fprintf(fid, "clone = %s", ctime(&clone));
272 fprintf(fid, "incTime = %s", ctime(&incTime));
273 fprintf(fid, "startByte = %d\n", vfptr->startByte);
274 fprintf(fid, "nBytes = %d\n", vfptr->nBytes);
275 fprintf(fid, "flags = %d\n", vfptr->flags);
276 fprintf(fid, "sequence = %d\n", vfptr->sequence);
281 printVolInfo(FILE *fid, struct volInfo *viptr)
283 fprintf(fid, "name = %s\n", viptr->name);
284 fprintf(fid, "nameHashChain = %d\n", viptr->nameHashChain);
285 fprintf(fid, "id = %d\n", viptr->id);
286 fprintf(fid, "server = %s\n", viptr->server);
287 fprintf(fid, "partition = %d\n", viptr->partition);
288 fprintf(fid, "flags = 0x%x\n", viptr->flags);
289 fprintf(fid, "sameNameHead = %d\n", viptr->sameNameHead);
290 fprintf(fid, "sameNameChain = %d\n", viptr->sameNameChain);
291 fprintf(fid, "firstFragment = %d\n", viptr->firstFragment);
292 fprintf(fid, "nFrags = %d\n", viptr->nFrags);
297 /* -----------------------------------------
298 * structure xdr routines
299 * -----------------------------------------
302 /* utilities - network to host conversion
303 * currently used for debug only
307 volFragment_ntoh(struct volFragment *netVfPtr,
308 struct volFragment *hostVfPtr)
310 hostVfPtr->vol = ntohl(netVfPtr->vol);
311 hostVfPtr->sameNameChain = ntohl(netVfPtr->sameNameChain);
312 hostVfPtr->tape = ntohl(netVfPtr->tape);
313 hostVfPtr->sameTapeChain = ntohl(netVfPtr->sameTapeChain);
314 hostVfPtr->position = ntohl(netVfPtr->position);
315 hostVfPtr->clone = ntohl(netVfPtr->clone);
316 hostVfPtr->incTime = ntohl(netVfPtr->incTime);
317 hostVfPtr->startByte = ntohl(netVfPtr->startByte);
318 hostVfPtr->nBytes = ntohl(netVfPtr->nBytes);
319 hostVfPtr->flags = ntohs(netVfPtr->flags);
320 hostVfPtr->sequence = ntohs(netVfPtr->sequence);
324 volInfo_ntoh(struct volInfo *netViPtr,
325 struct volInfo *hostViPtr)
327 strcpy(hostViPtr->name, netViPtr->name);
328 hostViPtr->nameHashChain = ntohl(netViPtr->nameHashChain);
329 hostViPtr->id = ntohl(netViPtr->id);
330 strcpy(hostViPtr->server, netViPtr->server);
331 hostViPtr->partition = ntohl(netViPtr->partition);
332 hostViPtr->flags = ntohl(netViPtr->flags);
333 hostViPtr->sameNameHead = ntohl(netViPtr->sameNameHead);
334 hostViPtr->sameNameChain = ntohl(netViPtr->sameNameChain);
335 hostViPtr->firstFragment = ntohl(netViPtr->firstFragment);
336 hostViPtr->nFrags = ntohl(netViPtr->nFrags);
340 tape_ntoh(struct tape *netTapePtr,
341 struct tape *hostTapePtr)
343 strcpy(hostTapePtr->name, netTapePtr->name);
344 hostTapePtr->nameHashChain = ntohl(netTapePtr->nameHashChain);
345 hostTapePtr->flags = ntohl(netTapePtr->flags);
347 /* tape id conversion here */
348 hostTapePtr->written = ntohl(netTapePtr->written);
349 hostTapePtr->nMBytes = ntohl(netTapePtr->nMBytes);
350 hostTapePtr->nBytes = ntohl(netTapePtr->nBytes);
351 hostTapePtr->nFiles = ntohl(netTapePtr->nFiles);
352 hostTapePtr->nVolumes = ntohl(netTapePtr->nVolumes);
353 hostTapePtr->seq = ntohl(netTapePtr->seq);
354 hostTapePtr->dump = ntohl(netTapePtr->dump);
355 hostTapePtr->nextTape = ntohl(netTapePtr->nextTape);
356 hostTapePtr->labelpos = ntohl(netTapePtr->labelpos);
357 hostTapePtr->firstVol = ntohl(netTapePtr->firstVol);
358 hostTapePtr->useCount = ntohl(netTapePtr->useCount);
362 dump_ntoh(struct dump *netDumpPtr,
363 struct dump *hostDumpPtr)
365 hostDumpPtr->id = ntohl(netDumpPtr->id);
366 hostDumpPtr->idHashChain = ntohl(netDumpPtr->idHashChain);
367 strcpy(hostDumpPtr->dumpName, netDumpPtr->dumpName);
368 strcpy(hostDumpPtr->dumpPath, netDumpPtr->dumpPath);
369 strcpy(hostDumpPtr->volumeSet, netDumpPtr->volumeSet);
370 hostDumpPtr->nameHashChain = ntohl(netDumpPtr->nameHashChain);
371 hostDumpPtr->flags = ntohl(netDumpPtr->flags);
372 hostDumpPtr->parent = ntohl(netDumpPtr->parent);
373 hostDumpPtr->created = ntohl(netDumpPtr->created);
374 hostDumpPtr->nVolumes = ntohl(netDumpPtr->nVolumes);
375 hostDumpPtr->level = ntohl(netDumpPtr->level);
377 tapeSet_ntoh(&netDumpPtr->tapes, &hostDumpPtr->tapes);
379 hostDumpPtr->firstTape = ntohl(netDumpPtr->firstTape);
381 principal_ntoh(&netDumpPtr->dumper, &hostDumpPtr->dumper);
385 DbHeader_ntoh(struct DbHeader *netptr,
386 struct DbHeader *hostptr)
388 hostptr->dbversion = ntohl(netptr->dbversion);
389 hostptr->created = ntohl(netptr->created);
390 strcpy(hostptr->cell, netptr->cell);
391 hostptr->lastDumpId = ntohl(netptr->lastDumpId);
392 hostptr->lastInstanceId = ntohl(netptr->lastInstanceId);
393 hostptr->lastTapeId = ntohl(netptr->lastTapeId);
397 dumpEntry_ntoh(struct budb_dumpEntry *netptr,
398 struct budb_dumpEntry *hostptr)
400 hostptr->id = ntohl(netptr->id);
401 hostptr->initialDumpID = ntohl(netptr->initialDumpID);
402 hostptr->appendedDumpID = ntohl(netptr->appendedDumpID);
403 hostptr->parent = ntohl(netptr->parent);
404 hostptr->level = ntohl(netptr->level);
405 hostptr->flags = ntohl(netptr->flags);
406 strcpy(hostptr->volumeSetName, netptr->volumeSetName);
407 strcpy(hostptr->dumpPath, netptr->dumpPath);
408 strcpy(hostptr->name, netptr->name);
409 hostptr->created = ntohl(netptr->created);
410 hostptr->incTime = ntohl(netptr->incTime);
411 hostptr->nVolumes = ntohl(netptr->nVolumes);
413 tapeSet_ntoh(&netptr->tapes, &hostptr->tapes);
414 principal_ntoh(&netptr->dumper, &hostptr->dumper);
418 principal_hton(struct budb_principal *hostptr,
419 struct budb_principal *netptr)
421 strcpy(netptr->name, hostptr->name);
422 strcpy(netptr->instance, hostptr->instance);
423 strcpy(netptr->cell, hostptr->cell);
427 principal_ntoh(struct budb_principal *netptr,
428 struct budb_principal *hostptr)
430 strcpy(hostptr->name, netptr->name);
431 strcpy(hostptr->instance, netptr->instance);
432 strcpy(hostptr->cell, netptr->cell);
436 structDumpHeader_hton(struct structDumpHeader *hostPtr,
437 struct structDumpHeader *netPtr)
439 netPtr->type = htonl(hostPtr->type);
440 netPtr->structversion = htonl(hostPtr->structversion);
441 netPtr->size = htonl(hostPtr->size);
445 structDumpHeader_ntoh(struct structDumpHeader *netPtr,
446 struct structDumpHeader *hostPtr)
448 hostPtr->type = ntohl(netPtr->type);
449 hostPtr->structversion = ntohl(netPtr->structversion);
450 hostPtr->size = ntohl(netPtr->size);
454 tapeEntry_ntoh(struct budb_tapeEntry *netptr,
455 struct budb_tapeEntry *hostptr)
457 strcpy(hostptr->name, netptr->name);
458 hostptr->flags = ntohl(netptr->flags);
459 hostptr->written = ntohl(netptr->written);
460 hostptr->expires = ntohl(netptr->expires);
461 hostptr->nMBytes = ntohl(netptr->nMBytes);
462 hostptr->nBytes = ntohl(netptr->nBytes);
463 hostptr->nFiles = ntohl(netptr->nFiles);
464 hostptr->nVolumes = ntohl(netptr->nVolumes);
465 hostptr->seq = ntohl(netptr->seq);
466 hostptr->labelpos = ntohl(netptr->labelpos);
467 hostptr->useCount = ntohl(netptr->useCount);
468 hostptr->useKBytes = ntohl(netptr->useKBytes);
469 hostptr->dump = ntohl(netptr->dump);
473 tapeSet_hton(struct budb_tapeSet *hostptr,
474 struct budb_tapeSet *netptr)
476 netptr->id = htonl(hostptr->id);
477 strcpy(netptr->tapeServer, hostptr->tapeServer);
478 strcpy(netptr->format, hostptr->format);
479 netptr->maxTapes = htonl(hostptr->maxTapes);
480 netptr->a = htonl(hostptr->a);
481 netptr->b = htonl(hostptr->b);
486 tapeSet_ntoh(struct budb_tapeSet *netptr,
487 struct budb_tapeSet *hostptr)
489 hostptr->id = ntohl(netptr->id);
490 strcpy(hostptr->tapeServer, netptr->tapeServer);
491 strcpy(hostptr->format, netptr->format);
492 hostptr->maxTapes = ntohl(netptr->maxTapes);
493 hostptr->a = ntohl(netptr->a);
494 hostptr->b = ntohl(netptr->b);
499 textBlock_hton(struct textBlock *hostptr,
500 struct textBlock *netptr)
502 netptr->version = htonl(hostptr->version);
503 netptr->size = htonl(hostptr->size);
504 netptr->textAddr = htonl(hostptr->textAddr);
505 netptr->newsize = htonl(hostptr->newsize);
506 netptr->newTextAddr = htonl(hostptr->newTextAddr);
510 textBlock_ntoh(struct textBlock *netptr,
511 struct textBlock *hostptr)
513 hostptr->version = ntohl(netptr->version);
514 hostptr->size = ntohl(netptr->size);
515 hostptr->textAddr = ntohl(netptr->textAddr);
516 hostptr->newsize = ntohl(netptr->newsize);
517 hostptr->newTextAddr = ntohl(netptr->newTextAddr);
521 textLock_hton(db_lockP hostptr, db_lockP netptr)
523 netptr->type = htonl(hostptr->type);
524 netptr->lockState = htonl(hostptr->lockState);
525 netptr->lockTime = htonl(hostptr->lockTime);
526 netptr->expires = htonl(hostptr->expires);
527 netptr->instanceId = htonl(hostptr->instanceId);
528 netptr->lockHost = htonl(hostptr->lockHost);
532 textLock_ntoh(db_lockP netptr, db_lockP hostptr)
534 hostptr->type = ntohl(netptr->type);
535 hostptr->lockState = ntohl(netptr->lockState);
536 hostptr->lockTime = ntohl(netptr->lockTime);
537 hostptr->expires = ntohl(netptr->expires);
538 hostptr->instanceId = ntohl(netptr->instanceId);
539 hostptr->lockHost = ntohl(netptr->lockHost);
543 volumeEntry_ntoh(struct budb_volumeEntry *netptr,
544 struct budb_volumeEntry *hostptr)
546 strcpy(hostptr->name, netptr->name);
547 hostptr->flags = ntohl(netptr->flags);
548 hostptr->id = ntohl(netptr->id);
549 strcpy(hostptr->server, netptr->server);
550 hostptr->partition = ntohl(netptr->partition);
551 hostptr->tapeSeq = ntohl(netptr->tapeSeq);
553 hostptr->position = ntohl(netptr->position);
554 hostptr->clone = ntohl(netptr->clone);
555 hostptr->incTime = ntohl(netptr->incTime);
556 hostptr->startByte = ntohl(netptr->startByte);
557 hostptr->nBytes = ntohl(netptr->nBytes);
558 hostptr->seq = ntohl(netptr->seq);
560 hostptr->dump = ntohl(netptr->dump);
561 strcpy(hostptr->tape, netptr->tape);
564 /* -------------------------------------
565 * structure conversion & copy routines
566 * -------------------------------------
570 copy_ktcPrincipal_to_budbPrincipal(struct ktc_principal *ktcPtr,
571 struct budb_principal *budbPtr)
573 strncpy(budbPtr->name, ktcPtr->name, sizeof(budbPtr->name));
574 strncpy(budbPtr->instance, ktcPtr->instance, sizeof(budbPtr->instance));
575 strncpy(budbPtr->cell, ktcPtr->cell, sizeof(budbPtr->cell));
580 * dumpPtr - host format
584 dumpToBudbDump(dbDumpP dumpPtr, struct budb_dumpEntry *budbDumpPtr)
586 budbDumpPtr->id = dumpPtr->id;
587 budbDumpPtr->initialDumpID = dumpPtr->initialDumpID;
588 budbDumpPtr->parent = dumpPtr->parent;
589 budbDumpPtr->level = dumpPtr->level;
590 budbDumpPtr->flags = dumpPtr->flags;
592 strcpy(budbDumpPtr->volumeSetName, dumpPtr->volumeSet);
593 strcpy(budbDumpPtr->dumpPath, dumpPtr->dumpPath);
594 strcpy(budbDumpPtr->name, dumpPtr->dumpName);
596 budbDumpPtr->created = dumpPtr->created;
597 budbDumpPtr->nVolumes = dumpPtr->nVolumes;
599 memcpy(&budbDumpPtr->tapes, &dumpPtr->tapes, sizeof(struct budb_tapeSet));
600 copy_ktcPrincipal_to_budbPrincipal(&dumpPtr->dumper,
601 &budbDumpPtr->dumper);
606 tapeToBudbTape(struct tape *tapePtr, struct budb_tapeEntry *budbTapePtr)
608 strcpy(budbTapePtr->name, tapePtr->name);
609 budbTapePtr->flags = tapePtr->flags;
610 budbTapePtr->written = tapePtr->written;
611 budbTapePtr->expires = tapePtr->expires;
612 budbTapePtr->nMBytes = tapePtr->nMBytes;
613 budbTapePtr->nBytes = tapePtr->nBytes;
614 budbTapePtr->nFiles = tapePtr->nFiles;
615 budbTapePtr->nVolumes = tapePtr->nVolumes;
616 budbTapePtr->seq = tapePtr->seq;
617 budbTapePtr->labelpos = tapePtr->labelpos;
618 budbTapePtr->useCount = tapePtr->useCount;
619 budbTapePtr->useKBytes = tapePtr->useKBytes;
624 volsToBudbVol(struct volFragment *volFragPtr, struct volInfo *volInfoPtr,
625 struct budb_volumeEntry *budbVolPtr)
627 strcpy(budbVolPtr->name, volInfoPtr->name);
628 budbVolPtr->flags = volInfoPtr->flags;
629 budbVolPtr->id = volInfoPtr->id;
630 strcpy(budbVolPtr->server, volInfoPtr->server);
631 budbVolPtr->partition = volInfoPtr->partition;
632 budbVolPtr->tapeSeq = 0; /* Don't know it so mark invalid */
634 budbVolPtr->position = volFragPtr->position;
635 budbVolPtr->clone = volFragPtr->clone;
636 budbVolPtr->incTime = volFragPtr->incTime;
637 budbVolPtr->startByte = volFragPtr->startByte;
638 budbVolPtr->nBytes = volFragPtr->nBytes;
639 budbVolPtr->seq = volFragPtr->sequence;
643 /* ----------------------------------
644 * structure initialization routines
645 * ---------------------------------
649 * this fills in the tape set with the current default tapeset
652 * dumpname - volset.dumplevel
659 default_tapeset(struct budb_tapeSet *tapesetPtr, char *dumpname)
661 memset(tapesetPtr, 0, sizeof(*tapesetPtr));
663 strcpy(tapesetPtr->format, dumpname);
664 strcat(tapesetPtr->format, ".%d");
667 tapesetPtr->maxTapes = 0;