122044Sdist /*
261067Sbostic  * Copyright (c) 1980, 1993
361067Sbostic  *	The Regents of the University of California.  All rights reserved.
4*65764Sbostic  * (c) UNIX System Laboratories, Inc.
5*65764Sbostic  * All or some portions of this file are derived from material licensed
6*65764Sbostic  * to the University of California by American Telephone and Telegraph
7*65764Sbostic  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8*65764Sbostic  * the permission of UNIX System Laboratories, Inc.
922044Sdist  *
1047060Smckusick  * %sccs.include.redist.c%
1147060Smckusick  *
12*65764Sbostic  *	@(#)dumprestore.h	8.2 (Berkeley) 01/21/94
1322044Sdist  */
144704Smckusick 
1547775Sbostic #ifndef _DUMPRESTORE_H_
1647775Sbostic #define _DUMPRESTORE_H_
1747775Sbostic 
185321Smckusic /*
195321Smckusic  * TP_BSIZE is the size of file blocks on the dump tapes.
205321Smckusic  * Note that TP_BSIZE must be a multiple of DEV_BSIZE.
215321Smckusic  *
225321Smckusic  * NTREC is the number of TP_BSIZE blocks that are written
2318492Smckusick  * in each tape record. HIGHDENSITYTREC is the number of
2418492Smckusick  * TP_BSIZE blocks that are written in each tape record on
2518492Smckusick  * 6250 BPI or higher density tapes.
265321Smckusic  *
275321Smckusic  * TP_NINDIR is the number of indirect pointers in a TS_INODE
285321Smckusic  * or TS_ADDR record. Note that it must be a power of two.
295321Smckusic  */
304775Smckusic #define TP_BSIZE	1024
314704Smckusick #define NTREC   	10
3218492Smckusick #define HIGHDENSITYTREC	32
334775Smckusic #define TP_NINDIR	(TP_BSIZE/2)
3429901Smckusick #define LBLSIZE		16
3529901Smckusick #define NAMELEN		64
364704Smckusick 
378367Smckusick #define OFS_MAGIC   	(int)60011
388367Smckusick #define NFS_MAGIC   	(int)60012
394704Smckusick #define CHECKSUM	(int)84446
404704Smckusick 
414775Smckusic union u_spcl {
424775Smckusic 	char dummy[TP_BSIZE];
434775Smckusic 	struct	s_spcl {
4429901Smckusick 		long	c_type;		    /* record type (see below) */
4558584Storek 		time_t	c_date;		    /* date of this dump */
4658584Storek 		time_t	c_ddate;	    /* date of previous dump */
4729901Smckusick 		long	c_volume;	    /* dump volume number */
4829901Smckusick 		daddr_t	c_tapea;	    /* logical block of this record */
4929901Smckusick 		ino_t	c_inumber;	    /* number of inode */
5029901Smckusick 		long	c_magic;	    /* magic number (see above) */
5129901Smckusick 		long	c_checksum;	    /* record checksum */
5229901Smckusick 		struct	dinode	c_dinode;   /* ownership and mode of inode */
5329901Smckusick 		long	c_count;	    /* number of valid c_addr entries */
5429901Smckusick 		char	c_addr[TP_NINDIR];  /* 1 => data; 0 => hole in inode */
5529901Smckusick 		char	c_label[LBLSIZE];   /* dump label */
5629901Smckusick 		long	c_level;	    /* level of this dump */
5729901Smckusick 		char	c_filesys[NAMELEN]; /* name of dumpped file system */
5829901Smckusick 		char	c_dev[NAMELEN];	    /* name of dumpped device */
5929901Smckusick 		char	c_host[NAMELEN];    /* name of dumpped host */
6030428Smckusick 		long	c_flags;	    /* additional information */
6150503Smckusick 		long	c_firstrec;	    /* first record on volume */
6250503Smckusick 		long	c_spare[32];	    /* reserved for future uses */
634775Smckusic 	} s_spcl;
644775Smckusic } u_spcl;
654775Smckusic #define spcl u_spcl.s_spcl
6629901Smckusick /*
6729901Smckusick  * special record types
6829901Smckusick  */
6930428Smckusick #define TS_TAPE 	1	/* dump tape header */
7029901Smckusick #define TS_INODE	2	/* beginning of file record */
7129901Smckusick #define TS_ADDR 	4	/* continuation of file record */
7229901Smckusick #define TS_BITS 	3	/* map of inodes on tape */
7329901Smckusick #define TS_CLRI 	6	/* map of inodes deleted since last dump */
7429901Smckusick #define TS_END  	5	/* end of volume marker */
754775Smckusic 
7630428Smckusick /*
7730428Smckusick  * flag values
7830428Smckusick  */
7954161Smckusick #define DR_NEWHEADER	0x0001	/* new format tape header */
8054161Smckusick #define DR_NEWINODEFMT	0x0002	/* new format inodes on tape */
8130428Smckusick 
824704Smckusick #define	DUMPOUTFMT	"%-16s %c %s"		/* for printf */
8347059Smckusick 						/* name, level, ctime(date) */
844704Smckusick #define	DUMPINFMT	"%16s %c %[^\n]\n"	/* inverse for scanf */
8547775Sbostic 
8647775Sbostic #endif /* !_DUMPRESTORE_H_ */
87