4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / include / protocols / dumprestore.h
CommitLineData
76797561 1/*
56559b70
KB
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
76797561 4 *
56dba9bc
KM
5 * %sccs.include.redist.c%
6 *
56559b70 7 * @(#)dumprestore.h 8.1 (Berkeley) %G%
76797561 8 */
8959d9ce 9
d2b7358e
KB
10#ifndef _DUMPRESTORE_H_
11#define _DUMPRESTORE_H_
12
b6407c9d
KM
13/*
14 * TP_BSIZE is the size of file blocks on the dump tapes.
15 * Note that TP_BSIZE must be a multiple of DEV_BSIZE.
16 *
17 * NTREC is the number of TP_BSIZE blocks that are written
f65cc121
KM
18 * in each tape record. HIGHDENSITYTREC is the number of
19 * TP_BSIZE blocks that are written in each tape record on
20 * 6250 BPI or higher density tapes.
b6407c9d 21 *
b6407c9d
KM
22 * TP_NINDIR is the number of indirect pointers in a TS_INODE
23 * or TS_ADDR record. Note that it must be a power of two.
24 */
f5bba473 25#define TP_BSIZE 1024
8959d9ce 26#define NTREC 10
f65cc121 27#define HIGHDENSITYTREC 32
f5bba473 28#define TP_NINDIR (TP_BSIZE/2)
f77a910f
KM
29#define LBLSIZE 16
30#define NAMELEN 64
8959d9ce 31
c287fc13
KM
32#define OFS_MAGIC (int)60011
33#define NFS_MAGIC (int)60012
8959d9ce
KM
34#define CHECKSUM (int)84446
35
f5bba473
KM
36union u_spcl {
37 char dummy[TP_BSIZE];
38 struct s_spcl {
f77a910f 39 long c_type; /* record type (see below) */
4c54ed20
CT
40 time_t c_date; /* date of this dump */
41 time_t c_ddate; /* date of previous dump */
f77a910f
KM
42 long c_volume; /* dump volume number */
43 daddr_t c_tapea; /* logical block of this record */
44 ino_t c_inumber; /* number of inode */
45 long c_magic; /* magic number (see above) */
46 long c_checksum; /* record checksum */
47 struct dinode c_dinode; /* ownership and mode of inode */
48 long c_count; /* number of valid c_addr entries */
49 char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */
50 char c_label[LBLSIZE]; /* dump label */
51 long c_level; /* level of this dump */
52 char c_filesys[NAMELEN]; /* name of dumpped file system */
53 char c_dev[NAMELEN]; /* name of dumpped device */
54 char c_host[NAMELEN]; /* name of dumpped host */
8d412b7c 55 long c_flags; /* additional information */
16678c53
KM
56 long c_firstrec; /* first record on volume */
57 long c_spare[32]; /* reserved for future uses */
f5bba473
KM
58 } s_spcl;
59} u_spcl;
f5bba473 60#define spcl u_spcl.s_spcl
f77a910f
KM
61/*
62 * special record types
63 */
8d412b7c 64#define TS_TAPE 1 /* dump tape header */
f77a910f
KM
65#define TS_INODE 2 /* beginning of file record */
66#define TS_ADDR 4 /* continuation of file record */
67#define TS_BITS 3 /* map of inodes on tape */
68#define TS_CLRI 6 /* map of inodes deleted since last dump */
69#define TS_END 5 /* end of volume marker */
8959d9ce 70
8d412b7c
KM
71/*
72 * flag values
73 */
15df3e8e
KM
74#define DR_NEWHEADER 0x0001 /* new format tape header */
75#define DR_NEWINODEFMT 0x0002 /* new format inodes on tape */
8d412b7c 76
8959d9ce 77#define DUMPOUTFMT "%-16s %c %s" /* for printf */
439ab1a9 78 /* name, level, ctime(date) */
8959d9ce 79#define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */
d2b7358e
KB
80
81#endif /* !_DUMPRESTORE_H_ */