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