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>
19 #include <netinet/in.h>
22 #include <sys/types.h>
25 #include <afs/bubasics.h>
26 #include <afs/afsutil.h>
31 #include "budb_errs.h"
33 #include "budb_internal.h"
34 #include "budb_prototypes.h"
36 /* ----------------------------------
37 * structure printing utilities
38 * ----------------------------------
42 printDbHeader(struct DbHeader *ptr)
44 time_t created = ptr->created;
45 printf("version = %d\n", ptr->dbversion);
46 printf("created = %s", ctime(&created));
47 printf("cell = %s\n", ptr->cell);
48 printf("lastDumpId = %u\n", ptr->lastDumpId);
49 printf("lastInstanceId = %d\n", ptr->lastInstanceId);
50 printf("lastTapeId = %d\n", ptr->lastTapeId);
54 printDump(FILE *fid, struct dump *dptr)
56 time_t created = dptr->created;
57 fprintf(fid, "id = %u\n", dptr->id);
58 fprintf(fid, "idHashChain = %d\n", dptr->idHashChain);
59 fprintf(fid, "name = %s\n", dptr->dumpName);
60 fprintf(fid, "vsname = %s\n", dptr->volumeSet);
61 fprintf(fid, "dumpPath = %s\n", dptr->dumpPath);
62 fprintf(fid, "nameHashChain = %d\n", dptr->nameHashChain);
63 fprintf(fid, "flags = 0x%x\n", dptr->flags);
64 fprintf(fid, "parent = %u\n", dptr->parent);
65 fprintf(fid, "created = %s", ctime(&created));
66 fprintf(fid, "nVolumes = %d\n", dptr->nVolumes);
67 /* printTapeSet(&dptr->tapes); */
68 fprintf(fid, "firstTape = %d\n", dptr->firstTape);
69 /* printKtcPrincipal(&dptr->dumper); */
74 printDumpEntry(struct budb_dumpEntry *deptr)
76 time_t created = deptr->created;
77 printf("id = %u\n", deptr->id);
78 printf("Initial id = %u\n", deptr->initialDumpID);
79 printf("Appended id = %u\n", deptr->appendedDumpID);
80 printf("parent = %u\n", deptr->parent);
81 printf("level = %d\n", deptr->level);
82 printf("flags = 0x%x", deptr->flags);
83 if (deptr->flags == 0)
84 printf(": Successful");
85 if (deptr->flags & BUDB_DUMP_INCOMPLETE)
86 printf(": Incomplete");
87 if (deptr->flags & BUDB_DUMP_TAPEERROR)
88 printf(": Tape error");
89 if (deptr->flags & BUDB_DUMP_INPROGRESS)
90 printf(": In progress");
91 if (deptr->flags & BUDB_DUMP_ABORTED)
93 if (deptr->flags & BUDB_DUMP_ADSM)
94 printf(": (ADSM)"); /* XBSA interface to ADSM */
95 if (deptr->flags & BUDB_DUMP_BUTA)
96 printf(": (BUTA)"); /* buta dump */
98 printf("volumeSet = %s\n", deptr->volumeSetName);
99 printf("dump path = %s\n", deptr->dumpPath);
100 printf("name = %s\n", deptr->name);
101 printf("created = %s", ctime(&created));
102 printf("nVolumes = %d\n", deptr->nVolumes);
104 printTapeSet(&deptr->tapes, (deptr->flags & BUDB_DUMP_XBSA_NSS));
105 printPrincipal(&deptr->dumper);
109 * print the hash table structure, i.e. the header structure.
113 printHashTable(FILE *fid, struct hashTable *htptr)
115 fprintf(fid, "functionType = %d\n", htptr->functionType);
116 fprintf(fid, "threadOffset = %d\n", htptr->threadOffset);
117 fprintf(fid, "entries = %d\n", htptr->entries);
118 fprintf(fid, "length = %d\n", htptr->length);
119 fprintf(fid, "table = %d\n", htptr->table);
120 fprintf(fid, "progress = %d\n", htptr->progress);
121 fprintf(fid, "oldLength = %d\n", htptr->oldLength);
122 fprintf(fid, "oldTable = %d\n", htptr->oldTable);
125 /* printMemoryHashTable
126 * print the hash table structure, i.e. the header structure.
129 printMemoryHashTable(FILE *fid, struct memoryHashTable *mhtptr)
131 fprintf(fid, "threadOffset = %d\n", mhtptr->threadOffset);
132 fprintf(fid, "length = %d\n", mhtptr->length);
133 fprintf(fid, "progress = %d\n", mhtptr->progress);
134 fprintf(fid, "size = %d\n", mhtptr->size);
135 fprintf(fid, "oldsize = %d\n", mhtptr->oldSize);
140 printPrincipal(struct budb_principal *ptr)
142 printf("name = %s\n", ptr->name);
143 printf("instance = %s\n", ptr->instance);
144 printf("cell = %s\n", ptr->cell);
149 printStructDumpHeader(struct structDumpHeader *ptr)
151 printf("type = %d\n", ptr->type);
152 printf("structure version = %d\n", ptr->structversion);
153 printf("size = %d bytes\n", ptr->size);
158 printTape(FILE *fid, struct tape *tptr)
160 time_t written = tptr->written;
161 fprintf(fid, "name = %s\n", tptr->name);
162 fprintf(fid, "nameHashChain = %d\n", tptr->nameHashChain);
163 fprintf(fid, "flags = 0x%x\n", tptr->flags);
164 fprintf(fid, "written = %s", ctime(&written));
165 fprintf(fid, "nMBytes = %d\n", tptr->nMBytes);
166 fprintf(fid, "nBytes = %d\n", tptr->nBytes);
167 fprintf(fid, "nFiles = %d\n", tptr->nFiles);
168 fprintf(fid, "nVolumes = %d\n", tptr->nVolumes);
169 fprintf(fid, "seq = %d\n", tptr->seq);
170 fprintf(fid, "dump = %d\n", tptr->dump);
171 fprintf(fid, "nextTape = %d\n", tptr->nextTape);
172 fprintf(fid, "firstVol = %d\n", tptr->firstVol);
173 fprintf(fid, "labelPos = %d\n", tptr->labelpos);
174 fprintf(fid, "useCount = %d\n", tptr->useCount);
179 printTapeEntry(struct budb_tapeEntry *teptr)
181 time_t written = teptr->written;
182 time_t expires = teptr->expires;
184 printf("name = %s\n", teptr->name);
185 printf("flags = 0x%x", teptr->flags);
186 if (teptr->flags & BUDB_TAPE_TAPEERROR)
188 if (teptr->flags & BUDB_TAPE_DELETED)
190 if (teptr->flags & BUDB_TAPE_BEINGWRITTEN)
191 printf(": In progress");
192 if (teptr->flags & BUDB_TAPE_ABORTED)
194 if (teptr->flags & BUDB_TAPE_STAGED)
196 if (teptr->flags & BUDB_TAPE_WRITTEN)
197 printf(": Successful");
199 printf("written = %s", ctime(&written));
200 printf("expires = %s", cTIME(&expires));
201 printf("kBytes Tape Used = %u\n", teptr->useKBytes);
202 printf("nMBytes Data = %d\n", teptr->nMBytes);
203 printf("nBytes Data = %d\n", teptr->nBytes);
204 printf("nFiles = %d\n", teptr->nFiles);
205 printf("nVolumes = %d\n", teptr->nVolumes);
206 printf("seq = %d\n", teptr->seq);
207 printf("labelPos = %d\n", teptr->labelpos);
208 printf("useCount = %d\n", teptr->useCount);
209 printf("dump = %d\n", teptr->dump);
214 printTapeSet(struct budb_tapeSet *tsptr,
215 afs_int32 nss) /* is the tapeserver name an accurate name */
217 printf("Group id = %d\n", tsptr->id);
218 printf("tapeServer = %s%s\n", tsptr->tapeServer,
219 (nss ? " (single server)" : ""));
220 printf("format = %s\n", tsptr->format);
221 printf("maxTapes = %d\n", tsptr->maxTapes);
222 /* printf("a = %d\n",tsptr->a ); */
223 /* printf("b = %d\n",tsptr->b); */
224 printf("Start Tape Seq = %d\n", tsptr->b);
229 printVolumeEntry(struct budb_volumeEntry *veptr)
231 time_t clone = veptr->clone;
232 printf("name = %s\n", veptr->name);
233 printf("flags = 0x%x", veptr->flags);
234 if (veptr->flags & BUDB_VOL_TAPEERROR)
235 printf(": Tape Error");
236 if (veptr->flags & BUDB_VOL_FILEERROR)
237 printf(": File Error");
238 if (veptr->flags & BUDB_VOL_BEINGWRITTEN)
239 printf(": In progress");
240 if (veptr->flags & BUDB_VOL_FIRSTFRAG)
241 printf(": First fragment");
242 if (veptr->flags & BUDB_VOL_LASTFRAG)
243 printf(": Last fragment");
244 if (veptr->flags & BUDB_VOL_ABORTED)
247 printf("id = %d\n", veptr->id);
248 printf("server = %s\n", veptr->server);
249 printf("partition = %d\n", veptr->partition);
250 printf("tapeSeq = %d\n", veptr->tapeSeq);
252 printf("position = %d\n", veptr->position);
253 printf("clone = %s", ctime(&clone));
254 printf("startByte = %d\n", veptr->startByte);
255 printf("nBytes = %d\n", veptr->nBytes);
256 printf("seq = %d\n", veptr->seq);
258 printf("dump = %d\n", veptr->dump);
259 printf("tape = %s\n", veptr->tape);
264 printVolFragment(FILE *fid, struct volFragment *vfptr)
266 time_t clone = vfptr->clone;
267 time_t incTime = vfptr->incTime;
268 fprintf(fid, "vol = %d\n", vfptr->vol);
269 fprintf(fid, "sameNameChain = %d\n", vfptr->sameNameChain);
270 fprintf(fid, "tape = %d\n", vfptr->tape);
271 fprintf(fid, "sameTapeChain = %d\n", vfptr->sameTapeChain);
272 fprintf(fid, "position = %d\n", vfptr->position);
273 fprintf(fid, "clone = %s", ctime(&clone));
274 fprintf(fid, "incTime = %s", ctime(&incTime));
275 fprintf(fid, "startByte = %d\n", vfptr->startByte);
276 fprintf(fid, "nBytes = %d\n", vfptr->nBytes);
277 fprintf(fid, "flags = %d\n", vfptr->flags);
278 fprintf(fid, "sequence = %d\n", vfptr->sequence);
283 printVolInfo(FILE *fid, struct volInfo *viptr)
285 fprintf(fid, "name = %s\n", viptr->name);
286 fprintf(fid, "nameHashChain = %d\n", viptr->nameHashChain);
287 fprintf(fid, "id = %d\n", viptr->id);
288 fprintf(fid, "server = %s\n", viptr->server);
289 fprintf(fid, "partition = %d\n", viptr->partition);
290 fprintf(fid, "flags = 0x%x\n", viptr->flags);
291 fprintf(fid, "sameNameHead = %d\n", viptr->sameNameHead);
292 fprintf(fid, "sameNameChain = %d\n", viptr->sameNameChain);
293 fprintf(fid, "firstFragment = %d\n", viptr->firstFragment);
294 fprintf(fid, "nFrags = %d\n", viptr->nFrags);
299 /* -----------------------------------------
300 * structure xdr routines
301 * -----------------------------------------
304 /* utilities - network to host conversion
305 * currently used for debug only
309 volFragment_ntoh(struct volFragment *netVfPtr,
310 struct volFragment *hostVfPtr)
312 hostVfPtr->vol = ntohl(netVfPtr->vol);
313 hostVfPtr->sameNameChain = ntohl(netVfPtr->sameNameChain);
314 hostVfPtr->tape = ntohl(netVfPtr->tape);
315 hostVfPtr->sameTapeChain = ntohl(netVfPtr->sameTapeChain);
316 hostVfPtr->position = ntohl(netVfPtr->position);
317 hostVfPtr->clone = ntohl(netVfPtr->clone);
318 hostVfPtr->incTime = ntohl(netVfPtr->incTime);
319 hostVfPtr->startByte = ntohl(netVfPtr->startByte);
320 hostVfPtr->nBytes = ntohl(netVfPtr->nBytes);
321 hostVfPtr->flags = ntohs(netVfPtr->flags);
322 hostVfPtr->sequence = ntohs(netVfPtr->sequence);
326 volInfo_ntoh(struct volInfo *netViPtr,
327 struct volInfo *hostViPtr)
329 strcpy(hostViPtr->name, netViPtr->name);
330 hostViPtr->nameHashChain = ntohl(netViPtr->nameHashChain);
331 hostViPtr->id = ntohl(netViPtr->id);
332 strcpy(hostViPtr->server, netViPtr->server);
333 hostViPtr->partition = ntohl(netViPtr->partition);
334 hostViPtr->flags = ntohl(netViPtr->flags);
335 hostViPtr->sameNameHead = ntohl(netViPtr->sameNameHead);
336 hostViPtr->sameNameChain = ntohl(netViPtr->sameNameChain);
337 hostViPtr->firstFragment = ntohl(netViPtr->firstFragment);
338 hostViPtr->nFrags = ntohl(netViPtr->nFrags);
342 tape_ntoh(struct tape *netTapePtr,
343 struct tape *hostTapePtr)
345 strcpy(hostTapePtr->name, netTapePtr->name);
346 hostTapePtr->nameHashChain = ntohl(netTapePtr->nameHashChain);
347 hostTapePtr->flags = ntohl(netTapePtr->flags);
349 /* tape id conversion here */
350 hostTapePtr->written = ntohl(netTapePtr->written);
351 hostTapePtr->nMBytes = ntohl(netTapePtr->nMBytes);
352 hostTapePtr->nBytes = ntohl(netTapePtr->nBytes);
353 hostTapePtr->nFiles = ntohl(netTapePtr->nFiles);
354 hostTapePtr->nVolumes = ntohl(netTapePtr->nVolumes);
355 hostTapePtr->seq = ntohl(netTapePtr->seq);
356 hostTapePtr->dump = ntohl(netTapePtr->dump);
357 hostTapePtr->nextTape = ntohl(netTapePtr->nextTape);
358 hostTapePtr->labelpos = ntohl(netTapePtr->labelpos);
359 hostTapePtr->firstVol = ntohl(netTapePtr->firstVol);
360 hostTapePtr->useCount = ntohl(netTapePtr->useCount);
364 dump_ntoh(struct dump *netDumpPtr,
365 struct dump *hostDumpPtr)
367 hostDumpPtr->id = ntohl(netDumpPtr->id);
368 hostDumpPtr->idHashChain = ntohl(netDumpPtr->idHashChain);
369 strlcpy(hostDumpPtr->dumpName, netDumpPtr->dumpName,
370 sizeof(hostDumpPtr->dumpName));
371 strlcpy(hostDumpPtr->dumpPath, netDumpPtr->dumpPath,
372 sizeof(hostDumpPtr->dumpPath));
373 strlcpy(hostDumpPtr->volumeSet, netDumpPtr->volumeSet,
374 sizeof(hostDumpPtr->volumeSet));
375 hostDumpPtr->nameHashChain = ntohl(netDumpPtr->nameHashChain);
376 hostDumpPtr->flags = ntohl(netDumpPtr->flags);
377 hostDumpPtr->parent = ntohl(netDumpPtr->parent);
378 hostDumpPtr->created = ntohl(netDumpPtr->created);
379 hostDumpPtr->nVolumes = ntohl(netDumpPtr->nVolumes);
380 hostDumpPtr->level = ntohl(netDumpPtr->level);
382 tapeSet_ntoh(&netDumpPtr->tapes, &hostDumpPtr->tapes);
384 hostDumpPtr->firstTape = ntohl(netDumpPtr->firstTape);
386 hostDumpPtr->dumper = netDumpPtr->dumper;
390 DbHeader_ntoh(struct DbHeader *netptr,
391 struct DbHeader *hostptr)
393 hostptr->dbversion = ntohl(netptr->dbversion);
394 hostptr->created = ntohl(netptr->created);
395 strcpy(hostptr->cell, netptr->cell);
396 hostptr->lastDumpId = ntohl(netptr->lastDumpId);
397 hostptr->lastInstanceId = ntohl(netptr->lastInstanceId);
398 hostptr->lastTapeId = ntohl(netptr->lastTapeId);
402 dumpEntry_ntoh(struct budb_dumpEntry *netptr,
403 struct budb_dumpEntry *hostptr)
405 hostptr->id = ntohl(netptr->id);
406 hostptr->initialDumpID = ntohl(netptr->initialDumpID);
407 hostptr->appendedDumpID = ntohl(netptr->appendedDumpID);
408 hostptr->parent = ntohl(netptr->parent);
409 hostptr->level = ntohl(netptr->level);
410 hostptr->flags = ntohl(netptr->flags);
411 strcpy(hostptr->volumeSetName, netptr->volumeSetName);
412 strcpy(hostptr->dumpPath, netptr->dumpPath);
413 strcpy(hostptr->name, netptr->name);
414 hostptr->created = ntohl(netptr->created);
415 hostptr->incTime = ntohl(netptr->incTime);
416 hostptr->nVolumes = ntohl(netptr->nVolumes);
418 tapeSet_ntoh(&netptr->tapes, &hostptr->tapes);
419 principal_ntoh(&netptr->dumper, &hostptr->dumper);
423 principal_hton(struct budb_principal *hostptr,
424 struct budb_principal *netptr)
426 strcpy(netptr->name, hostptr->name);
427 strcpy(netptr->instance, hostptr->instance);
428 strcpy(netptr->cell, hostptr->cell);
432 principal_ntoh(struct budb_principal *netptr,
433 struct budb_principal *hostptr)
435 strcpy(hostptr->name, netptr->name);
436 strcpy(hostptr->instance, netptr->instance);
437 strcpy(hostptr->cell, netptr->cell);
441 structDumpHeader_hton(struct structDumpHeader *hostPtr,
442 struct structDumpHeader *netPtr)
444 netPtr->type = htonl(hostPtr->type);
445 netPtr->structversion = htonl(hostPtr->structversion);
446 netPtr->size = htonl(hostPtr->size);
450 structDumpHeader_ntoh(struct structDumpHeader *netPtr,
451 struct structDumpHeader *hostPtr)
453 hostPtr->type = ntohl(netPtr->type);
454 hostPtr->structversion = ntohl(netPtr->structversion);
455 hostPtr->size = ntohl(netPtr->size);
459 tapeEntry_ntoh(struct budb_tapeEntry *netptr,
460 struct budb_tapeEntry *hostptr)
462 strcpy(hostptr->name, netptr->name);
463 hostptr->flags = ntohl(netptr->flags);
464 hostptr->written = ntohl(netptr->written);
465 hostptr->expires = ntohl(netptr->expires);
466 hostptr->nMBytes = ntohl(netptr->nMBytes);
467 hostptr->nBytes = ntohl(netptr->nBytes);
468 hostptr->nFiles = ntohl(netptr->nFiles);
469 hostptr->nVolumes = ntohl(netptr->nVolumes);
470 hostptr->seq = ntohl(netptr->seq);
471 hostptr->labelpos = ntohl(netptr->labelpos);
472 hostptr->useCount = ntohl(netptr->useCount);
473 hostptr->useKBytes = ntohl(netptr->useKBytes);
474 hostptr->dump = ntohl(netptr->dump);
478 tapeSet_hton(struct budb_tapeSet *hostptr,
479 struct budb_tapeSet *netptr)
481 netptr->id = htonl(hostptr->id);
482 strcpy(netptr->tapeServer, hostptr->tapeServer);
483 strcpy(netptr->format, hostptr->format);
484 netptr->maxTapes = htonl(hostptr->maxTapes);
485 netptr->a = htonl(hostptr->a);
486 netptr->b = htonl(hostptr->b);
491 tapeSet_ntoh(struct budb_tapeSet *netptr,
492 struct budb_tapeSet *hostptr)
494 hostptr->id = ntohl(netptr->id);
495 strcpy(hostptr->tapeServer, netptr->tapeServer);
496 strcpy(hostptr->format, netptr->format);
497 hostptr->maxTapes = ntohl(netptr->maxTapes);
498 hostptr->a = ntohl(netptr->a);
499 hostptr->b = ntohl(netptr->b);
504 textBlock_hton(struct textBlock *hostptr,
505 struct textBlock *netptr)
507 netptr->version = htonl(hostptr->version);
508 netptr->size = htonl(hostptr->size);
509 netptr->textAddr = htonl(hostptr->textAddr);
510 netptr->newsize = htonl(hostptr->newsize);
511 netptr->newTextAddr = htonl(hostptr->newTextAddr);
515 textBlock_ntoh(struct textBlock *netptr,
516 struct textBlock *hostptr)
518 hostptr->version = ntohl(netptr->version);
519 hostptr->size = ntohl(netptr->size);
520 hostptr->textAddr = ntohl(netptr->textAddr);
521 hostptr->newsize = ntohl(netptr->newsize);
522 hostptr->newTextAddr = ntohl(netptr->newTextAddr);
526 textLock_hton(db_lockP hostptr, db_lockP netptr)
528 netptr->type = htonl(hostptr->type);
529 netptr->lockState = htonl(hostptr->lockState);
530 netptr->lockTime = htonl(hostptr->lockTime);
531 netptr->expires = htonl(hostptr->expires);
532 netptr->instanceId = htonl(hostptr->instanceId);
533 netptr->lockHost = htonl(hostptr->lockHost);
537 textLock_ntoh(db_lockP netptr, db_lockP hostptr)
539 hostptr->type = ntohl(netptr->type);
540 hostptr->lockState = ntohl(netptr->lockState);
541 hostptr->lockTime = ntohl(netptr->lockTime);
542 hostptr->expires = ntohl(netptr->expires);
543 hostptr->instanceId = ntohl(netptr->instanceId);
544 hostptr->lockHost = ntohl(netptr->lockHost);
548 volumeEntry_ntoh(struct budb_volumeEntry *netptr,
549 struct budb_volumeEntry *hostptr)
551 strcpy(hostptr->name, netptr->name);
552 hostptr->flags = ntohl(netptr->flags);
553 hostptr->id = ntohl(netptr->id);
554 strcpy(hostptr->server, netptr->server);
555 hostptr->partition = ntohl(netptr->partition);
556 hostptr->tapeSeq = ntohl(netptr->tapeSeq);
558 hostptr->position = ntohl(netptr->position);
559 hostptr->clone = ntohl(netptr->clone);
560 hostptr->incTime = ntohl(netptr->incTime);
561 hostptr->startByte = ntohl(netptr->startByte);
562 hostptr->nBytes = ntohl(netptr->nBytes);
563 hostptr->seq = ntohl(netptr->seq);
565 hostptr->dump = ntohl(netptr->dump);
566 strcpy(hostptr->tape, netptr->tape);
569 /* -------------------------------------
570 * structure conversion & copy routines
571 * -------------------------------------
575 copy_ktcPrincipal_to_budbPrincipal(struct ktc_principal *ktcPtr,
576 struct budb_principal *budbPtr)
578 strncpy(budbPtr->name, ktcPtr->name, sizeof(budbPtr->name));
579 strncpy(budbPtr->instance, ktcPtr->instance, sizeof(budbPtr->instance));
580 strncpy(budbPtr->cell, ktcPtr->cell, sizeof(budbPtr->cell));
585 * dumpPtr - host format
589 dumpToBudbDump(dbDumpP dumpPtr, struct budb_dumpEntry *budbDumpPtr)
591 budbDumpPtr->id = dumpPtr->id;
592 budbDumpPtr->initialDumpID = dumpPtr->initialDumpID;
593 budbDumpPtr->parent = dumpPtr->parent;
594 budbDumpPtr->level = dumpPtr->level;
595 budbDumpPtr->flags = dumpPtr->flags;
597 strcpy(budbDumpPtr->volumeSetName, dumpPtr->volumeSet);
598 strcpy(budbDumpPtr->dumpPath, dumpPtr->dumpPath);
599 strcpy(budbDumpPtr->name, dumpPtr->dumpName);
601 budbDumpPtr->created = dumpPtr->created;
602 budbDumpPtr->nVolumes = dumpPtr->nVolumes;
604 memcpy(&budbDumpPtr->tapes, &dumpPtr->tapes, sizeof(struct budb_tapeSet));
605 copy_ktcPrincipal_to_budbPrincipal(&dumpPtr->dumper,
606 &budbDumpPtr->dumper);
611 tapeToBudbTape(struct tape *tapePtr, struct budb_tapeEntry *budbTapePtr)
613 strcpy(budbTapePtr->name, tapePtr->name);
614 budbTapePtr->flags = tapePtr->flags;
615 budbTapePtr->written = tapePtr->written;
616 budbTapePtr->expires = tapePtr->expires;
617 budbTapePtr->nMBytes = tapePtr->nMBytes;
618 budbTapePtr->nBytes = tapePtr->nBytes;
619 budbTapePtr->nFiles = tapePtr->nFiles;
620 budbTapePtr->nVolumes = tapePtr->nVolumes;
621 budbTapePtr->seq = tapePtr->seq;
622 budbTapePtr->labelpos = tapePtr->labelpos;
623 budbTapePtr->useCount = tapePtr->useCount;
624 budbTapePtr->useKBytes = tapePtr->useKBytes;
629 volsToBudbVol(struct volFragment *volFragPtr, struct volInfo *volInfoPtr,
630 struct budb_volumeEntry *budbVolPtr)
632 strcpy(budbVolPtr->name, volInfoPtr->name);
633 budbVolPtr->flags = volInfoPtr->flags;
634 budbVolPtr->id = volInfoPtr->id;
635 strcpy(budbVolPtr->server, volInfoPtr->server);
636 budbVolPtr->partition = volInfoPtr->partition;
637 budbVolPtr->tapeSeq = 0; /* Don't know it so mark invalid */
639 budbVolPtr->position = volFragPtr->position;
640 budbVolPtr->clone = volFragPtr->clone;
641 budbVolPtr->incTime = volFragPtr->incTime;
642 budbVolPtr->startByte = volFragPtr->startByte;
643 budbVolPtr->nBytes = volFragPtr->nBytes;
644 budbVolPtr->seq = volFragPtr->sequence;
648 /* ----------------------------------
649 * structure initialization routines
650 * ---------------------------------
654 * this fills in the tape set with the current default tapeset
657 * dumpname - volset.dumplevel
664 default_tapeset(struct budb_tapeSet *tapesetPtr, char *dumpname)
666 memset(tapesetPtr, 0, sizeof(*tapesetPtr));
668 strcpy(tapesetPtr->format, dumpname);
669 strcat(tapesetPtr->format, ".%d");
672 tapesetPtr->maxTapes = 0;