Commit | Line | Data |
---|---|---|
b98528ef WJLGJ |
1 | /* |
2 | * Copyright (c) 1980 Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions | |
7 | * are met: | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * 2. Redistributions in binary form must reproduce the above copyright | |
11 | * notice, this list of conditions and the following disclaimer in the | |
12 | * documentation and/or other materials provided with the distribution. | |
13 | * 3. All advertising materials mentioning features or use of this software | |
14 | * must display the following acknowledgement: | |
15 | * This product includes software developed by the University of | |
16 | * California, Berkeley and its contributors. | |
17 | * 4. Neither the name of the University nor the names of its contributors | |
18 | * may be used to endorse or promote products derived from this software | |
19 | * without specific prior written permission. | |
20 | * | |
21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
31 | * SUCH DAMAGE. | |
32 | * | |
33 | * @(#)dumprestore.h 5.6 (Berkeley) 4/3/91 | |
34 | */ | |
35 | ||
36 | #ifndef _DUMPRESTORE_H_ | |
37 | #define _DUMPRESTORE_H_ | |
38 | ||
39 | /* | |
40 | * TP_BSIZE is the size of file blocks on the dump tapes. | |
41 | * Note that TP_BSIZE must be a multiple of DEV_BSIZE. | |
42 | * | |
43 | * NTREC is the number of TP_BSIZE blocks that are written | |
44 | * in each tape record. HIGHDENSITYTREC is the number of | |
45 | * TP_BSIZE blocks that are written in each tape record on | |
46 | * 6250 BPI or higher density tapes. | |
47 | * | |
48 | * TP_NINDIR is the number of indirect pointers in a TS_INODE | |
49 | * or TS_ADDR record. Note that it must be a power of two. | |
50 | */ | |
51 | #define TP_BSIZE 1024 | |
52 | #define NTREC 10 | |
53 | #define HIGHDENSITYTREC 32 | |
54 | #define TP_NINDIR (TP_BSIZE/2) | |
55 | #define LBLSIZE 16 | |
56 | #define NAMELEN 64 | |
57 | ||
58 | #define OFS_MAGIC (int)60011 | |
59 | #define NFS_MAGIC (int)60012 | |
60 | #define CHECKSUM (int)84446 | |
61 | ||
62 | union u_spcl { | |
63 | char dummy[TP_BSIZE]; | |
64 | struct s_spcl { | |
65 | long c_type; /* record type (see below) */ | |
66 | time_t c_date; /* date of previous dump */ | |
67 | time_t c_ddate; /* date of this dump */ | |
68 | long c_volume; /* dump volume number */ | |
69 | daddr_t c_tapea; /* logical block of this record */ | |
70 | ino_t c_inumber; /* number of inode */ | |
71 | long c_magic; /* magic number (see above) */ | |
72 | long c_checksum; /* record checksum */ | |
73 | struct dinode c_dinode; /* ownership and mode of inode */ | |
74 | long c_count; /* number of valid c_addr entries */ | |
75 | char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */ | |
76 | char c_label[LBLSIZE]; /* dump label */ | |
77 | long c_level; /* level of this dump */ | |
78 | char c_filesys[NAMELEN]; /* name of dumpped file system */ | |
79 | char c_dev[NAMELEN]; /* name of dumpped device */ | |
80 | char c_host[NAMELEN]; /* name of dumpped host */ | |
81 | long c_flags; /* additional information */ | |
82 | } s_spcl; | |
83 | } u_spcl; | |
84 | #define spcl u_spcl.s_spcl | |
85 | /* | |
86 | * special record types | |
87 | */ | |
88 | #define TS_TAPE 1 /* dump tape header */ | |
89 | #define TS_INODE 2 /* beginning of file record */ | |
90 | #define TS_ADDR 4 /* continuation of file record */ | |
91 | #define TS_BITS 3 /* map of inodes on tape */ | |
92 | #define TS_CLRI 6 /* map of inodes deleted since last dump */ | |
93 | #define TS_END 5 /* end of volume marker */ | |
94 | ||
95 | /* | |
96 | * flag values | |
97 | */ | |
98 | #define DR_NEWHEADER 1 /* new format tape header */ | |
99 | ||
100 | #define DUMPOUTFMT "%-16s %c %s" /* for printf */ | |
101 | /* name, level, ctime(date) */ | |
102 | #define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */ | |
103 | ||
104 | #endif /* !_DUMPRESTORE_H_ */ |