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_internal.h"
31 #include "budb_prototypes.h"
33 /* ----------------------------------
34 * structure printing utilities
35 * ----------------------------------
39 printDbHeader(struct DbHeader *ptr)
41 time_t created = ptr->created;
42 printf("version = %d\n", ptr->dbversion);
43 printf("created = %s", ctime(&created));
44 printf("cell = %s\n", ptr->cell);
45 printf("lastDumpId = %u\n", ptr->lastDumpId);
46 printf("lastInstanceId = %d\n", ptr->lastInstanceId);
47 printf("lastTapeId = %d\n", ptr->lastTapeId);
51 printDump(FILE *fid, struct dump *dptr)
53 time_t created = dptr->created;
54 fprintf(fid, "id = %u\n", dptr->id);
55 fprintf(fid, "idHashChain = %d\n", dptr->idHashChain);
56 fprintf(fid, "name = %s\n", dptr->dumpName);
57 fprintf(fid, "vsname = %s\n", dptr->volumeSet);
58 fprintf(fid, "dumpPath = %s\n", dptr->dumpPath);
59 fprintf(fid, "nameHashChain = %d\n", dptr->nameHashChain);
60 fprintf(fid, "flags = 0x%x\n", dptr->flags);
61 fprintf(fid, "parent = %u\n", dptr->parent);
62 fprintf(fid, "created = %s", ctime(&created));
63 fprintf(fid, "nVolumes = %d\n", dptr->nVolumes);
64 /* printTapeSet(&dptr->tapes); */
65 fprintf(fid, "firstTape = %d\n", dptr->firstTape);
66 /* printKtcPrincipal(&dptr->dumper); */
71 printDumpEntry(struct budb_dumpEntry *deptr)
73 time_t created = deptr->created;
74 printf("id = %u\n", deptr->id);
75 printf("Initial id = %u\n", deptr->initialDumpID);
76 printf("Appended id = %u\n", deptr->appendedDumpID);
77 printf("parent = %u\n", deptr->parent);
78 printf("level = %d\n", deptr->level);
79 printf("flags = 0x%x", deptr->flags);
80 if (deptr->flags == 0)
81 printf(": Successful");
82 if (deptr->flags & BUDB_DUMP_INCOMPLETE)
83 printf(": Incomplete");
84 if (deptr->flags & BUDB_DUMP_TAPEERROR)
85 printf(": Tape error");
86 if (deptr->flags & BUDB_DUMP_INPROGRESS)
87 printf(": In progress");
88 if (deptr->flags & BUDB_DUMP_ABORTED)
90 if (deptr->flags & BUDB_DUMP_ADSM)
91 printf(": (ADSM)"); /* XBSA interface to ADSM */
92 if (deptr->flags & BUDB_DUMP_BUTA)
93 printf(": (BUTA)"); /* buta dump */
95 printf("volumeSet = %s\n", deptr->volumeSetName);
96 printf("dump path = %s\n", deptr->dumpPath);
97 printf("name = %s\n", deptr->name);
98 printf("created = %s", ctime(&created));
99 printf("nVolumes = %d\n", deptr->nVolumes);
101 printTapeSet(&deptr->tapes, (deptr->flags & BUDB_DUMP_XBSA_NSS));
102 printPrincipal(&deptr->dumper);
106 * print the hash table structure, i.e. the header structure.
110 printHashTable(FILE *fid, struct hashTable *htptr)
112 fprintf(fid, "functionType = %d\n", htptr->functionType);
113 fprintf(fid, "threadOffset = %d\n", htptr->threadOffset);
114 fprintf(fid, "entries = %d\n", htptr->entries);
115 fprintf(fid, "length = %d\n", htptr->length);
116 fprintf(fid, "table = %d\n", htptr->table);
117 fprintf(fid, "progress = %d\n", htptr->progress);
118 fprintf(fid, "oldLength = %d\n", htptr->oldLength);
119 fprintf(fid, "oldTable = %d\n", htptr->oldTable);
122 /* printMemoryHashTable
123 * print the hash table structure, i.e. the header structure.
126 printMemoryHashTable(FILE *fid, struct memoryHashTable *mhtptr)
128 fprintf(fid, "threadOffset = %d\n", mhtptr->threadOffset);
129 fprintf(fid, "length = %d\n", mhtptr->length);
130 fprintf(fid, "progress = %d\n", mhtptr->progress);
131 fprintf(fid, "size = %d\n", mhtptr->size);
132 fprintf(fid, "oldsize = %d\n", mhtptr->oldSize);
137 printPrincipal(struct budb_principal *ptr)
139 printf("name = %s\n", ptr->name);
140 printf("instance = %s\n", ptr->instance);
141 printf("cell = %s\n", ptr->cell);
146 printStructDumpHeader(struct structDumpHeader *ptr)
148 printf("type = %d\n", ptr->type);
149 printf("structure version = %d\n", ptr->structversion);
150 printf("size = %d bytes\n", ptr->size);
155 printTape(FILE *fid, struct tape *tptr)
157 time_t written = tptr->written;
158 fprintf(fid, "name = %s\n", tptr->name);
159 fprintf(fid, "nameHashChain = %d\n", tptr->nameHashChain);
160 fprintf(fid, "flags = 0x%x\n", tptr->flags);
161 fprintf(fid, "written = %s", ctime(&written));
162 fprintf(fid, "nMBytes = %d\n", tptr->nMBytes);
163 fprintf(fid, "nBytes = %d\n", tptr->nBytes);
164 fprintf(fid, "nFiles = %d\n", tptr->nFiles);
165 fprintf(fid, "nVolumes = %d\n", tptr->nVolumes);
166 fprintf(fid, "seq = %d\n", tptr->seq);
167 fprintf(fid, "dump = %d\n", tptr->dump);
168 fprintf(fid, "nextTape = %d\n", tptr->nextTape);
169 fprintf(fid, "firstVol = %d\n", tptr->firstVol);
170 fprintf(fid, "labelPos = %d\n", tptr->labelpos);
171 fprintf(fid, "useCount = %d\n", tptr->useCount);
176 printTapeEntry(struct budb_tapeEntry *teptr)
178 time_t written = teptr->written;
179 time_t expires = teptr->expires;
181 printf("name = %s\n", teptr->name);
182 printf("flags = 0x%x", teptr->flags);
183 if (teptr->flags & BUDB_TAPE_TAPEERROR)
185 if (teptr->flags & BUDB_TAPE_DELETED)
187 if (teptr->flags & BUDB_TAPE_BEINGWRITTEN)
188 printf(": In progress");
189 if (teptr->flags & BUDB_TAPE_ABORTED)
191 if (teptr->flags & BUDB_TAPE_STAGED)
193 if (teptr->flags & BUDB_TAPE_WRITTEN)
194 printf(": Successful");
196 printf("written = %s", ctime(&written));
197 printf("expires = %s", cTIME(&expires));
198 printf("kBytes Tape Used = %u\n", teptr->useKBytes);
199 printf("nMBytes Data = %d\n", teptr->nMBytes);
200 printf("nBytes Data = %d\n", teptr->nBytes);
201 printf("nFiles = %d\n", teptr->nFiles);
202 printf("nVolumes = %d\n", teptr->nVolumes);
203 printf("seq = %d\n", teptr->seq);
204 printf("labelPos = %d\n", teptr->labelpos);
205 printf("useCount = %d\n", teptr->useCount);
206 printf("dump = %d\n", teptr->dump);
211 printTapeSet(struct budb_tapeSet *tsptr,
212 afs_int32 nss) /* is the tapeserver name an accurate name */
214 printf("Group id = %d\n", tsptr->id);
215 printf("tapeServer = %s%s\n", tsptr->tapeServer,
216 (nss ? " (single server)" : ""));
217 printf("format = %s\n", tsptr->format);
218 printf("maxTapes = %d\n", tsptr->maxTapes);
219 /* printf("a = %d\n",tsptr->a ); */
220 /* printf("b = %d\n",tsptr->b); */
221 printf("Start Tape Seq = %d\n", tsptr->b);
226 printVolumeEntry(struct budb_volumeEntry *veptr)
228 time_t clone = veptr->clone;
229 printf("name = %s\n", veptr->name);
230 printf("flags = 0x%x", veptr->flags);
231 if (veptr->flags & BUDB_VOL_TAPEERROR)
232 printf(": Tape Error");
233 if (veptr->flags & BUDB_VOL_FILEERROR)
234 printf(": File Error");
235 if (veptr->flags & BUDB_VOL_BEINGWRITTEN)
236 printf(": In progress");
237 if (veptr->flags & BUDB_VOL_FIRSTFRAG)
238 printf(": First fragment");
239 if (veptr->flags & BUDB_VOL_LASTFRAG)
240 printf(": Last fragment");
241 if (veptr->flags & BUDB_VOL_ABORTED)
244 printf("id = %d\n", veptr->id);
245 printf("server = %s\n", veptr->server);
246 printf("partition = %d\n", veptr->partition);
247 printf("tapeSeq = %d\n", veptr->tapeSeq);
249 printf("position = %d\n", veptr->position);
250 printf("clone = %s", ctime(&clone));
251 printf("startByte = %d\n", veptr->startByte);
252 printf("nBytes = %d\n", veptr->nBytes);
253 printf("seq = %d\n", veptr->seq);
255 printf("dump = %d\n", veptr->dump);
256 printf("tape = %s\n", veptr->tape);
261 printVolFragment(FILE *fid, struct volFragment *vfptr)
263 time_t clone = vfptr->clone;
264 time_t incTime = vfptr->incTime;
265 fprintf(fid, "vol = %d\n", vfptr->vol);
266 fprintf(fid, "sameNameChain = %d\n", vfptr->sameNameChain);
267 fprintf(fid, "tape = %d\n", vfptr->tape);
268 fprintf(fid, "sameTapeChain = %d\n", vfptr->sameTapeChain);
269 fprintf(fid, "position = %d\n", vfptr->position);
270 fprintf(fid, "clone = %s", ctime(&clone));
271 fprintf(fid, "incTime = %s", ctime(&incTime));
272 fprintf(fid, "startByte = %d\n", vfptr->startByte);
273 fprintf(fid, "nBytes = %d\n", vfptr->nBytes);
274 fprintf(fid, "flags = %d\n", vfptr->flags);
275 fprintf(fid, "sequence = %d\n", vfptr->sequence);
280 printVolInfo(FILE *fid, struct volInfo *viptr)
282 fprintf(fid, "name = %s\n", viptr->name);
283 fprintf(fid, "nameHashChain = %d\n", viptr->nameHashChain);
284 fprintf(fid, "id = %d\n", viptr->id);
285 fprintf(fid, "server = %s\n", viptr->server);
286 fprintf(fid, "partition = %d\n", viptr->partition);
287 fprintf(fid, "flags = 0x%x\n", viptr->flags);
288 fprintf(fid, "sameNameHead = %d\n", viptr->sameNameHead);
289 fprintf(fid, "sameNameChain = %d\n", viptr->sameNameChain);
290 fprintf(fid, "firstFragment = %d\n", viptr->firstFragment);
291 fprintf(fid, "nFrags = %d\n", viptr->nFrags);
296 /* -----------------------------------------
297 * structure xdr routines
298 * -----------------------------------------
301 /* utilities - network to host conversion
302 * currently used for debug only
306 volFragment_ntoh(struct volFragment *netVfPtr,
307 struct volFragment *hostVfPtr)
309 hostVfPtr->vol = ntohl(netVfPtr->vol);
310 hostVfPtr->sameNameChain = ntohl(netVfPtr->sameNameChain);
311 hostVfPtr->tape = ntohl(netVfPtr->tape);
312 hostVfPtr->sameTapeChain = ntohl(netVfPtr->sameTapeChain);
313 hostVfPtr->position = ntohl(netVfPtr->position);
314 hostVfPtr->clone = ntohl(netVfPtr->clone);
315 hostVfPtr->incTime = ntohl(netVfPtr->incTime);
316 hostVfPtr->startByte = ntohl(netVfPtr->startByte);
317 hostVfPtr->nBytes = ntohl(netVfPtr->nBytes);
318 hostVfPtr->flags = ntohs(netVfPtr->flags);
319 hostVfPtr->sequence = ntohs(netVfPtr->sequence);
323 volInfo_ntoh(struct volInfo *netViPtr,
324 struct volInfo *hostViPtr)
326 strcpy(hostViPtr->name, netViPtr->name);
327 hostViPtr->nameHashChain = ntohl(netViPtr->nameHashChain);
328 hostViPtr->id = ntohl(netViPtr->id);
329 strcpy(hostViPtr->server, netViPtr->server);
330 hostViPtr->partition = ntohl(netViPtr->partition);
331 hostViPtr->flags = ntohl(netViPtr->flags);
332 hostViPtr->sameNameHead = ntohl(netViPtr->sameNameHead);
333 hostViPtr->sameNameChain = ntohl(netViPtr->sameNameChain);
334 hostViPtr->firstFragment = ntohl(netViPtr->firstFragment);
335 hostViPtr->nFrags = ntohl(netViPtr->nFrags);
339 tape_ntoh(struct tape *netTapePtr,
340 struct tape *hostTapePtr)
342 strcpy(hostTapePtr->name, netTapePtr->name);
343 hostTapePtr->nameHashChain = ntohl(netTapePtr->nameHashChain);
344 hostTapePtr->flags = ntohl(netTapePtr->flags);
346 /* tape id conversion here */
347 hostTapePtr->written = ntohl(netTapePtr->written);
348 hostTapePtr->nMBytes = ntohl(netTapePtr->nMBytes);
349 hostTapePtr->nBytes = ntohl(netTapePtr->nBytes);
350 hostTapePtr->nFiles = ntohl(netTapePtr->nFiles);
351 hostTapePtr->nVolumes = ntohl(netTapePtr->nVolumes);
352 hostTapePtr->seq = ntohl(netTapePtr->seq);
353 hostTapePtr->dump = ntohl(netTapePtr->dump);
354 hostTapePtr->nextTape = ntohl(netTapePtr->nextTape);
355 hostTapePtr->labelpos = ntohl(netTapePtr->labelpos);
356 hostTapePtr->firstVol = ntohl(netTapePtr->firstVol);
357 hostTapePtr->useCount = ntohl(netTapePtr->useCount);
361 dump_ntoh(struct dump *netDumpPtr,
362 struct dump *hostDumpPtr)
364 hostDumpPtr->id = ntohl(netDumpPtr->id);
365 hostDumpPtr->idHashChain = ntohl(netDumpPtr->idHashChain);
366 strlcpy(hostDumpPtr->dumpName, netDumpPtr->dumpName,
367 sizeof(hostDumpPtr->dumpName));
368 strlcpy(hostDumpPtr->dumpPath, netDumpPtr->dumpPath,
369 sizeof(hostDumpPtr->dumpPath));
370 strlcpy(hostDumpPtr->volumeSet, netDumpPtr->volumeSet,
371 sizeof(hostDumpPtr->volumeSet));
372 hostDumpPtr->nameHashChain = ntohl(netDumpPtr->nameHashChain);
373 hostDumpPtr->flags = ntohl(netDumpPtr->flags);
374 hostDumpPtr->parent = ntohl(netDumpPtr->parent);
375 hostDumpPtr->created = ntohl(netDumpPtr->created);
376 hostDumpPtr->nVolumes = ntohl(netDumpPtr->nVolumes);
377 hostDumpPtr->level = ntohl(netDumpPtr->level);
379 tapeSet_ntoh(&netDumpPtr->tapes, &hostDumpPtr->tapes);
381 hostDumpPtr->firstTape = ntohl(netDumpPtr->firstTape);
383 hostDumpPtr->dumper = netDumpPtr->dumper;
387 DbHeader_ntoh(struct DbHeader *netptr,
388 struct DbHeader *hostptr)
390 hostptr->dbversion = ntohl(netptr->dbversion);
391 hostptr->created = ntohl(netptr->created);
392 strcpy(hostptr->cell, netptr->cell);
393 hostptr->lastDumpId = ntohl(netptr->lastDumpId);
394 hostptr->lastInstanceId = ntohl(netptr->lastInstanceId);
395 hostptr->lastTapeId = ntohl(netptr->lastTapeId);
399 dumpEntry_ntoh(struct budb_dumpEntry *netptr,
400 struct budb_dumpEntry *hostptr)
402 hostptr->id = ntohl(netptr->id);
403 hostptr->initialDumpID = ntohl(netptr->initialDumpID);
404 hostptr->appendedDumpID = ntohl(netptr->appendedDumpID);
405 hostptr->parent = ntohl(netptr->parent);
406 hostptr->level = ntohl(netptr->level);
407 hostptr->flags = ntohl(netptr->flags);
408 strcpy(hostptr->volumeSetName, netptr->volumeSetName);
409 strcpy(hostptr->dumpPath, netptr->dumpPath);
410 strcpy(hostptr->name, netptr->name);
411 hostptr->created = ntohl(netptr->created);
412 hostptr->incTime = ntohl(netptr->incTime);
413 hostptr->nVolumes = ntohl(netptr->nVolumes);
415 tapeSet_ntoh(&netptr->tapes, &hostptr->tapes);
416 principal_ntoh(&netptr->dumper, &hostptr->dumper);
420 principal_hton(struct budb_principal *hostptr,
421 struct budb_principal *netptr)
423 strcpy(netptr->name, hostptr->name);
424 strcpy(netptr->instance, hostptr->instance);
425 strcpy(netptr->cell, hostptr->cell);
429 principal_ntoh(struct budb_principal *netptr,
430 struct budb_principal *hostptr)
432 strcpy(hostptr->name, netptr->name);
433 strcpy(hostptr->instance, netptr->instance);
434 strcpy(hostptr->cell, netptr->cell);
438 structDumpHeader_hton(struct structDumpHeader *hostPtr,
439 struct structDumpHeader *netPtr)
441 netPtr->type = htonl(hostPtr->type);
442 netPtr->structversion = htonl(hostPtr->structversion);
443 netPtr->size = htonl(hostPtr->size);
447 structDumpHeader_ntoh(struct structDumpHeader *netPtr,
448 struct structDumpHeader *hostPtr)
450 hostPtr->type = ntohl(netPtr->type);
451 hostPtr->structversion = ntohl(netPtr->structversion);
452 hostPtr->size = ntohl(netPtr->size);
456 tapeEntry_ntoh(struct budb_tapeEntry *netptr,
457 struct budb_tapeEntry *hostptr)
459 strcpy(hostptr->name, netptr->name);
460 hostptr->flags = ntohl(netptr->flags);
461 hostptr->written = ntohl(netptr->written);
462 hostptr->expires = ntohl(netptr->expires);
463 hostptr->nMBytes = ntohl(netptr->nMBytes);
464 hostptr->nBytes = ntohl(netptr->nBytes);
465 hostptr->nFiles = ntohl(netptr->nFiles);
466 hostptr->nVolumes = ntohl(netptr->nVolumes);
467 hostptr->seq = ntohl(netptr->seq);
468 hostptr->labelpos = ntohl(netptr->labelpos);
469 hostptr->useCount = ntohl(netptr->useCount);
470 hostptr->useKBytes = ntohl(netptr->useKBytes);
471 hostptr->dump = ntohl(netptr->dump);
475 tapeSet_hton(struct budb_tapeSet *hostptr,
476 struct budb_tapeSet *netptr)
478 netptr->id = htonl(hostptr->id);
479 strcpy(netptr->tapeServer, hostptr->tapeServer);
480 strcpy(netptr->format, hostptr->format);
481 netptr->maxTapes = htonl(hostptr->maxTapes);
482 netptr->a = htonl(hostptr->a);
483 netptr->b = htonl(hostptr->b);
488 tapeSet_ntoh(struct budb_tapeSet *netptr,
489 struct budb_tapeSet *hostptr)
491 hostptr->id = ntohl(netptr->id);
492 strcpy(hostptr->tapeServer, netptr->tapeServer);
493 strcpy(hostptr->format, netptr->format);
494 hostptr->maxTapes = ntohl(netptr->maxTapes);
495 hostptr->a = ntohl(netptr->a);
496 hostptr->b = ntohl(netptr->b);
501 textBlock_hton(struct textBlock *hostptr,
502 struct textBlock *netptr)
504 netptr->version = htonl(hostptr->version);
505 netptr->size = htonl(hostptr->size);
506 netptr->textAddr = htonl(hostptr->textAddr);
507 netptr->newsize = htonl(hostptr->newsize);
508 netptr->newTextAddr = htonl(hostptr->newTextAddr);
512 textBlock_ntoh(struct textBlock *netptr,
513 struct textBlock *hostptr)
515 hostptr->version = ntohl(netptr->version);
516 hostptr->size = ntohl(netptr->size);
517 hostptr->textAddr = ntohl(netptr->textAddr);
518 hostptr->newsize = ntohl(netptr->newsize);
519 hostptr->newTextAddr = ntohl(netptr->newTextAddr);
523 textLock_hton(db_lockP hostptr, db_lockP netptr)
525 netptr->type = htonl(hostptr->type);
526 netptr->lockState = htonl(hostptr->lockState);
527 netptr->lockTime = htonl(hostptr->lockTime);
528 netptr->expires = htonl(hostptr->expires);
529 netptr->instanceId = htonl(hostptr->instanceId);
530 netptr->lockHost = htonl(hostptr->lockHost);
534 textLock_ntoh(db_lockP netptr, db_lockP hostptr)
536 hostptr->type = ntohl(netptr->type);
537 hostptr->lockState = ntohl(netptr->lockState);
538 hostptr->lockTime = ntohl(netptr->lockTime);
539 hostptr->expires = ntohl(netptr->expires);
540 hostptr->instanceId = ntohl(netptr->instanceId);
541 hostptr->lockHost = ntohl(netptr->lockHost);
545 volumeEntry_ntoh(struct budb_volumeEntry *netptr,
546 struct budb_volumeEntry *hostptr)
548 strcpy(hostptr->name, netptr->name);
549 hostptr->flags = ntohl(netptr->flags);
550 hostptr->id = ntohl(netptr->id);
551 strcpy(hostptr->server, netptr->server);
552 hostptr->partition = ntohl(netptr->partition);
553 hostptr->tapeSeq = ntohl(netptr->tapeSeq);
555 hostptr->position = ntohl(netptr->position);
556 hostptr->clone = ntohl(netptr->clone);
557 hostptr->incTime = ntohl(netptr->incTime);
558 hostptr->startByte = ntohl(netptr->startByte);
559 hostptr->nBytes = ntohl(netptr->nBytes);
560 hostptr->seq = ntohl(netptr->seq);
562 hostptr->dump = ntohl(netptr->dump);
563 strcpy(hostptr->tape, netptr->tape);
566 /* -------------------------------------
567 * structure conversion & copy routines
568 * -------------------------------------
572 copy_ktcPrincipal_to_budbPrincipal(struct ktc_principal *ktcPtr,
573 struct budb_principal *budbPtr)
575 strncpy(budbPtr->name, ktcPtr->name, sizeof(budbPtr->name));
576 strncpy(budbPtr->instance, ktcPtr->instance, sizeof(budbPtr->instance));
577 strncpy(budbPtr->cell, ktcPtr->cell, sizeof(budbPtr->cell));
582 * dumpPtr - host format
586 dumpToBudbDump(dbDumpP dumpPtr, struct budb_dumpEntry *budbDumpPtr)
588 budbDumpPtr->id = dumpPtr->id;
589 budbDumpPtr->initialDumpID = dumpPtr->initialDumpID;
590 budbDumpPtr->parent = dumpPtr->parent;
591 budbDumpPtr->level = dumpPtr->level;
592 budbDumpPtr->flags = dumpPtr->flags;
594 strcpy(budbDumpPtr->volumeSetName, dumpPtr->volumeSet);
595 strcpy(budbDumpPtr->dumpPath, dumpPtr->dumpPath);
596 strcpy(budbDumpPtr->name, dumpPtr->dumpName);
598 budbDumpPtr->created = dumpPtr->created;
599 budbDumpPtr->nVolumes = dumpPtr->nVolumes;
601 memcpy(&budbDumpPtr->tapes, &dumpPtr->tapes, sizeof(struct budb_tapeSet));
602 copy_ktcPrincipal_to_budbPrincipal(&dumpPtr->dumper,
603 &budbDumpPtr->dumper);
608 tapeToBudbTape(struct tape *tapePtr, struct budb_tapeEntry *budbTapePtr)
610 strcpy(budbTapePtr->name, tapePtr->name);
611 budbTapePtr->flags = tapePtr->flags;
612 budbTapePtr->written = tapePtr->written;
613 budbTapePtr->expires = tapePtr->expires;
614 budbTapePtr->nMBytes = tapePtr->nMBytes;
615 budbTapePtr->nBytes = tapePtr->nBytes;
616 budbTapePtr->nFiles = tapePtr->nFiles;
617 budbTapePtr->nVolumes = tapePtr->nVolumes;
618 budbTapePtr->seq = tapePtr->seq;
619 budbTapePtr->labelpos = tapePtr->labelpos;
620 budbTapePtr->useCount = tapePtr->useCount;
621 budbTapePtr->useKBytes = tapePtr->useKBytes;
626 volsToBudbVol(struct volFragment *volFragPtr, struct volInfo *volInfoPtr,
627 struct budb_volumeEntry *budbVolPtr)
629 strcpy(budbVolPtr->name, volInfoPtr->name);
630 budbVolPtr->flags = volInfoPtr->flags;
631 budbVolPtr->id = volInfoPtr->id;
632 strcpy(budbVolPtr->server, volInfoPtr->server);
633 budbVolPtr->partition = volInfoPtr->partition;
634 budbVolPtr->tapeSeq = 0; /* Don't know it so mark invalid */
636 budbVolPtr->position = volFragPtr->position;
637 budbVolPtr->clone = volFragPtr->clone;
638 budbVolPtr->incTime = volFragPtr->incTime;
639 budbVolPtr->startByte = volFragPtr->startByte;
640 budbVolPtr->nBytes = volFragPtr->nBytes;
641 budbVolPtr->seq = volFragPtr->sequence;
645 /* ----------------------------------
646 * structure initialization routines
647 * ---------------------------------
651 * this fills in the tape set with the current default tapeset
654 * dumpname - volset.dumplevel
661 default_tapeset(struct budb_tapeSet *tapesetPtr, char *dumpname)
663 memset(tapesetPtr, 0, sizeof(*tapesetPtr));
665 strcpy(tapesetPtr->format, dumpname);
666 strcat(tapesetPtr->format, ".%d");
669 tapesetPtr->maxTapes = 0;