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