122044Sdist /*
2*61067Sbostic  * Copyright (c) 1980, 1993
3*61067Sbostic  *	The Regents of the University of California.  All rights reserved.
422044Sdist  *
547060Smckusick  * %sccs.include.redist.c%
647060Smckusick  *
7*61067Sbostic  *	@(#)dumprestore.h	8.1 (Berkeley) 06/02/93
822044Sdist  */
94704Smckusick 
1047775Sbostic #ifndef _DUMPRESTORE_H_
1147775Sbostic #define _DUMPRESTORE_H_
1247775Sbostic 
135321Smckusic /*
145321Smckusic  * TP_BSIZE is the size of file blocks on the dump tapes.
155321Smckusic  * Note that TP_BSIZE must be a multiple of DEV_BSIZE.
165321Smckusic  *
175321Smckusic  * NTREC is the number of TP_BSIZE blocks that are written
1818492Smckusick  * in each tape record. HIGHDENSITYTREC is the number of
1918492Smckusick  * TP_BSIZE blocks that are written in each tape record on
2018492Smckusick  * 6250 BPI or higher density tapes.
215321Smckusic  *
225321Smckusic  * TP_NINDIR is the number of indirect pointers in a TS_INODE
235321Smckusic  * or TS_ADDR record. Note that it must be a power of two.
245321Smckusic  */
254775Smckusic #define TP_BSIZE	1024
264704Smckusick #define NTREC   	10
2718492Smckusick #define HIGHDENSITYTREC	32
284775Smckusic #define TP_NINDIR	(TP_BSIZE/2)
2929901Smckusick #define LBLSIZE		16
3029901Smckusick #define NAMELEN		64
314704Smckusick 
328367Smckusick #define OFS_MAGIC   	(int)60011
338367Smckusick #define NFS_MAGIC   	(int)60012
344704Smckusick #define CHECKSUM	(int)84446
354704Smckusick 
364775Smckusic union u_spcl {
374775Smckusic 	char dummy[TP_BSIZE];
384775Smckusic 	struct	s_spcl {
3929901Smckusick 		long	c_type;		    /* record type (see below) */
4058584Storek 		time_t	c_date;		    /* date of this dump */
4158584Storek 		time_t	c_ddate;	    /* date of previous dump */
4229901Smckusick 		long	c_volume;	    /* dump volume number */
4329901Smckusick 		daddr_t	c_tapea;	    /* logical block of this record */
4429901Smckusick 		ino_t	c_inumber;	    /* number of inode */
4529901Smckusick 		long	c_magic;	    /* magic number (see above) */
4629901Smckusick 		long	c_checksum;	    /* record checksum */
4729901Smckusick 		struct	dinode	c_dinode;   /* ownership and mode of inode */
4829901Smckusick 		long	c_count;	    /* number of valid c_addr entries */
4929901Smckusick 		char	c_addr[TP_NINDIR];  /* 1 => data; 0 => hole in inode */
5029901Smckusick 		char	c_label[LBLSIZE];   /* dump label */
5129901Smckusick 		long	c_level;	    /* level of this dump */
5229901Smckusick 		char	c_filesys[NAMELEN]; /* name of dumpped file system */
5329901Smckusick 		char	c_dev[NAMELEN];	    /* name of dumpped device */
5429901Smckusick 		char	c_host[NAMELEN];    /* name of dumpped host */
5530428Smckusick 		long	c_flags;	    /* additional information */
5650503Smckusick 		long	c_firstrec;	    /* first record on volume */
5750503Smckusick 		long	c_spare[32];	    /* reserved for future uses */
584775Smckusic 	} s_spcl;
594775Smckusic } u_spcl;
604775Smckusic #define spcl u_spcl.s_spcl
6129901Smckusick /*
6229901Smckusick  * special record types
6329901Smckusick  */
6430428Smckusick #define TS_TAPE 	1	/* dump tape header */
6529901Smckusick #define TS_INODE	2	/* beginning of file record */
6629901Smckusick #define TS_ADDR 	4	/* continuation of file record */
6729901Smckusick #define TS_BITS 	3	/* map of inodes on tape */
6829901Smckusick #define TS_CLRI 	6	/* map of inodes deleted since last dump */
6929901Smckusick #define TS_END  	5	/* end of volume marker */
704775Smckusic 
7130428Smckusick /*
7230428Smckusick  * flag values
7330428Smckusick  */
7454161Smckusick #define DR_NEWHEADER	0x0001	/* new format tape header */
7554161Smckusick #define DR_NEWINODEFMT	0x0002	/* new format inodes on tape */
7630428Smckusick 
774704Smckusick #define	DUMPOUTFMT	"%-16s %c %s"		/* for printf */
7847059Smckusick 						/* name, level, ctime(date) */
794704Smckusick #define	DUMPINFMT	"%16s %c %[^\n]\n"	/* inverse for scanf */
8047775Sbostic 
8147775Sbostic #endif /* !_DUMPRESTORE_H_ */
82