1 /* 2 * Copyright (c) 1980 Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)dumprestore.h 5.5 (Berkeley) 03/07/91 8 */ 9 10 /* 11 * TP_BSIZE is the size of file blocks on the dump tapes. 12 * Note that TP_BSIZE must be a multiple of DEV_BSIZE. 13 * 14 * NTREC is the number of TP_BSIZE blocks that are written 15 * in each tape record. HIGHDENSITYTREC is the number of 16 * TP_BSIZE blocks that are written in each tape record on 17 * 6250 BPI or higher density tapes. 18 * 19 * TP_NINDIR is the number of indirect pointers in a TS_INODE 20 * or TS_ADDR record. Note that it must be a power of two. 21 */ 22 #define TP_BSIZE 1024 23 #define NTREC 10 24 #define HIGHDENSITYTREC 32 25 #define TP_NINDIR (TP_BSIZE/2) 26 #define LBLSIZE 16 27 #define NAMELEN 64 28 29 #define OFS_MAGIC (int)60011 30 #define NFS_MAGIC (int)60012 31 #define CHECKSUM (int)84446 32 33 union u_spcl { 34 char dummy[TP_BSIZE]; 35 struct s_spcl { 36 long c_type; /* record type (see below) */ 37 time_t c_date; /* date of previous dump */ 38 time_t c_ddate; /* date of this dump */ 39 long c_volume; /* dump volume number */ 40 daddr_t c_tapea; /* logical block of this record */ 41 ino_t c_inumber; /* number of inode */ 42 long c_magic; /* magic number (see above) */ 43 long c_checksum; /* record checksum */ 44 struct dinode c_dinode; /* ownership and mode of inode */ 45 long c_count; /* number of valid c_addr entries */ 46 char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */ 47 char c_label[LBLSIZE]; /* dump label */ 48 long c_level; /* level of this dump */ 49 char c_filesys[NAMELEN]; /* name of dumpped file system */ 50 char c_dev[NAMELEN]; /* name of dumpped device */ 51 char c_host[NAMELEN]; /* name of dumpped host */ 52 long c_flags; /* additional information */ 53 } s_spcl; 54 } u_spcl; 55 #define spcl u_spcl.s_spcl 56 /* 57 * special record types 58 */ 59 #define TS_TAPE 1 /* dump tape header */ 60 #define TS_INODE 2 /* beginning of file record */ 61 #define TS_ADDR 4 /* continuation of file record */ 62 #define TS_BITS 3 /* map of inodes on tape */ 63 #define TS_CLRI 6 /* map of inodes deleted since last dump */ 64 #define TS_END 5 /* end of volume marker */ 65 66 /* 67 * flag values 68 */ 69 #define DR_NEWHEADER 1 /* new format tape header */ 70 71 #define DUMPOUTFMT "%-16s %c %s" /* for printf */ 72 /* name, level, ctime(date) */ 73 #define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */ 74