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*29901Smckusick  *	@(#)dumprestore.h	5.2 (Berkeley) 10/21/86
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)
25*29901Smckusick #define LBLSIZE		16
26*29901Smckusick #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 {
35*29901Smckusick 		long	c_type;		    /* record type (see below) */
36*29901Smckusick 		time_t	c_date;		    /* date of previous dump */
37*29901Smckusick 		time_t	c_ddate;	    /* date of this dump */
38*29901Smckusick 		long	c_volume;	    /* dump volume number */
39*29901Smckusick 		daddr_t	c_tapea;	    /* logical block of this record */
40*29901Smckusick 		ino_t	c_inumber;	    /* number of inode */
41*29901Smckusick 		long	c_magic;	    /* magic number (see above) */
42*29901Smckusick 		long	c_checksum;	    /* record checksum */
43*29901Smckusick 		struct	dinode	c_dinode;   /* ownership and mode of inode */
44*29901Smckusick 		long	c_count;	    /* number of valid c_addr entries */
45*29901Smckusick 		char	c_addr[TP_NINDIR];  /* 1 => data; 0 => hole in inode */
46*29901Smckusick 		char	c_label[LBLSIZE];   /* dump label */
47*29901Smckusick 		long	c_level;	    /* level of this dump */
48*29901Smckusick 		char	c_filesys[NAMELEN]; /* name of dumpped file system */
49*29901Smckusick 		char	c_dev[NAMELEN];	    /* name of dumpped device */
50*29901Smckusick 		char	c_host[NAMELEN];    /* name of dumpped host */
514775Smckusic 	} s_spcl;
524775Smckusic } u_spcl;
534775Smckusic #define spcl u_spcl.s_spcl
54*29901Smckusick /*
55*29901Smckusick  * special record types
56*29901Smckusick  */
57*29901Smckusick #define TS_OTAPE 	1	/* 4.3BSD and earlier type dump tape header */
58*29901Smckusick #define TS_TAPE 	7	/* dump tape header */
59*29901Smckusick #define TS_INODE	2	/* beginning of file record */
60*29901Smckusick #define TS_ADDR 	4	/* continuation of file record */
61*29901Smckusick #define TS_BITS 	3	/* map of inodes on tape */
62*29901Smckusick #define TS_CLRI 	6	/* map of inodes deleted since last dump */
63*29901Smckusick #define TS_END  	5	/* end of volume marker */
644775Smckusic 
654704Smckusick #define	DUMPOUTFMT	"%-16s %c %s"		/* for printf */
664704Smckusick 						/* name, incno, ctime(date) */
674704Smckusick #define	DUMPINFMT	"%16s %c %[^\n]\n"	/* inverse for scanf */
68