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