root / lab4 / .minix-src / include / protocols / dumprestore.h @ 13
History | View | Annotate | Download (6.07 KB)
1 |
/* $NetBSD: dumprestore.h,v 1.16 2009/01/11 03:04:12 christos Exp $ */
|
---|---|
2 |
|
3 |
/*
|
4 |
* Copyright (c) 1980, 1993
|
5 |
* The Regents of the University of California. All rights reserved.
|
6 |
* (c) UNIX System Laboratories, Inc.
|
7 |
* All or some portions of this file are derived from material licensed
|
8 |
* to the University of California by American Telephone and Telegraph
|
9 |
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
10 |
* the permission of UNIX System Laboratories, Inc.
|
11 |
*
|
12 |
* Redistribution and use in source and binary forms, with or without
|
13 |
* modification, are permitted provided that the following conditions
|
14 |
* are met:
|
15 |
* 1. Redistributions of source code must retain the above copyright
|
16 |
* notice, this list of conditions and the following disclaimer.
|
17 |
* 2. Redistributions in binary form must reproduce the above copyright
|
18 |
* notice, this list of conditions and the following disclaimer in the
|
19 |
* documentation and/or other materials provided with the distribution.
|
20 |
* 3. Neither the name of the University nor the names of its contributors
|
21 |
* may be used to endorse or promote products derived from this software
|
22 |
* without specific prior written permission.
|
23 |
*
|
24 |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
25 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
26 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
27 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
28 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
29 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
30 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
31 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
32 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
33 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
34 |
* SUCH DAMAGE.
|
35 |
*
|
36 |
* @(#)dumprestore.h 8.2 (Berkeley) 1/21/94
|
37 |
*/
|
38 |
|
39 |
#ifndef _PROTOCOLS_DUMPRESTORE_H_
|
40 |
#define _PROTOCOLS_DUMPRESTORE_H_
|
41 |
|
42 |
/*
|
43 |
* TP_BSIZE is the size of file blocks on the dump tapes.
|
44 |
* Note that TP_BSIZE must be a multiple of DEV_BSIZE.
|
45 |
*
|
46 |
* NTREC is the number of TP_BSIZE blocks that are written
|
47 |
* in each tape record. HIGHDENSITYTREC is the number of
|
48 |
* TP_BSIZE blocks that are written in each tape record on
|
49 |
* 6250 BPI or higher density tapes.
|
50 |
*
|
51 |
* TP_NINDIR is the number of indirect pointers in a TS_INODE
|
52 |
* or TS_ADDR record. Note that it must be a power of two.
|
53 |
*/
|
54 |
#define TP_BSIZE 1024 |
55 |
#define NTREC 10 |
56 |
#define HIGHDENSITYTREC 32 |
57 |
#define TP_NINDIR (TP_BSIZE/2) |
58 |
#define LBLSIZE 16 |
59 |
#define NAMELEN 64 |
60 |
|
61 |
#define OFS_MAGIC (int)60011 |
62 |
#define NFS_MAGIC (int)60012 |
63 |
#ifndef FS_UFS2_MAGIC
|
64 |
#define FS_UFS2_MAGIC (int)0x19540119 |
65 |
#endif
|
66 |
#define CHECKSUM (int)84446 |
67 |
|
68 |
union u_spcl {
|
69 |
char dummy[TP_BSIZE];
|
70 |
struct s_spcl {
|
71 |
int32_t c_type; /* record type (see below) */
|
72 |
int32_t c_old_date; /* date of this dump */
|
73 |
int32_t c_old_ddate; /* date of previous dump */
|
74 |
int32_t c_volume; /* dump volume number */
|
75 |
int32_t c_old_tapea; /* logical block of this record */
|
76 |
uint32_t c_inumber; /* number of inode */
|
77 |
int32_t c_magic; /* magic number (see above) */
|
78 |
int32_t c_checksum; /* record checksum */
|
79 |
union {
|
80 |
struct ufs1_dinode __uc_dinode;
|
81 |
struct {
|
82 |
uint16_t __uc_mode; |
83 |
int16_t __uc_spare1[3];
|
84 |
uint64_t __uc_size; |
85 |
int32_t __uc_old_atime; |
86 |
int32_t __uc_atimensec; |
87 |
int32_t __uc_old_mtime; |
88 |
int32_t __uc_mtimensec; |
89 |
int32_t __uc_spare2[2];
|
90 |
int32_t __uc_rdev; |
91 |
int32_t __uc_birthtimensec; |
92 |
int64_t __uc_birthtime; |
93 |
int64_t __uc_atime; |
94 |
int64_t __uc_mtime; |
95 |
int32_t __uc_spare4[7];
|
96 |
uint32_t __uc_file_flags; |
97 |
int32_t __uc_spare5[2];
|
98 |
uint32_t __uc_uid; |
99 |
uint32_t __uc_gid; |
100 |
int32_t __uc_spare6[2];
|
101 |
} __uc_ino; |
102 |
} __c_ino; |
103 |
int32_t c_count; /* number of valid c_addr entries */
|
104 |
char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */ |
105 |
char c_label[LBLSIZE]; /* dump label */ |
106 |
int32_t c_level; /* level of this dump */
|
107 |
char c_filesys[NAMELEN]; /* name of dumpped file system */ |
108 |
char c_dev[NAMELEN]; /* name of dumpped device */ |
109 |
char c_host[NAMELEN]; /* name of dumpped host */ |
110 |
int32_t c_flags; /* additional information */
|
111 |
int32_t c_old_firstrec; /* first record on volume */
|
112 |
int64_t c_date; /* date of this dump */
|
113 |
int64_t c_ddate; /* date of previous dump */
|
114 |
int64_t c_tapea; /* logical block of this record */
|
115 |
int64_t c_firstrec; /* first record on volume */
|
116 |
int32_t c_spare[24]; /* reserved for future uses */ |
117 |
} s_spcl; |
118 |
} u_spcl; |
119 |
#define spcl u_spcl.s_spcl
|
120 |
|
121 |
#define c_dinode __c_ino.__uc_dinode
|
122 |
#define c_mode __c_ino.__uc_ino.__uc_mode
|
123 |
#define c_spare1 __c_ino.__uc_ino.__uc_spare1
|
124 |
#define c_size __c_ino.__uc_ino.__uc_size
|
125 |
#define c_old_atime __c_ino.__uc_ino.__uc_old_atime
|
126 |
#define c_atime __c_ino.__uc_ino.__uc_atime
|
127 |
#define c_atimensec __c_ino.__uc_ino.__uc_atimensec
|
128 |
#define c_mtime __c_ino.__uc_ino.__uc_mtime
|
129 |
#define c_mtimensec __c_ino.__uc_ino.__uc_mtimensec
|
130 |
#define c_birthtime __c_ino.__uc_ino.__uc_birthtime
|
131 |
#define c_birthtimensec __c_ino.__uc_ino.__uc_birthtimensec
|
132 |
#define c_old_mtime __c_ino.__uc_ino.__uc_old_mtime
|
133 |
#define c_rdev __c_ino.__uc_ino.__uc_rdev
|
134 |
#define c_file_flags __c_ino.__uc_ino.__uc_file_flags
|
135 |
#define c_uid __c_ino.__uc_ino.__uc_uid
|
136 |
#define c_gid __c_ino.__uc_ino.__uc_gid
|
137 |
|
138 |
/*
|
139 |
* special record types
|
140 |
*/
|
141 |
#define TS_TAPE 1 /* dump tape header */ |
142 |
#define TS_INODE 2 /* beginning of file record */ |
143 |
#define TS_ADDR 4 /* continuation of file record */ |
144 |
#define TS_BITS 3 /* map of inodes on tape */ |
145 |
#define TS_CLRI 6 /* map of inodes deleted since last dump */ |
146 |
#define TS_END 5 /* end of volume marker */ |
147 |
|
148 |
/*
|
149 |
* flag values
|
150 |
*/
|
151 |
#define DR_NEWHEADER 0x0001 /* new format tape header */ |
152 |
#define DR_NEWINODEFMT 0x0002 /* new format inodes on tape */ |
153 |
#define DR_EXTATTRIBUTES 0x8000 /* linux: extended attributes */ |
154 |
|
155 |
#define DUMPOUTFMT "%-16s %c %s" /* for printf */ |
156 |
/* name, level, ctime(date) */
|
157 |
#define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */ |
158 |
|
159 |
#endif /* !_PROTOCOLS_DUMPRESTORE_H_ */ |