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