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 <afs/param.h>
11 #include <afsconfig.h>
19 #include <netinet/in.h>
22 #include <sys/types.h>
24 #include <afs/bubasics.h>
29 #include "budb_errs.h"
33 /* ----------------------------------
34 * structure printing utilities
35 * ----------------------------------
41 printf("version = %d\n", ptr->dbversion);
42 printf("created = %s", ctime((time_t *)&ptr->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);
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((time_t *)&dptr->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 struct budb_dumpEntry *deptr;
72 printf("id = %u\n", deptr->id);
73 printf("Initial id = %u\n", deptr->initialDumpID);
74 printf("Appended id = %u\n", deptr->appendedDumpID);
75 printf("parent = %u\n", deptr->parent);
76 printf("level = %d\n", deptr->level);
77 printf("flags = 0x%x", deptr->flags);
78 if (deptr->flags == 0) printf(": Successful");
79 if (deptr->flags & BUDB_DUMP_INCOMPLETE) printf(": Incomplete");
80 if (deptr->flags & BUDB_DUMP_TAPEERROR) printf(": Tape error");
81 if (deptr->flags & BUDB_DUMP_INPROGRESS) printf(": In progress");
82 if (deptr->flags & BUDB_DUMP_ABORTED) printf(": Aborted");
83 if (deptr->flags & BUDB_DUMP_ADSM) printf(": (ADSM)"); /* XBSA interface to ADSM */
84 if (deptr->flags & BUDB_DUMP_BUTA) printf(": (BUTA)"); /* buta dump */
86 printf("volumeSet = %s\n", deptr->volumeSetName);
87 printf("dump path = %s\n", deptr->dumpPath);
88 printf("name = %s\n", deptr->name);
89 printf("created = %s", ctime((time_t *)&deptr->created));
90 printf("nVolumes = %d\n", deptr->nVolumes);
92 printTapeSet(&deptr->tapes, (deptr->flags & BUDB_DUMP_XBSA_NSS));
93 printPrincipal(&deptr->dumper);
97 * print the hash table structure, i.e. the header structure.
100 printHashTable(fid, htptr)
102 struct hashTable *htptr;
104 fprintf(fid,"functionType = %d\n", htptr->functionType);
105 fprintf(fid,"threadOffset = %d\n", htptr->threadOffset);
106 fprintf(fid,"entries = %d\n", htptr->entries);
107 fprintf(fid,"length = %d\n", htptr->length);
108 fprintf(fid,"table = %d\n", htptr->table);
109 fprintf(fid,"progress = %d\n", htptr->progress);
110 fprintf(fid,"oldLength = %d\n", htptr->oldLength);
111 fprintf(fid,"oldTable = %d\n", htptr->oldTable);
114 /* printMemoryHashTable
115 * print the hash table structure, i.e. the header structure.
117 printMemoryHashTable(fid, mhtptr)
119 struct memoryHashTable *mhtptr;
121 fprintf(fid,"threadOffset = %d\n", mhtptr->threadOffset);
122 fprintf(fid,"length = %d\n", mhtptr->length);
123 fprintf(fid,"progress = %d\n", mhtptr->progress);
124 fprintf(fid,"size = %d\n", mhtptr->size);
125 fprintf(fid,"oldsize = %d\n", mhtptr->oldSize);
129 struct ktc_principal *ptr;
131 printf("name = %s\n", ptr->name);
132 printf("instance = %s\n", ptr->instance);
133 printf("cell = %s\n", ptr->cell);
136 printStructDumpHeader(ptr)
137 struct structDumpHeader *ptr;
139 printf("type = %d\n", ptr->type);
140 printf("structure version = %d\n", ptr->structversion);
141 printf("size = %d bytes\n", ptr->size);
148 fprintf(fid,"name = %s\n", tptr->name);
149 fprintf(fid,"nameHashChain = %d\n", tptr->nameHashChain);
150 fprintf(fid,"flags = 0x%x\n", tptr->flags);
151 fprintf(fid,"written = %s", ctime((time_t *)&tptr->written));
152 fprintf(fid,"nMBytes = %d\n", tptr->nMBytes);
153 fprintf(fid,"nBytes = %d\n", tptr->nBytes);
154 fprintf(fid,"nFiles = %d\n", tptr->nFiles);
155 fprintf(fid,"nVolumes = %d\n", tptr->nVolumes);
156 fprintf(fid,"seq = %d\n", tptr->seq);
157 fprintf(fid,"dump = %d\n", tptr->dump);
158 fprintf(fid,"nextTape = %d\n", tptr->nextTape);
159 fprintf(fid,"firstVol = %d\n", tptr->firstVol);
160 fprintf(fid,"labelPos = %d\n", tptr->labelpos);
161 fprintf(fid,"useCount = %d\n", tptr->useCount);
164 printTapeEntry(teptr)
165 struct budb_tapeEntry *teptr;
167 printf("name = %s\n", teptr->name);
168 printf("flags = 0x%x", teptr->flags);
169 if (teptr->flags & BUDB_TAPE_TAPEERROR) printf(": Error");
170 if (teptr->flags & BUDB_TAPE_DELETED) printf(": Deleted");
171 if (teptr->flags & BUDB_TAPE_BEINGWRITTEN) printf(": In progress");
172 if (teptr->flags & BUDB_TAPE_ABORTED) printf(": Aborted");
173 if (teptr->flags & BUDB_TAPE_STAGED) printf(": Staged");
174 if (teptr->flags & BUDB_TAPE_WRITTEN) printf(": Successful");
176 printf("written = %s", ctime((time_t *)&teptr->written));
177 printf("expires = %s", cTIME((time_t *)&teptr->expires));
178 printf("kBytes Tape Used = %u\n", teptr->useKBytes);
179 printf("nMBytes Data = %d\n", teptr->nMBytes);
180 printf("nBytes Data = %d\n", teptr->nBytes);
181 printf("nFiles = %d\n", teptr->nFiles);
182 printf("nVolumes = %d\n", teptr->nVolumes);
183 printf("seq = %d\n", teptr->seq);
184 printf("labelPos = %d\n", teptr->labelpos);
185 printf("useCount = %d\n", teptr->useCount);
186 printf("dump = %d\n", teptr->dump);
189 printTapeSet(tsptr, nss)
190 struct budb_tapeSet *tsptr;
191 afs_int32 nss; /* is the tapeserver name an accurate name */
193 printf("Group id = %d\n",tsptr->id );
194 printf("tapeServer = %s%s\n",
195 tsptr->tapeServer, (nss?" (single server)":""));
196 printf("format = %s\n",tsptr->format);
197 printf("maxTapes = %d\n",tsptr->maxTapes);
198 /* printf("a = %d\n",tsptr->a ); */
199 /* printf("b = %d\n",tsptr->b); */
200 printf("Start Tape Seq = %d\n",tsptr->b);
203 printVolumeEntry(veptr)
204 struct budb_volumeEntry *veptr;
206 printf("name = %s\n", veptr->name);
207 printf("flags = 0x%x", veptr->flags);
208 if (veptr->flags & BUDB_VOL_TAPEERROR) printf(": Tape Error");
209 if (veptr->flags & BUDB_VOL_FILEERROR) printf(": File Error");
210 if (veptr->flags & BUDB_VOL_BEINGWRITTEN) printf(": In progress");
211 if (veptr->flags & BUDB_VOL_FIRSTFRAG) printf(": First fragment");
212 if (veptr->flags & BUDB_VOL_LASTFRAG) printf(": Last fragment");
213 if (veptr->flags & BUDB_VOL_ABORTED) printf(": Aborted");
215 printf("id = %d\n", veptr->id);
216 printf("server = %s\n", veptr->server);
217 printf("partition = %d\n", veptr->partition);
218 printf("tapeSeq = %d\n", veptr->tapeSeq);
220 printf("position = %d\n", veptr->position);
221 printf("clone = %s", ctime((time_t *)&veptr->clone));
222 printf("startByte = %d\n", veptr->startByte);
223 printf("nBytes = %d\n", veptr->nBytes);
224 printf("seq = %d\n", veptr->seq);
226 printf("dump = %d\n", veptr->dump);
227 printf("tape = %s\n", veptr->tape);
230 printVolFragment(fid, vfptr)
232 struct volFragment *vfptr;
234 fprintf(fid,"vol = %d\n", vfptr->vol);
235 fprintf(fid,"sameNameChain = %d\n", vfptr->sameNameChain);
236 fprintf(fid,"tape = %d\n", vfptr->tape);
237 fprintf(fid,"sameTapeChain = %d\n", vfptr->sameTapeChain);
238 fprintf(fid,"position = %d\n", vfptr->position);
239 fprintf(fid,"clone = %s", ctime((time_t *)&vfptr->clone));
240 fprintf(fid,"incTime = %s", ctime((time_t *)&vfptr->incTime));
241 fprintf(fid,"startByte = %d\n", vfptr->startByte);
242 fprintf(fid,"nBytes = %d\n", vfptr->nBytes);
243 fprintf(fid,"flags = %d\n", vfptr->flags);
244 fprintf(fid,"sequence = %d\n", vfptr->sequence);
247 printVolInfo(fid, viptr)
249 struct volInfo *viptr;
251 fprintf(fid,"name = %s\n", viptr->name);
252 fprintf(fid,"nameHashChain = %d\n", viptr->nameHashChain);
253 fprintf(fid,"id = %d\n", viptr->id);
254 fprintf(fid,"server = %s\n", viptr->server);
255 fprintf(fid,"partition = %d\n", viptr->partition);
256 fprintf(fid,"flags = 0x%x\n", viptr->flags);
257 fprintf(fid,"sameNameHead = %d\n", viptr->sameNameHead);
258 fprintf(fid,"sameNameChain = %d\n", viptr->sameNameChain);
259 fprintf(fid,"firstFragment = %d\n", viptr->firstFragment);
260 fprintf(fid,"nFrags = %d\n", viptr->nFrags);
264 /* -----------------------------------------
265 * structure xdr routines
266 * -----------------------------------------
269 /* utilities - network to host conversion
270 * currently used for debug only
273 volFragment_ntoh(netVfPtr, hostVfPtr)
274 struct volFragment *netVfPtr, *hostVfPtr;
276 hostVfPtr->vol = ntohl(netVfPtr->vol);
277 hostVfPtr->sameNameChain = ntohl(netVfPtr->sameNameChain);
278 hostVfPtr->tape = ntohl(netVfPtr->tape);
279 hostVfPtr->sameTapeChain = ntohl(netVfPtr->sameTapeChain);
280 hostVfPtr->position = ntohl(netVfPtr->position);
281 hostVfPtr->clone = ntohl(netVfPtr->clone);
282 hostVfPtr->incTime = ntohl(netVfPtr->incTime);
283 hostVfPtr->startByte = ntohl(netVfPtr->startByte);
284 hostVfPtr->nBytes = ntohl(netVfPtr->nBytes);
285 hostVfPtr->flags = ntohs(netVfPtr->flags);
286 hostVfPtr->sequence = ntohs(netVfPtr->sequence);
289 volInfo_ntoh(netViPtr, hostViPtr)
290 struct volInfo *netViPtr, *hostViPtr;
292 strcpy(hostViPtr->name, netViPtr->name);
293 hostViPtr->nameHashChain = ntohl(netViPtr->nameHashChain);
294 hostViPtr->id = ntohl(netViPtr->id);
295 strcpy(hostViPtr->server, netViPtr->server);
296 hostViPtr->partition = ntohl(netViPtr->partition);
297 hostViPtr->flags = ntohl(netViPtr->flags);
298 hostViPtr->sameNameHead = ntohl(netViPtr->sameNameHead);
299 hostViPtr->sameNameChain = ntohl(netViPtr->sameNameChain);
300 hostViPtr->firstFragment = ntohl(netViPtr->firstFragment);
301 hostViPtr->nFrags = ntohl(netViPtr->nFrags);
304 tape_ntoh(netTapePtr, hostTapePtr)
305 struct tape *netTapePtr, *hostTapePtr;
307 strcpy(hostTapePtr->name, netTapePtr->name);
308 hostTapePtr->nameHashChain = ntohl(netTapePtr->nameHashChain);
309 hostTapePtr->flags = ntohl(netTapePtr->flags);
311 /* tape id conversion here */
312 hostTapePtr->written = ntohl(netTapePtr->written);
313 hostTapePtr->nMBytes = ntohl(netTapePtr->nMBytes);
314 hostTapePtr->nBytes = ntohl(netTapePtr->nBytes);
315 hostTapePtr->nFiles = ntohl(netTapePtr->nFiles);
316 hostTapePtr->nVolumes = ntohl(netTapePtr->nVolumes);
317 hostTapePtr->seq = ntohl(netTapePtr->seq);
318 hostTapePtr->dump = ntohl(netTapePtr->dump);
319 hostTapePtr->nextTape = ntohl(netTapePtr->nextTape);
320 hostTapePtr->labelpos = ntohl(netTapePtr->labelpos);
321 hostTapePtr->firstVol = ntohl(netTapePtr->firstVol);
322 hostTapePtr->useCount = ntohl(netTapePtr->useCount);
325 dump_ntoh(netDumpPtr, hostDumpPtr)
326 struct dump *netDumpPtr, *hostDumpPtr;
328 hostDumpPtr->id = ntohl(netDumpPtr->id);
329 hostDumpPtr->idHashChain = ntohl(netDumpPtr->idHashChain);
330 strcpy(hostDumpPtr->dumpName, netDumpPtr->dumpName);
331 strcpy(hostDumpPtr->dumpPath, netDumpPtr->dumpPath);
332 strcpy(hostDumpPtr->volumeSet, netDumpPtr->volumeSet);
333 hostDumpPtr->nameHashChain = ntohl(netDumpPtr->nameHashChain);
334 hostDumpPtr->flags = ntohl(netDumpPtr->flags);
335 hostDumpPtr->parent = ntohl(netDumpPtr->parent);
336 hostDumpPtr->created = ntohl(netDumpPtr->created);
337 hostDumpPtr->nVolumes = ntohl(netDumpPtr->nVolumes);
338 hostDumpPtr->level = ntohl(netDumpPtr->level);
340 tapeSet_ntoh(&netDumpPtr->tapes, &hostDumpPtr->tapes);
342 hostDumpPtr->firstTape = ntohl(netDumpPtr->firstTape);
344 principal_ntoh(&netDumpPtr->dumper, &hostDumpPtr->dumper);
347 DbHeader_ntoh(netptr, hostptr)
348 struct DbHeader *netptr, *hostptr;
350 hostptr->dbversion = ntohl(netptr->dbversion);
351 hostptr->created = ntohl(netptr->created);
352 strcpy(hostptr->cell, netptr->cell);
353 hostptr->lastDumpId = ntohl(netptr->lastDumpId);
354 hostptr->lastInstanceId = ntohl(netptr->lastInstanceId);
355 hostptr->lastTapeId = ntohl(netptr->lastTapeId);
358 dumpEntry_ntoh(netptr, hostptr)
359 struct budb_dumpEntry *netptr, *hostptr;
361 hostptr->id = ntohl(netptr->id);
362 hostptr->initialDumpID = ntohl(netptr->initialDumpID);
363 hostptr->appendedDumpID = ntohl(netptr->appendedDumpID);
364 hostptr->parent = ntohl(netptr->parent);
365 hostptr->level = ntohl(netptr->level);
366 hostptr->flags = ntohl(netptr->flags);
367 strcpy(hostptr->volumeSetName, netptr->volumeSetName);
368 strcpy(hostptr->dumpPath, netptr->dumpPath);
369 strcpy(hostptr->name, netptr->name);
370 hostptr->created = ntohl(netptr->created);
371 hostptr->incTime = ntohl(netptr->incTime);
372 hostptr->nVolumes = ntohl(netptr->nVolumes);
374 tapeSet_ntoh(&netptr->tapes, &hostptr->tapes);
375 principal_ntoh(&netptr->dumper, &hostptr->dumper);
378 principal_hton(hostptr, netptr)
379 struct ktc_principal *hostptr, *netptr;
381 strcpy(netptr->name, hostptr->name);
382 strcpy(netptr->instance, hostptr->instance);
383 strcpy(netptr->cell, hostptr->cell);
386 principal_ntoh(netptr, hostptr)
387 struct ktc_principal *netptr, *hostptr;
389 strcpy(hostptr->name, netptr->name);
390 strcpy(hostptr->instance, netptr->instance);
391 strcpy(hostptr->cell, netptr->cell);
394 structDumpHeader_hton(hostPtr, netPtr)
395 struct structDumpHeader *hostPtr, *netPtr;
397 netPtr->type = htonl(hostPtr->type);
398 netPtr->structversion = htonl(hostPtr->structversion);
399 netPtr->size = htonl(hostPtr->size);
402 structDumpHeader_ntoh(netPtr, hostPtr)
403 struct structDumpHeader *hostPtr, *netPtr;
405 hostPtr->type = ntohl(netPtr->type);
406 hostPtr->structversion = ntohl(netPtr->structversion);
407 hostPtr->size = ntohl(netPtr->size);
410 tapeEntry_ntoh(netptr, hostptr)
411 struct budb_tapeEntry *netptr, *hostptr;
413 strcpy(hostptr->name, netptr->name);
414 hostptr->flags = ntohl(netptr->flags);
415 hostptr->written = ntohl(netptr->written);
416 hostptr->expires = ntohl(netptr->expires);
417 hostptr->nMBytes = ntohl(netptr->nMBytes);
418 hostptr->nBytes = ntohl(netptr->nBytes);
419 hostptr->nFiles = ntohl(netptr->nFiles);
420 hostptr->nVolumes = ntohl(netptr->nVolumes);
421 hostptr->seq = ntohl(netptr->seq);
422 hostptr->labelpos = ntohl(netptr->labelpos);
423 hostptr->useCount = ntohl(netptr->useCount);
424 hostptr->useKBytes = ntohl(netptr->useKBytes);
425 hostptr->dump = ntohl(netptr->dump);
428 tapeSet_hton(hostptr, netptr)
429 struct budb_tapeSet *hostptr, *netptr;
431 netptr->id = htonl(hostptr->id);
432 strcpy(netptr->tapeServer, hostptr->tapeServer);
433 strcpy(netptr->format, hostptr->format);
434 netptr->maxTapes = htonl(hostptr->maxTapes);
435 netptr->a = htonl(hostptr->a);
436 netptr->b = htonl(hostptr->b);
439 tapeSet_ntoh(netptr, hostptr)
440 struct budb_tapeSet *netptr, *hostptr;
442 hostptr->id = ntohl(netptr->id);
443 strcpy(hostptr->tapeServer, netptr->tapeServer);
444 strcpy(hostptr->format, netptr->format);
445 hostptr->maxTapes = ntohl(netptr->maxTapes);
446 hostptr->a = ntohl(netptr->a);
447 hostptr->b = ntohl(netptr->b);
450 textBlock_hton(hostptr, netptr)
451 struct textBlock *hostptr, *netptr;
453 netptr->version = htonl(hostptr->version);
454 netptr->size = htonl(hostptr->size);
455 netptr->textAddr = htonl(hostptr->textAddr);
456 netptr->newsize = htonl(hostptr->newsize);
457 netptr->newTextAddr = htonl(hostptr->newTextAddr);
460 textBlock_ntoh(netptr, hostptr)
461 struct textBlock *netptr, *hostptr;
463 hostptr->version = ntohl(netptr->version);
464 hostptr->size = ntohl(netptr->size);
465 hostptr->textAddr = ntohl(netptr->textAddr);
466 hostptr->newsize = ntohl(netptr->newsize);
467 hostptr->newTextAddr = ntohl(netptr->newTextAddr);
470 textLock_hton(hostptr, netptr)
471 db_lockP hostptr, netptr;
473 netptr->type = htonl(hostptr->type);
474 netptr->lockState = htonl(hostptr->lockState);
475 netptr->lockTime = htonl(hostptr->lockTime);
476 netptr->expires = htonl(hostptr->expires);
477 netptr->instanceId = htonl(hostptr->instanceId);
478 netptr->lockHost = htonl(hostptr->lockHost);
481 textLock_ntoh(netptr, hostptr)
482 db_lockP netptr, hostptr;
484 hostptr->type = ntohl(netptr->type);
485 hostptr->lockState = ntohl(netptr->lockState);
486 hostptr->lockTime = ntohl(netptr->lockTime);
487 hostptr->expires = ntohl(netptr->expires);
488 hostptr->instanceId = ntohl(netptr->instanceId);
489 hostptr->lockHost = ntohl(netptr->lockHost);
492 volumeEntry_ntoh(netptr, hostptr)
493 struct budb_volumeEntry *netptr, *hostptr;
495 strcpy(hostptr->name, netptr->name);
496 hostptr->flags = ntohl(netptr->flags);
497 hostptr->id = ntohl(netptr->id);
498 strcpy(hostptr->server, netptr->server);
499 hostptr->partition = ntohl(netptr->partition);
500 hostptr->tapeSeq = ntohl(netptr->tapeSeq);
502 hostptr->position = ntohl(netptr->position);
503 hostptr->clone = ntohl(netptr->clone);
504 hostptr->incTime = ntohl(netptr->incTime);
505 hostptr->startByte = ntohl(netptr->startByte);
506 hostptr->nBytes = ntohl(netptr->nBytes);
507 hostptr->seq = ntohl(netptr->seq);
509 hostptr->dump = ntohl(netptr->dump);
510 strcpy(hostptr->tape, netptr->tape);
513 /* -------------------------------------
514 * structure conversion & copy routines
515 * -------------------------------------
519 copy_ktcPrincipal_to_budbPrincipal(ktcPtr, budbPtr)
520 struct ktc_principal *ktcPtr;
521 struct budb_principal *budbPtr;
523 strncpy(budbPtr->name, ktcPtr->name, sizeof(budbPtr->name));
524 strncpy(budbPtr->instance, ktcPtr->instance, sizeof(budbPtr->instance));
525 strncpy(budbPtr->cell, ktcPtr->cell, sizeof(budbPtr->cell));
530 * dumpPtr - host format
533 dumpToBudbDump(dumpPtr, budbDumpPtr)
535 struct budb_dumpEntry *budbDumpPtr;
537 budbDumpPtr->id = dumpPtr->id;
538 budbDumpPtr->initialDumpID = dumpPtr->initialDumpID;
539 budbDumpPtr->parent = dumpPtr->parent;
540 budbDumpPtr->level = dumpPtr->level;
541 budbDumpPtr->flags = dumpPtr->flags;
543 strcpy(budbDumpPtr->volumeSetName, dumpPtr->volumeSet);
544 strcpy(budbDumpPtr->dumpPath, dumpPtr->dumpPath);
545 strcpy(budbDumpPtr->name, dumpPtr->dumpName);
547 budbDumpPtr->created = dumpPtr->created;
548 budbDumpPtr->nVolumes = dumpPtr->nVolumes;
550 bcopy(&dumpPtr->tapes, &budbDumpPtr->tapes, sizeof(struct budb_tapeSet));
551 copy_ktcPrincipal_to_budbPrincipal(&dumpPtr->dumper, &budbDumpPtr->dumper);
555 tapeToBudbTape(tapePtr, budbTapePtr)
556 struct tape *tapePtr;
557 struct budb_tapeEntry *budbTapePtr;
559 strcpy(budbTapePtr->name, tapePtr->name);
560 budbTapePtr->flags = tapePtr->flags;
561 budbTapePtr->written = tapePtr->written;
562 budbTapePtr->expires = tapePtr->expires;
563 budbTapePtr->nMBytes = tapePtr->nMBytes;
564 budbTapePtr->nBytes = tapePtr->nBytes;
565 budbTapePtr->nFiles = tapePtr->nFiles;
566 budbTapePtr->nVolumes = tapePtr->nVolumes;
567 budbTapePtr->seq = tapePtr->seq;
568 budbTapePtr->labelpos = tapePtr->labelpos;
569 budbTapePtr->useCount = tapePtr->useCount;
570 budbTapePtr->useKBytes = tapePtr->useKBytes;
574 volsToBudbVol(volFragPtr, volInfoPtr, budbVolPtr)
575 struct volFragment *volFragPtr;
576 struct volInfo *volInfoPtr;
577 struct budb_volumeEntry *budbVolPtr;
579 strcpy(budbVolPtr->name, volInfoPtr->name);
580 budbVolPtr->flags = volInfoPtr->flags;
581 budbVolPtr->id = volInfoPtr->id;
582 strcpy(budbVolPtr->server, volInfoPtr->server);
583 budbVolPtr->partition = volInfoPtr->partition;
584 budbVolPtr->tapeSeq = 0; /* Don't know it so mark invalid */
586 budbVolPtr->position = volFragPtr->position;
587 budbVolPtr->clone = volFragPtr->clone;
588 budbVolPtr->incTime = volFragPtr->incTime;
589 budbVolPtr->startByte = volFragPtr->startByte;
590 budbVolPtr->nBytes = volFragPtr->nBytes;
591 budbVolPtr->seq = volFragPtr->sequence;
595 /* ----------------------------------
596 * structure initialization routines
597 * ---------------------------------
601 * this fills in the tape set with the current default tapeset
604 * dumpname - volset.dumplevel
610 default_tapeset(tapesetPtr, dumpname)
611 struct budb_tapeSet *tapesetPtr;
614 bzero(tapesetPtr, sizeof(*tapesetPtr));
616 strcpy(tapesetPtr->format, dumpname);
617 strcat(tapesetPtr->format, ".%d");
620 tapesetPtr->maxTapes = 0;