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