3 * dumpscan - routines for scanning and manipulating AFS volume dumps
5 * Copyright (c) 1998 Carnegie Mellon University
8 * Permission to use, copy, modify and distribute this software and its
9 * documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation.
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
16 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 * Carnegie Mellon requests users of this software to return to
20 * Software Distribution Coordinator or Software_Distribution@CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
25 * any improvements or extensions that they make and grant Carnegie Mellon
26 * the rights to redistribute these changes.
29 /* backuphdr.c - Parse and print backup system headers */
34 #include "dumpscan_errs.h"
38 try_backuphdr(XFILE
* X
, char *tag
, tagged_field
* field
, afs_uint32 value
,
39 tag_parse_info
* pi
, void *g_refcon
, void *l_refcon
)
41 dump_parser
*p
= (dump_parser
*) g_refcon
;
42 backup_system_header bh
;
46 /* Which header should we try (if any)? */
49 r
= ParseStageHdr(X
, (unsigned char *)tag
, &bh
);
57 /* Do something with it... */
58 if (p
->print_flags
& DSPRINT_BCKHDR
)
61 r
= xftell(X
, &where
);
62 if (!r
&& p
->cb_bckhdr
)
63 r
= (p
->cb_bckhdr
) (&bh
, X
, p
->refcon
);
64 if (p
->flags
& DSFLAG_SEEK
) {
66 r
= xfseek(X
, &where
);
82 PrintBackupHdr(backup_system_header
* hdr
)
84 time_t from
= hdr
->from_date
, to
= hdr
->to_date
, dd
= hdr
->dump_date
;
86 printf("* BACKUP SYSTEM HEADER\n");
87 printf(" Version: %d\n", hdr
->version
);
88 printf(" Volume: %s (%d)\n", hdr
->volname
, hdr
->volid
);
89 printf(" Location: %s %s\n", hdr
->server
, hdr
->part
);
90 printf(" Level: %d\n", hdr
->level
);
91 printf(" Range: %d => %d\n", hdr
->from_date
, hdr
->to_date
);
92 printf(" == %s", ctime(&from
));
93 printf(" => %s", ctime(&to
));
94 printf(" Dump Time: %d == %s", hdr
->dump_date
, ctime(&dd
));
95 printf(" Dump Flags: 0x%08x\n", hdr
->flags
);
97 printf(" Length: %llu\n", hdr
->dumplen
);
99 printf(" Length: %u,%u\n", hdr
->dumplen
.hi
, hdr
->dumplen
.lo
);
101 printf(" File Num: %d\n", hdr
->filenum
);