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>
18 #include <netinet/in.h>
21 #include <sys/types.h>
23 #include <afs/bubasics.h>
28 #include "budb_errs.h"
30 #include "budb_prototypes.h"
32 /* ----------------------------------
33 * structure printing utilities
34 * ----------------------------------
38 printDbHeader(struct DbHeader *ptr)
40 time_t created = ptr->created;
41 printf("version = %d\n", ptr->dbversion);
42 printf("created = %s", ctime(&created));
43 printf("cell = %s\n", ptr->cell);
44 printf("lastDumpId = %u\n", ptr->lastDumpId);
45 printf("lastInstanceId = %d\n", ptr->lastInstanceId);
46 printf("lastTapeId = %d\n", ptr->lastTapeId);
50 printDump(FILE *fid, struct dump *dptr)
52 time_t created = dptr->created;
53 fprintf(fid, "id = %u\n", dptr->id);
54 fprintf(fid, "idHashChain = %d\n", dptr->idHashChain);
55 fprintf(fid, "name = %s\n", dptr->dumpName);
56 fprintf(fid, "vsname = %s\n", dptr->volumeSet);
57 fprintf(fid, "dumpPath = %s\n", dptr->dumpPath);
58 fprintf(fid, "nameHashChain = %d\n", dptr->nameHashChain);
59 fprintf(fid, "flags = 0x%x\n", dptr->flags);
60 fprintf(fid, "parent = %u\n", dptr->parent);
61 fprintf(fid, "created = %s", ctime(&created));
62 fprintf(fid, "nVolumes = %d\n", dptr->nVolumes);
63 /* printTapeSet(&dptr->tapes); */
64 fprintf(fid, "firstTape = %d\n", dptr->firstTape);
65 /* printKtcPrincipal(&dptr->dumper); */
70 printDumpEntry(struct budb_dumpEntry *deptr)
72 time_t created = deptr->created;
73 printf("id = %u\n", deptr->id);
74 printf("Initial id = %u\n", deptr->initialDumpID);
75 printf("Appended id = %u\n", deptr->appendedDumpID);
76 printf("parent = %u\n", deptr->parent);
77 printf("level = %d\n", deptr->level);
78 printf("flags = 0x%x", deptr->flags);
79 if (deptr->flags == 0)
80 printf(": Successful");
81 if (deptr->flags & BUDB_DUMP_INCOMPLETE)
82 printf(": Incomplete");
83 if (deptr->flags & BUDB_DUMP_TAPEERROR)
84 printf(": Tape error");
85 if (deptr->flags & BUDB_DUMP_INPROGRESS)
86 printf(": In progress");
87 if (deptr->flags & BUDB_DUMP_ABORTED)
89 if (deptr->flags & BUDB_DUMP_ADSM)
90 printf(": (ADSM)"); /* XBSA interface to ADSM */
91 if (deptr->flags & BUDB_DUMP_BUTA)
92 printf(": (BUTA)"); /* buta dump */
94 printf("volumeSet = %s\n", deptr->volumeSetName);
95 printf("dump path = %s\n", deptr->dumpPath);
96 printf("name = %s\n", deptr->name);
97 printf("created = %s", ctime(&created));
98 printf("nVolumes = %d\n", deptr->nVolumes);
100 printTapeSet(&deptr->tapes, (deptr->flags & BUDB_DUMP_XBSA_NSS));
101 printPrincipal(&deptr->dumper);
105 * print the hash table structure, i.e. the header structure.
109 printHashTable(FILE *fid, struct hashTable *htptr)
111 fprintf(fid, "functionType = %d\n", htptr->functionType);
112 fprintf(fid, "threadOffset = %d\n", htptr->threadOffset);
113 fprintf(fid, "entries = %d\n", htptr->entries);
114 fprintf(fid, "length = %d\n", htptr->length);
115 fprintf(fid, "table = %d\n", htptr->table);
116 fprintf(fid, "progress = %d\n", htptr->progress);
117 fprintf(fid, "oldLength = %d\n", htptr->oldLength);
118 fprintf(fid, "oldTable = %d\n", htptr->oldTable);
121 /* printMemoryHashTable
122 * print the hash table structure, i.e. the header structure.
125 printMemoryHashTable(FILE *fid, struct memoryHashTable *mhtptr)
127 fprintf(fid, "threadOffset = %d\n", mhtptr->threadOffset);
128 fprintf(fid, "length = %d\n", mhtptr->length);
129 fprintf(fid, "progress = %d\n", mhtptr->progress);
130 fprintf(fid, "size = %d\n", mhtptr->size);
131 fprintf(fid, "oldsize = %d\n", mhtptr->oldSize);
136 printPrincipal(struct budb_principal *ptr)
138 printf("name = %s\n", ptr->name);
139 printf("instance = %s\n", ptr->instance);
140 printf("cell = %s\n", ptr->cell);
145 printStructDumpHeader(struct structDumpHeader *ptr)
147 printf("type = %d\n", ptr->type);
148 printf("structure version = %d\n", ptr->structversion);
149 printf("size = %d bytes\n", ptr->size);
154 printTape(FILE *fid, struct tape *tptr)
156 time_t written = tptr->written;
157 fprintf(fid, "name = %s\n", tptr->name);
158 fprintf(fid, "nameHashChain = %d\n", tptr->nameHashChain);
159 fprintf(fid, "flags = 0x%x\n", tptr->flags);
160 fprintf(fid, "written = %s", ctime(&written));
161 fprintf(fid, "nMBytes = %d\n", tptr->nMBytes);
162 fprintf(fid, "nBytes = %d\n", tptr->nBytes);
163 fprintf(fid, "nFiles = %d\n", tptr->nFiles);
164 fprintf(fid, "nVolumes = %d\n", tptr->nVolumes);
165 fprintf(fid, "seq = %d\n", tptr->seq);
166 fprintf(fid, "dump = %d\n", tptr->dump);
167 fprintf(fid, "nextTape = %d\n", tptr->nextTape);
168 fprintf(fid, "firstVol = %d\n", tptr->firstVol);
169 fprintf(fid, "labelPos = %d\n", tptr->labelpos);
170 fprintf(fid, "useCount = %d\n", tptr->useCount);
175 printTapeEntry(struct budb_tapeEntry *teptr)
177 time_t written = teptr->written;
178 time_t expires = teptr->expires;
180 printf("name = %s\n", teptr->name);
181 printf("flags = 0x%x", teptr->flags);
182 if (teptr->flags & BUDB_TAPE_TAPEERROR)
184 if (teptr->flags & BUDB_TAPE_DELETED)
186 if (teptr->flags & BUDB_TAPE_BEINGWRITTEN)
187 printf(": In progress");
188 if (teptr->flags & BUDB_TAPE_ABORTED)
190 if (teptr->flags & BUDB_TAPE_STAGED)
192 if (teptr->flags & BUDB_TAPE_WRITTEN)
193 printf(": Successful");
195 printf("written = %s", ctime(&written));
196 printf("expires = %s", cTIME(&expires));
197 printf("kBytes Tape Used = %u\n", teptr->useKBytes);
198 printf("nMBytes Data = %d\n", teptr->nMBytes);
199 printf("nBytes Data = %d\n", teptr->nBytes);
200 printf("nFiles = %d\n", teptr->nFiles);
201 printf("nVolumes = %d\n", teptr->nVolumes);
202 printf("seq = %d\n", teptr->seq);
203 printf("labelPos = %d\n", teptr->labelpos);
204 printf("useCount = %d\n", teptr->useCount);
205 printf("dump = %d\n", teptr->dump);
210 printTapeSet(struct budb_tapeSet *tsptr,
211 afs_int32 nss) /* is the tapeserver name an accurate name */
213 printf("Group id = %d\n", tsptr->id);
214 printf("tapeServer = %s%s\n", tsptr->tapeServer,
215 (nss ? " (single server)" : ""));
216 printf("format = %s\n", tsptr->format);
217 printf("maxTapes = %d\n", tsptr->maxTapes);
218 /* printf("a = %d\n",tsptr->a ); */
219 /* printf("b = %d\n",tsptr->b); */
220 printf("Start Tape Seq = %d\n", tsptr->b);
225 printVolumeEntry(struct budb_volumeEntry *veptr)
227 time_t clone = veptr->clone;
228 printf("name = %s\n", veptr->name);
229 printf("flags = 0x%x", veptr->flags);
230 if (veptr->flags & BUDB_VOL_TAPEERROR)
231 printf(": Tape Error");
232 if (veptr->flags & BUDB_VOL_FILEERROR)
233 printf(": File Error");
234 if (veptr->flags & BUDB_VOL_BEINGWRITTEN)
235 printf(": In progress");
236 if (veptr->flags & BUDB_VOL_FIRSTFRAG)
237 printf(": First fragment");
238 if (veptr->flags & BUDB_VOL_LASTFRAG)
239 printf(": Last fragment");
240 if (veptr->flags & BUDB_VOL_ABORTED)
243 printf("id = %d\n", veptr->id);
244 printf("server = %s\n", veptr->server);
245 printf("partition = %d\n", veptr->partition);
246 printf("tapeSeq = %d\n", veptr->tapeSeq);
248 printf("position = %d\n", veptr->position);
249 printf("clone = %s", ctime(&clone));
250 printf("startByte = %d\n", veptr->startByte);
251 printf("nBytes = %d\n", veptr->nBytes);
252 printf("seq = %d\n", veptr->seq);
254 printf("dump = %d\n", veptr->dump);
255 printf("tape = %s\n", veptr->tape);
260 printVolFragment(FILE *fid, struct volFragment *vfptr)
262 time_t clone = vfptr->clone;
263 time_t incTime = vfptr->incTime;
264 fprintf(fid, "vol = %d\n", vfptr->vol);
265 fprintf(fid, "sameNameChain = %d\n", vfptr->sameNameChain);
266 fprintf(fid, "tape = %d\n", vfptr->tape);
267 fprintf(fid, "sameTapeChain = %d\n", vfptr->sameTapeChain);
268 fprintf(fid, "position = %d\n", vfptr->position);
269 fprintf(fid, "clone = %s", ctime(&clone));
270 fprintf(fid, "incTime = %s", ctime(&incTime));
271 fprintf(fid, "startByte = %d\n", vfptr->startByte);
272 fprintf(fid, "nBytes = %d\n", vfptr->nBytes);
273 fprintf(fid, "flags = %d\n", vfptr->flags);
274 fprintf(fid, "sequence = %d\n", vfptr->sequence);
279 printVolInfo(FILE *fid, struct volInfo *viptr)
281 fprintf(fid, "name = %s\n", viptr->name);
282 fprintf(fid, "nameHashChain = %d\n", viptr->nameHashChain);
283 fprintf(fid, "id = %d\n", viptr->id);
284 fprintf(fid, "server = %s\n", viptr->server);
285 fprintf(fid, "partition = %d\n", viptr->partition);
286 fprintf(fid, "flags = 0x%x\n", viptr->flags);
287 fprintf(fid, "sameNameHead = %d\n", viptr->sameNameHead);
288 fprintf(fid, "sameNameChain = %d\n", viptr->sameNameChain);
289 fprintf(fid, "firstFragment = %d\n", viptr->firstFragment);
290 fprintf(fid, "nFrags = %d\n", viptr->nFrags);
295 /* -----------------------------------------
296 * structure xdr routines
297 * -----------------------------------------
300 /* utilities - network to host conversion
301 * currently used for debug only
305 volFragment_ntoh(struct volFragment *netVfPtr,
306 struct volFragment *hostVfPtr)
308 hostVfPtr->vol = ntohl(netVfPtr->vol);
309 hostVfPtr->sameNameChain = ntohl(netVfPtr->sameNameChain);
310 hostVfPtr->tape = ntohl(netVfPtr->tape);
311 hostVfPtr->sameTapeChain = ntohl(netVfPtr->sameTapeChain);
312 hostVfPtr->position = ntohl(netVfPtr->position);
313 hostVfPtr->clone = ntohl(netVfPtr->clone);
314 hostVfPtr->incTime = ntohl(netVfPtr->incTime);
315 hostVfPtr->startByte = ntohl(netVfPtr->startByte);
316 hostVfPtr->nBytes = ntohl(netVfPtr->nBytes);
317 hostVfPtr->flags = ntohs(netVfPtr->flags);
318 hostVfPtr->sequence = ntohs(netVfPtr->sequence);
322 volInfo_ntoh(struct volInfo *netViPtr,
323 struct volInfo *hostViPtr)
325 strcpy(hostViPtr->name, netViPtr->name);
326 hostViPtr->nameHashChain = ntohl(netViPtr->nameHashChain);
327 hostViPtr->id = ntohl(netViPtr->id);
328 strcpy(hostViPtr->server, netViPtr->server);
329 hostViPtr->partition = ntohl(netViPtr->partition);
330 hostViPtr->flags = ntohl(netViPtr->flags);
331 hostViPtr->sameNameHead = ntohl(netViPtr->sameNameHead);
332 hostViPtr->sameNameChain = ntohl(netViPtr->sameNameChain);
333 hostViPtr->firstFragment = ntohl(netViPtr->firstFragment);
334 hostViPtr->nFrags = ntohl(netViPtr->nFrags);
338 tape_ntoh(struct tape *netTapePtr,
339 struct tape *hostTapePtr)
341 strcpy(hostTapePtr->name, netTapePtr->name);
342 hostTapePtr->nameHashChain = ntohl(netTapePtr->nameHashChain);
343 hostTapePtr->flags = ntohl(netTapePtr->flags);
345 /* tape id conversion here */
346 hostTapePtr->written = ntohl(netTapePtr->written);
347 hostTapePtr->nMBytes = ntohl(netTapePtr->nMBytes);
348 hostTapePtr->nBytes = ntohl(netTapePtr->nBytes);
349 hostTapePtr->nFiles = ntohl(netTapePtr->nFiles);
350 hostTapePtr->nVolumes = ntohl(netTapePtr->nVolumes);
351 hostTapePtr->seq = ntohl(netTapePtr->seq);
352 hostTapePtr->dump = ntohl(netTapePtr->dump);
353 hostTapePtr->nextTape = ntohl(netTapePtr->nextTape);
354 hostTapePtr->labelpos = ntohl(netTapePtr->labelpos);
355 hostTapePtr->firstVol = ntohl(netTapePtr->firstVol);
356 hostTapePtr->useCount = ntohl(netTapePtr->useCount);
360 dump_ntoh(struct dump *netDumpPtr,
361 struct dump *hostDumpPtr)
363 hostDumpPtr->id = ntohl(netDumpPtr->id);
364 hostDumpPtr->idHashChain = ntohl(netDumpPtr->idHashChain);
365 strcpy(hostDumpPtr->dumpName, netDumpPtr->dumpName);
366 strcpy(hostDumpPtr->dumpPath, netDumpPtr->dumpPath);
367 strcpy(hostDumpPtr->volumeSet, netDumpPtr->volumeSet);
368 hostDumpPtr->nameHashChain = ntohl(netDumpPtr->nameHashChain);
369 hostDumpPtr->flags = ntohl(netDumpPtr->flags);
370 hostDumpPtr->parent = ntohl(netDumpPtr->parent);
371 hostDumpPtr->created = ntohl(netDumpPtr->created);
372 hostDumpPtr->nVolumes = ntohl(netDumpPtr->nVolumes);
373 hostDumpPtr->level = ntohl(netDumpPtr->level);
375 tapeSet_ntoh(&netDumpPtr->tapes, &hostDumpPtr->tapes);
377 hostDumpPtr->firstTape = ntohl(netDumpPtr->firstTape);
379 principal_ntoh(&netDumpPtr->dumper, &hostDumpPtr->dumper);
383 DbHeader_ntoh(struct DbHeader *netptr,
384 struct DbHeader *hostptr)
386 hostptr->dbversion = ntohl(netptr->dbversion);
387 hostptr->created = ntohl(netptr->created);
388 strcpy(hostptr->cell, netptr->cell);
389 hostptr->lastDumpId = ntohl(netptr->lastDumpId);
390 hostptr->lastInstanceId = ntohl(netptr->lastInstanceId);
391 hostptr->lastTapeId = ntohl(netptr->lastTapeId);
395 dumpEntry_ntoh(struct budb_dumpEntry *netptr,
396 struct budb_dumpEntry *hostptr)
398 hostptr->id = ntohl(netptr->id);
399 hostptr->initialDumpID = ntohl(netptr->initialDumpID);
400 hostptr->appendedDumpID = ntohl(netptr->appendedDumpID);
401 hostptr->parent = ntohl(netptr->parent);
402 hostptr->level = ntohl(netptr->level);
403 hostptr->flags = ntohl(netptr->flags);
404 strcpy(hostptr->volumeSetName, netptr->volumeSetName);
405 strcpy(hostptr->dumpPath, netptr->dumpPath);
406 strcpy(hostptr->name, netptr->name);
407 hostptr->created = ntohl(netptr->created);
408 hostptr->incTime = ntohl(netptr->incTime);
409 hostptr->nVolumes = ntohl(netptr->nVolumes);
411 tapeSet_ntoh(&netptr->tapes, &hostptr->tapes);
412 principal_ntoh(&netptr->dumper, &hostptr->dumper);
416 principal_hton(struct budb_principal *hostptr,
417 struct budb_principal *netptr)
419 strcpy(netptr->name, hostptr->name);
420 strcpy(netptr->instance, hostptr->instance);
421 strcpy(netptr->cell, hostptr->cell);
425 principal_ntoh(struct budb_principal *netptr,
426 struct budb_principal *hostptr)
428 strcpy(hostptr->name, netptr->name);
429 strcpy(hostptr->instance, netptr->instance);
430 strcpy(hostptr->cell, netptr->cell);
434 structDumpHeader_hton(struct structDumpHeader *hostPtr,
435 struct structDumpHeader *netPtr)
437 netPtr->type = htonl(hostPtr->type);
438 netPtr->structversion = htonl(hostPtr->structversion);
439 netPtr->size = htonl(hostPtr->size);
443 structDumpHeader_ntoh(struct structDumpHeader *netPtr,
444 struct structDumpHeader *hostPtr)
446 hostPtr->type = ntohl(netPtr->type);
447 hostPtr->structversion = ntohl(netPtr->structversion);
448 hostPtr->size = ntohl(netPtr->size);
452 tapeEntry_ntoh(struct budb_tapeEntry *netptr,
453 struct budb_tapeEntry *hostptr)
455 strcpy(hostptr->name, netptr->name);
456 hostptr->flags = ntohl(netptr->flags);
457 hostptr->written = ntohl(netptr->written);
458 hostptr->expires = ntohl(netptr->expires);
459 hostptr->nMBytes = ntohl(netptr->nMBytes);
460 hostptr->nBytes = ntohl(netptr->nBytes);
461 hostptr->nFiles = ntohl(netptr->nFiles);
462 hostptr->nVolumes = ntohl(netptr->nVolumes);
463 hostptr->seq = ntohl(netptr->seq);
464 hostptr->labelpos = ntohl(netptr->labelpos);
465 hostptr->useCount = ntohl(netptr->useCount);
466 hostptr->useKBytes = ntohl(netptr->useKBytes);
467 hostptr->dump = ntohl(netptr->dump);
471 tapeSet_hton(struct budb_tapeSet *hostptr,
472 struct budb_tapeSet *netptr)
474 netptr->id = htonl(hostptr->id);
475 strcpy(netptr->tapeServer, hostptr->tapeServer);
476 strcpy(netptr->format, hostptr->format);
477 netptr->maxTapes = htonl(hostptr->maxTapes);
478 netptr->a = htonl(hostptr->a);
479 netptr->b = htonl(hostptr->b);
484 tapeSet_ntoh(struct budb_tapeSet *netptr,
485 struct budb_tapeSet *hostptr)
487 hostptr->id = ntohl(netptr->id);
488 strcpy(hostptr->tapeServer, netptr->tapeServer);
489 strcpy(hostptr->format, netptr->format);
490 hostptr->maxTapes = ntohl(netptr->maxTapes);
491 hostptr->a = ntohl(netptr->a);
492 hostptr->b = ntohl(netptr->b);
497 textBlock_hton(struct textBlock *hostptr,
498 struct textBlock *netptr)
500 netptr->version = htonl(hostptr->version);
501 netptr->size = htonl(hostptr->size);
502 netptr->textAddr = htonl(hostptr->textAddr);
503 netptr->newsize = htonl(hostptr->newsize);
504 netptr->newTextAddr = htonl(hostptr->newTextAddr);
508 textBlock_ntoh(struct textBlock *netptr,
509 struct textBlock *hostptr)
511 hostptr->version = ntohl(netptr->version);
512 hostptr->size = ntohl(netptr->size);
513 hostptr->textAddr = ntohl(netptr->textAddr);
514 hostptr->newsize = ntohl(netptr->newsize);
515 hostptr->newTextAddr = ntohl(netptr->newTextAddr);
519 textLock_hton(db_lockP hostptr, db_lockP netptr)
521 netptr->type = htonl(hostptr->type);
522 netptr->lockState = htonl(hostptr->lockState);
523 netptr->lockTime = htonl(hostptr->lockTime);
524 netptr->expires = htonl(hostptr->expires);
525 netptr->instanceId = htonl(hostptr->instanceId);
526 netptr->lockHost = htonl(hostptr->lockHost);
530 textLock_ntoh(db_lockP netptr, db_lockP hostptr)
532 hostptr->type = ntohl(netptr->type);
533 hostptr->lockState = ntohl(netptr->lockState);
534 hostptr->lockTime = ntohl(netptr->lockTime);
535 hostptr->expires = ntohl(netptr->expires);
536 hostptr->instanceId = ntohl(netptr->instanceId);
537 hostptr->lockHost = ntohl(netptr->lockHost);
541 volumeEntry_ntoh(struct budb_volumeEntry *netptr,
542 struct budb_volumeEntry *hostptr)
544 strcpy(hostptr->name, netptr->name);
545 hostptr->flags = ntohl(netptr->flags);
546 hostptr->id = ntohl(netptr->id);
547 strcpy(hostptr->server, netptr->server);
548 hostptr->partition = ntohl(netptr->partition);
549 hostptr->tapeSeq = ntohl(netptr->tapeSeq);
551 hostptr->position = ntohl(netptr->position);
552 hostptr->clone = ntohl(netptr->clone);
553 hostptr->incTime = ntohl(netptr->incTime);
554 hostptr->startByte = ntohl(netptr->startByte);
555 hostptr->nBytes = ntohl(netptr->nBytes);
556 hostptr->seq = ntohl(netptr->seq);
558 hostptr->dump = ntohl(netptr->dump);
559 strcpy(hostptr->tape, netptr->tape);
562 /* -------------------------------------
563 * structure conversion & copy routines
564 * -------------------------------------
568 copy_ktcPrincipal_to_budbPrincipal(struct ktc_principal *ktcPtr,
569 struct budb_principal *budbPtr)
571 strncpy(budbPtr->name, ktcPtr->name, sizeof(budbPtr->name));
572 strncpy(budbPtr->instance, ktcPtr->instance, sizeof(budbPtr->instance));
573 strncpy(budbPtr->cell, ktcPtr->cell, sizeof(budbPtr->cell));
578 * dumpPtr - host format
582 dumpToBudbDump(dbDumpP dumpPtr, struct budb_dumpEntry *budbDumpPtr)
584 budbDumpPtr->id = dumpPtr->id;
585 budbDumpPtr->initialDumpID = dumpPtr->initialDumpID;
586 budbDumpPtr->parent = dumpPtr->parent;
587 budbDumpPtr->level = dumpPtr->level;
588 budbDumpPtr->flags = dumpPtr->flags;
590 strcpy(budbDumpPtr->volumeSetName, dumpPtr->volumeSet);
591 strcpy(budbDumpPtr->dumpPath, dumpPtr->dumpPath);
592 strcpy(budbDumpPtr->name, dumpPtr->dumpName);
594 budbDumpPtr->created = dumpPtr->created;
595 budbDumpPtr->nVolumes = dumpPtr->nVolumes;
597 memcpy(&budbDumpPtr->tapes, &dumpPtr->tapes, sizeof(struct budb_tapeSet));
598 copy_ktcPrincipal_to_budbPrincipal(&dumpPtr->dumper,
599 &budbDumpPtr->dumper);
604 tapeToBudbTape(struct tape *tapePtr, struct budb_tapeEntry *budbTapePtr)
606 strcpy(budbTapePtr->name, tapePtr->name);
607 budbTapePtr->flags = tapePtr->flags;
608 budbTapePtr->written = tapePtr->written;
609 budbTapePtr->expires = tapePtr->expires;
610 budbTapePtr->nMBytes = tapePtr->nMBytes;
611 budbTapePtr->nBytes = tapePtr->nBytes;
612 budbTapePtr->nFiles = tapePtr->nFiles;
613 budbTapePtr->nVolumes = tapePtr->nVolumes;
614 budbTapePtr->seq = tapePtr->seq;
615 budbTapePtr->labelpos = tapePtr->labelpos;
616 budbTapePtr->useCount = tapePtr->useCount;
617 budbTapePtr->useKBytes = tapePtr->useKBytes;
622 volsToBudbVol(struct volFragment *volFragPtr, struct volInfo *volInfoPtr,
623 struct budb_volumeEntry *budbVolPtr)
625 strcpy(budbVolPtr->name, volInfoPtr->name);
626 budbVolPtr->flags = volInfoPtr->flags;
627 budbVolPtr->id = volInfoPtr->id;
628 strcpy(budbVolPtr->server, volInfoPtr->server);
629 budbVolPtr->partition = volInfoPtr->partition;
630 budbVolPtr->tapeSeq = 0; /* Don't know it so mark invalid */
632 budbVolPtr->position = volFragPtr->position;
633 budbVolPtr->clone = volFragPtr->clone;
634 budbVolPtr->incTime = volFragPtr->incTime;
635 budbVolPtr->startByte = volFragPtr->startByte;
636 budbVolPtr->nBytes = volFragPtr->nBytes;
637 budbVolPtr->seq = volFragPtr->sequence;
641 /* ----------------------------------
642 * structure initialization routines
643 * ---------------------------------
647 * this fills in the tape set with the current default tapeset
650 * dumpname - volset.dumplevel
657 default_tapeset(struct budb_tapeSet *tapesetPtr, char *dumpname)
659 memset(tapesetPtr, 0, sizeof(*tapesetPtr));
661 strcpy(tapesetPtr->format, dumpname);
662 strcat(tapesetPtr->format, ".%d");
665 tapesetPtr->maxTapes = 0;