122044Sdist /*
222044Sdist  * Copyright (c) 1980 Regents of the University of California.
322044Sdist  * All rights reserved.  The Berkeley software License Agreement
422044Sdist  * specifies the terms and conditions for redistribution.
522044Sdist  *
6*30428Smckusick  *	@(#)dumprestore.h	5.3 (Berkeley) 01/28/87
722044Sdist  */
84704Smckusick 
95321Smckusic /*
105321Smckusic  * TP_BSIZE is the size of file blocks on the dump tapes.
115321Smckusic  * Note that TP_BSIZE must be a multiple of DEV_BSIZE.
125321Smckusic  *
135321Smckusic  * NTREC is the number of TP_BSIZE blocks that are written
1418492Smckusick  * in each tape record. HIGHDENSITYTREC is the number of
1518492Smckusick  * TP_BSIZE blocks that are written in each tape record on
1618492Smckusick  * 6250 BPI or higher density tapes.
175321Smckusic  *
185321Smckusic  * TP_NINDIR is the number of indirect pointers in a TS_INODE
195321Smckusic  * or TS_ADDR record. Note that it must be a power of two.
205321Smckusic  */
214775Smckusic #define TP_BSIZE	1024
224704Smckusick #define NTREC   	10
2318492Smckusick #define HIGHDENSITYTREC	32
244775Smckusic #define TP_NINDIR	(TP_BSIZE/2)
2529901Smckusick #define LBLSIZE		16
2629901Smckusick #define NAMELEN		64
274704Smckusick 
288367Smckusick #define OFS_MAGIC   	(int)60011
298367Smckusick #define NFS_MAGIC   	(int)60012
304704Smckusick #define CHECKSUM	(int)84446
314704Smckusick 
324775Smckusic union u_spcl {
334775Smckusic 	char dummy[TP_BSIZE];
344775Smckusic 	struct	s_spcl {
3529901Smckusick 		long	c_type;		    /* record type (see below) */
3629901Smckusick 		time_t	c_date;		    /* date of previous dump */
3729901Smckusick 		time_t	c_ddate;	    /* date of this dump */
3829901Smckusick 		long	c_volume;	    /* dump volume number */
3929901Smckusick 		daddr_t	c_tapea;	    /* logical block of this record */
4029901Smckusick 		ino_t	c_inumber;	    /* number of inode */
4129901Smckusick 		long	c_magic;	    /* magic number (see above) */
4229901Smckusick 		long	c_checksum;	    /* record checksum */
4329901Smckusick 		struct	dinode	c_dinode;   /* ownership and mode of inode */
4429901Smckusick 		long	c_count;	    /* number of valid c_addr entries */
4529901Smckusick 		char	c_addr[TP_NINDIR];  /* 1 => data; 0 => hole in inode */
4629901Smckusick 		char	c_label[LBLSIZE];   /* dump label */
4729901Smckusick 		long	c_level;	    /* level of this dump */
4829901Smckusick 		char	c_filesys[NAMELEN]; /* name of dumpped file system */
4929901Smckusick 		char	c_dev[NAMELEN];	    /* name of dumpped device */
5029901Smckusick 		char	c_host[NAMELEN];    /* name of dumpped host */
51*30428Smckusick 		long	c_flags;	    /* additional information */
524775Smckusic 	} s_spcl;
534775Smckusic } u_spcl;
544775Smckusic #define spcl u_spcl.s_spcl
5529901Smckusick /*
5629901Smckusick  * special record types
5729901Smckusick  */
58*30428Smckusick #define TS_TAPE 	1	/* dump tape header */
5929901Smckusick #define TS_INODE	2	/* beginning of file record */
6029901Smckusick #define TS_ADDR 	4	/* continuation of file record */
6129901Smckusick #define TS_BITS 	3	/* map of inodes on tape */
6229901Smckusick #define TS_CLRI 	6	/* map of inodes deleted since last dump */
6329901Smckusick #define TS_END  	5	/* end of volume marker */
644775Smckusic 
65*30428Smckusick /*
66*30428Smckusick  * flag values
67*30428Smckusick  */
68*30428Smckusick #define DR_NEWHEADER	1	/* new format tape header */
69*30428Smckusick 
704704Smckusick #define	DUMPOUTFMT	"%-16s %c %s"		/* for printf */
714704Smckusick 						/* name, incno, ctime(date) */
724704Smckusick #define	DUMPINFMT	"%16s %c %[^\n]\n"	/* inverse for scanf */
73