xref: /illumos-gate/usr/src/cmd/backup/dump/dump.h (revision e0dfa398)
17c478bd9Sstevel@tonic-gate /*
2bf545727SJim Rice  * CDDL HEADER START
3bf545727SJim Rice  *
4bf545727SJim Rice  * The contents of this file are subject to the terms of the
5bf545727SJim Rice  * Common Development and Distribution License (the "License").
6bf545727SJim Rice  * You may not use this file except in compliance with the License.
7bf545727SJim Rice  *
8bf545727SJim Rice  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9bf545727SJim Rice  * or http://www.opensolaris.org/os/licensing.
10bf545727SJim Rice  * See the License for the specific language governing permissions
11bf545727SJim Rice  * and limitations under the License.
12bf545727SJim Rice  *
13bf545727SJim Rice  * When distributing Covered Code, include this CDDL HEADER in each
14bf545727SJim Rice  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15bf545727SJim Rice  * If applicable, add the following below this CDDL HEADER, with the
16bf545727SJim Rice  * fields enclosed by brackets "[]" replaced with your own identifying
17bf545727SJim Rice  * information: Portions Copyright [yyyy] [name of copyright owner]
18bf545727SJim Rice  *
19bf545727SJim Rice  * CDDL HEADER END
20bf545727SJim Rice  */
21bf545727SJim Rice /*
22bf545727SJim Rice  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate /*
277c478bd9Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
287c478bd9Sstevel@tonic-gate  * All rights reserved. The Berkeley software License Agreement
297c478bd9Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
307c478bd9Sstevel@tonic-gate  */
327c478bd9Sstevel@tonic-gate #ifndef _DUMP_H
337c478bd9Sstevel@tonic-gate #define	_DUMP_H
357c478bd9Sstevel@tonic-gate #include <stdio.h>
367c478bd9Sstevel@tonic-gate #include <locale.h>
377c478bd9Sstevel@tonic-gate #include <sys/types.h>
387c478bd9Sstevel@tonic-gate #include <ctype.h>
397c478bd9Sstevel@tonic-gate #include <string.h>
407c478bd9Sstevel@tonic-gate #include <syslog.h>
417c478bd9Sstevel@tonic-gate #include <errno.h>
427c478bd9Sstevel@tonic-gate #include <fcntl.h>
437c478bd9Sstevel@tonic-gate #include <utmpx.h>
447c478bd9Sstevel@tonic-gate #include <signal.h>
457c478bd9Sstevel@tonic-gate #include <stdlib.h>
467c478bd9Sstevel@tonic-gate #include <time.h>
477c478bd9Sstevel@tonic-gate #include <sys/param.h>	/* for MAXBSIZE */
487c478bd9Sstevel@tonic-gate #include <sys/stat.h>
497c478bd9Sstevel@tonic-gate #include <sys/time.h>
507c478bd9Sstevel@tonic-gate #include <sys/wait.h>
517c478bd9Sstevel@tonic-gate #include <sys/vnode.h>	/* needed by inode.h */
527c478bd9Sstevel@tonic-gate #include <setjmp.h>
537c478bd9Sstevel@tonic-gate #include <sys/mman.h>
547c478bd9Sstevel@tonic-gate #include <assert.h>
557c478bd9Sstevel@tonic-gate #include <dumpusg.h>
567c478bd9Sstevel@tonic-gate #include <kstat.h>
577c478bd9Sstevel@tonic-gate #include <sys/fssnap_if.h>
587c478bd9Sstevel@tonic-gate #include <libgen.h>
597c478bd9Sstevel@tonic-gate #include <limits.h>
617c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
627c478bd9Sstevel@tonic-gate extern "C" {
637c478bd9Sstevel@tonic-gate #endif
657c478bd9Sstevel@tonic-gate #define	SUPPORTS_MTB_TAPE_FORMAT
667c478bd9Sstevel@tonic-gate #include <protocols/dumprestore.h>
677c478bd9Sstevel@tonic-gate #include <memutils.h>
687c478bd9Sstevel@tonic-gate #include <note.h>
707c478bd9Sstevel@tonic-gate #define	NI		16
717c478bd9Sstevel@tonic-gate #define	MAXINOPB	(MAXBSIZE / sizeof (struct dinode))
727c478bd9Sstevel@tonic-gate #define	MAXNINDIR	(MAXBSIZE / sizeof (daddr32_t))
747c478bd9Sstevel@tonic-gate #ifndef roundup
757c478bd9Sstevel@tonic-gate #define	roundup(x, y)	((((x)+((y)-1))/(y))*(y))
767c478bd9Sstevel@tonic-gate #endif
777c478bd9Sstevel@tonic-gate #ifndef MIN
787c478bd9Sstevel@tonic-gate #define	MIN(a, b)	(((a) < (b)) ? (a) : (b))
797c478bd9Sstevel@tonic-gate #endif
807c478bd9Sstevel@tonic-gate #ifndef MAX
817c478bd9Sstevel@tonic-gate #define	MAX(a, b)	(((a) > (b)) ? (a) : (b))
827c478bd9Sstevel@tonic-gate #endif
847c478bd9Sstevel@tonic-gate /*
857c478bd9Sstevel@tonic-gate  * Define an overflow-free version of howmany so that we don't
867c478bd9Sstevel@tonic-gate  * run into trouble with large files.
877c478bd9Sstevel@tonic-gate  */
887c478bd9Sstevel@tonic-gate #define	d_howmany(x, y)	((x) / (y) + ((x) % (y) != 0))
907c478bd9Sstevel@tonic-gate #define	MWORD(m, i)	(m[(ino_t)(i-1)/NBBY])
917c478bd9Sstevel@tonic-gate #define	MBIT(i)		((1<<((ino_t)(i-1)%NBBY))&0xff)
927c478bd9Sstevel@tonic-gate #define	BIS(i, w)	(MWORD(w, i) |= MBIT(i))
937c478bd9Sstevel@tonic-gate #define	BIC(i, w)	(MWORD(w, i) &= ~MBIT(i))
947c478bd9Sstevel@tonic-gate #define	BIT(i, w)	(MWORD(w, i) & MBIT(i))
96*e0dfa398SToomas Soome extern uint_t	msiz;
97*e0dfa398SToomas Soome extern uchar_t	*clrmap;
98*e0dfa398SToomas Soome extern uchar_t	*dirmap;
99*e0dfa398SToomas Soome extern uchar_t	*filmap;
100*e0dfa398SToomas Soome extern uchar_t	*nodmap;
101*e0dfa398SToomas Soome extern uchar_t	*shamap;
102*e0dfa398SToomas Soome extern uchar_t	*activemap;
1047c478bd9Sstevel@tonic-gate /*
1057c478bd9Sstevel@tonic-gate  *	All calculations done in 0.1" units!
1067c478bd9Sstevel@tonic-gate  */
108*e0dfa398SToomas Soome extern char	*disk;		/* name of the disk file */
109*e0dfa398SToomas Soome extern char	*dname;		/* name to put in /etc/dumpdates */
110*e0dfa398SToomas Soome extern int	disk_dynamic;	/* true if disk refers to dynamic storage */
111*e0dfa398SToomas Soome extern char	*tape;		/* name of the tape file */
112*e0dfa398SToomas Soome extern char	*host;	/* name of the remote tape host (may be "user@host") */
113*e0dfa398SToomas Soome extern char	*dumpdev;	/* hostname:device for current volume */
114*e0dfa398SToomas Soome extern char	*sdumpdev; /* short form of dumpdev (no user name if remote) */
115*e0dfa398SToomas Soome extern char	*increm; /* name of file containing incremental information */
116*e0dfa398SToomas Soome extern char	*filesystem;	/* name of the file system */
117*e0dfa398SToomas Soome extern char	*myname;	/* argv[0] without leading path components */
118*e0dfa398SToomas Soome extern char	lastincno;	/* increment number of previous dump */
119*e0dfa398SToomas Soome extern char	incno;		/* increment number */
120*e0dfa398SToomas Soome extern char	*tlabel;	/* what goes in tape header c_label field */
121*e0dfa398SToomas Soome extern int	uflag;		/* update flag */
122*e0dfa398SToomas Soome extern int	fi;		/* disk file descriptor */
123*e0dfa398SToomas Soome extern int	to;		/* tape file descriptor */
124*e0dfa398SToomas Soome extern int	mapfd;		/* block disk device descriptor for mmap */
125*e0dfa398SToomas Soome extern int	pipeout;	/* true => output to standard output */
126*e0dfa398SToomas Soome extern int	tapeout;	/* true => output to a tape drive */
127*e0dfa398SToomas Soome extern ino_t	ino;		/* current inumber; used globally */
128*e0dfa398SToomas Soome extern off_t	pos;		/* starting offset within ino; used globally */
129*e0dfa398SToomas Soome extern int	leftover; /* number of tape recs left over from prev vol */
130*e0dfa398SToomas Soome extern int	nsubdir;	/* counts subdirs, for deciding to dump a dir */
131*e0dfa398SToomas Soome extern int	newtape;	/* new tape flag */
132*e0dfa398SToomas Soome extern int	nadded;		/* number of added sub directories */
133*e0dfa398SToomas Soome extern int	dadded;		/* directory added flag */
134*e0dfa398SToomas Soome extern int	density;	/* density in 0.1" units */
135*e0dfa398SToomas Soome extern ulong_t	tsize;		/* tape size in 0.1" units */
136*e0dfa398SToomas Soome extern u_offset_t esize;	/* estimated tape size, blocks */
137*e0dfa398SToomas Soome extern u_offset_t o_esize;	/* number of header blocks (overhead) */
138*e0dfa398SToomas Soome extern u_offset_t f_esize;	/* number of TP_BSIZE blocks for files/maps */
139*e0dfa398SToomas Soome extern uint_t	etapes;		/* estimated number of tapes */
140*e0dfa398SToomas Soome extern uint_t	ntrec;		/* 1K records per tape block */
141*e0dfa398SToomas Soome extern int	tenthsperirg;	/* 1/10" per tape inter-record gap */
142*e0dfa398SToomas Soome extern dev_t	partial_dev;	/* id of BLOCK device used in partial mode */
143*e0dfa398SToomas Soome extern pid_t	dumppid;	/* process-ID of top-level process */
144*e0dfa398SToomas Soome 
145*e0dfa398SToomas Soome extern int	verify;		/* verify each volume */
146*e0dfa398SToomas Soome extern int	doingverify;	/* true => doing a verify pass */
147*e0dfa398SToomas Soome extern int	active;		/* recopy active files */
148*e0dfa398SToomas Soome extern int	doingactive;	/* true => redumping active files */
149*e0dfa398SToomas Soome extern int	archive;	/* true => saving a archive in archivefile */
150*e0dfa398SToomas Soome extern char	*archivefile;	/* name of archivefile */
151*e0dfa398SToomas Soome extern int	archive_opened;	/* have opened/created the archivefile */
152*e0dfa398SToomas Soome extern int	notify;		/* notify operator flag */
153*e0dfa398SToomas Soome extern int	diskette;	/* true if dumping to a diskette */
154*e0dfa398SToomas Soome extern int	cartridge;	/* true if dumping to a cartridge tape */
155*e0dfa398SToomas Soome extern uint_t	tracks;		/* number of tracks on a cartridge tape */
156*e0dfa398SToomas Soome extern int	printsize;	/* just print estimated size and exit */
157*e0dfa398SToomas Soome extern int	offline;	/* take tape offline after rewinding */
158*e0dfa398SToomas Soome extern int	autoload; /* wait for next tape to autoload; implies offline */
159*e0dfa398SToomas Soome extern int	autoload_tries;	/* number of times to check on autoload */
160*e0dfa398SToomas Soome extern int	autoload_period; /* seconds, tries*period = total wait time */
161*e0dfa398SToomas Soome extern int	doposition;	/* move to specified... */
162*e0dfa398SToomas Soome extern daddr32_t filenum;	/* position of dump on 1st volume */
163*e0dfa398SToomas Soome extern int	dumpstate;	/* dump output state (see below) */
164*e0dfa398SToomas Soome extern int	dumptoarchive;	/* mark records to be archived */
165*e0dfa398SToomas Soome 
166*e0dfa398SToomas Soome extern int	blockswritten;	/* number of blocks written on current tape */
167*e0dfa398SToomas Soome extern uint_t	tapeno;		/* current tape number */
168*e0dfa398SToomas Soome 
169*e0dfa398SToomas Soome extern struct fs *sblock;	/* the file system super block */
170*e0dfa398SToomas Soome extern int	shortmeta;	/* current file has small amount of metadata */
171*e0dfa398SToomas Soome extern union u_shadow c_shadow_save[1];
172*e0dfa398SToomas Soome 
173*e0dfa398SToomas Soome extern time_t	*telapsed;	/* time spent writing previous tapes */
174*e0dfa398SToomas Soome extern time_t	*tstart_writing; /* when we started writing the latest tape */
175*e0dfa398SToomas Soome extern time_t	*tschedule; /* when next to give a remaining-time estimate */
176*e0dfa398SToomas Soome 
177*e0dfa398SToomas Soome extern char	*debug_chdir;	/* non-NULL means to mkdir this/pid, */
178*e0dfa398SToomas Soome 			/* and chdir there, once for each separate child */
1807c478bd9Sstevel@tonic-gate /*
1817c478bd9Sstevel@tonic-gate  * Defines for the msec part of
1827c478bd9Sstevel@tonic-gate  * inode-based times, since we're
1837c478bd9Sstevel@tonic-gate  * not part of the kernel.
1847c478bd9Sstevel@tonic-gate  */
1857c478bd9Sstevel@tonic-gate #define	di_atspare	di_ic.ic_atspare
1867c478bd9Sstevel@tonic-gate #define	di_mtspare	di_ic.ic_mtspare
1877c478bd9Sstevel@tonic-gate #define	di_ctspare	di_ic.ic_ctspare
1897c478bd9Sstevel@tonic-gate #define	HOUR	(60L*60L)
1907c478bd9Sstevel@tonic-gate #define	DAY	(24L*HOUR)
1917c478bd9Sstevel@tonic-gate #define	YEAR	(365L*DAY)
1937c478bd9Sstevel@tonic-gate /*
1947c478bd9Sstevel@tonic-gate  *	Dump output states
1957c478bd9Sstevel@tonic-gate  */
1967c478bd9Sstevel@tonic-gate #define	DS_INIT		0
1977c478bd9Sstevel@tonic-gate #define	DS_START	1
1987c478bd9Sstevel@tonic-gate #define	DS_CLRI		2
1997c478bd9Sstevel@tonic-gate #define	DS_BITS		3
2007c478bd9Sstevel@tonic-gate #define	DS_DIRS		4
2017c478bd9Sstevel@tonic-gate #define	DS_FILES	5
2027c478bd9Sstevel@tonic-gate #define	DS_END		6
2037c478bd9Sstevel@tonic-gate #define	DS_DONE		7
2057c478bd9Sstevel@tonic-gate /*
2067c478bd9Sstevel@tonic-gate  *	Exit status codes
2077c478bd9Sstevel@tonic-gate  */
2087c478bd9Sstevel@tonic-gate #define	X_FINOK		0	/* normal exit */
2097c478bd9Sstevel@tonic-gate #define	X_REWRITE	2	/* restart writing from the check point */
2107c478bd9Sstevel@tonic-gate #define	X_ABORT		3	/* abort all of dump; no checkpoint restart */
2117c478bd9Sstevel@tonic-gate #define	X_VERIFY	4	/* verify the reel just written */
2127c478bd9Sstevel@tonic-gate #define	X_RESTART	5	/* abort all progress so far; attempt restart */
2147c478bd9Sstevel@tonic-gate #define	NINCREM	"/etc/dumpdates"	/* new format incremental info */
2167c478bd9Sstevel@tonic-gate #define	TAPE	"/dev/rmt/0b"		/* default tape device */
2177c478bd9Sstevel@tonic-gate #define	OPGRENT	"sys"			/* group entry to notify */
2187c478bd9Sstevel@tonic-gate #define	DIALUP	"ttyd"			/* prefix for dialups */
2207c478bd9Sstevel@tonic-gate #define	DISKETTE	"/dev/rfd0c"
2227c478bd9Sstevel@tonic-gate #define	NBUF		64		/* number of output buffers */
2237c478bd9Sstevel@tonic-gate #define	MAXNTREC	256		/* max tape blocking factor (in Kb) */
2257c478bd9Sstevel@tonic-gate /*
2267c478bd9Sstevel@tonic-gate  *	The contents of the file NINCREM are maintained both on
2277c478bd9Sstevel@tonic-gate  *	a linked list and then (eventually) arrayified.
2287c478bd9Sstevel@tonic-gate  */
2297c478bd9Sstevel@tonic-gate struct	idates {
2307c478bd9Sstevel@tonic-gate 	char	id_name[MAXNAMLEN+3];
2317c478bd9Sstevel@tonic-gate 	char	id_incno;
2327c478bd9Sstevel@tonic-gate 	time32_t id_ddate;
2337c478bd9Sstevel@tonic-gate };
235*e0dfa398SToomas Soome extern size_t	nidates;		/* number of records (might be zero) */
236*e0dfa398SToomas Soome extern struct	idates	**idatev;	/* the arrayfied version */
2377c478bd9Sstevel@tonic-gate #define	ITITERATE(i, ip)	\
2387c478bd9Sstevel@tonic-gate 	for (i = 0; i < nidates && (ip = idatev[i]) != NULL; i++)
2407c478bd9Sstevel@tonic-gate /*
2417c478bd9Sstevel@tonic-gate  * Function declarations
2427c478bd9Sstevel@tonic-gate  */
2437c478bd9Sstevel@tonic-gate #ifdef __STDC__
2447c478bd9Sstevel@tonic-gate /*
2457c478bd9Sstevel@tonic-gate  * dumpfstab.c
2467c478bd9Sstevel@tonic-gate  */
2477c478bd9Sstevel@tonic-gate extern void mnttabread(void);
2487c478bd9Sstevel@tonic-gate extern struct mntent *mnttabsearch(char *, int);
2497c478bd9Sstevel@tonic-gate extern void setmnttab(void);
2507c478bd9Sstevel@tonic-gate extern struct mntent *getmnttab(void);
2517c478bd9Sstevel@tonic-gate /*
2527c478bd9Sstevel@tonic-gate  * dumpitime.c
2537c478bd9Sstevel@tonic-gate  */
2547c478bd9Sstevel@tonic-gate extern char *prdate(time_t);
2557c478bd9Sstevel@tonic-gate extern void inititimes(void);
2567c478bd9Sstevel@tonic-gate extern void getitime(void);
2577c478bd9Sstevel@tonic-gate extern void putitime(void);
2587c478bd9Sstevel@tonic-gate extern void est(struct dinode *);
2597c478bd9Sstevel@tonic-gate extern time32_t is_fssnap_dump(char *);
2607c478bd9Sstevel@tonic-gate extern void bmapest(uchar_t *);
2617c478bd9Sstevel@tonic-gate /*
2627c478bd9Sstevel@tonic-gate  * dumplabel.c
2637c478bd9Sstevel@tonic-gate  */
2647c478bd9Sstevel@tonic-gate extern void getlabel(void);
2657c478bd9Sstevel@tonic-gate /*
2667c478bd9Sstevel@tonic-gate  * dumpmain.c
2677c478bd9Sstevel@tonic-gate  */
2687c478bd9Sstevel@tonic-gate extern void child_chdir(void);
2697c478bd9Sstevel@tonic-gate extern char *unrawname(char *);
2707c478bd9Sstevel@tonic-gate extern void sigAbort(int);
2717c478bd9Sstevel@tonic-gate extern char *rawname(char *);
2727c478bd9Sstevel@tonic-gate extern char *lf_rawname(char *);
2737c478bd9Sstevel@tonic-gate extern time32_t timeclock(time32_t);
2747c478bd9Sstevel@tonic-gate #ifdef signal
2757c478bd9Sstevel@tonic-gate extern void (*nsignal(int, void (*)(int)))(int);
2767c478bd9Sstevel@tonic-gate #endif
2777c478bd9Sstevel@tonic-gate extern int safe_file_open(const char *file, int mode, int perms);
2787c478bd9Sstevel@tonic-gate extern int safe_device_open(const char *file, int mode, int perms);
2797c478bd9Sstevel@tonic-gate extern FILE *safe_fopen(const char *filename, const char *smode, int perms);
2807c478bd9Sstevel@tonic-gate /*
2817c478bd9Sstevel@tonic-gate  * dumponline.c
2827c478bd9Sstevel@tonic-gate  */
2837c478bd9Sstevel@tonic-gate extern void allocino(void);
2847c478bd9Sstevel@tonic-gate extern void freeino(void);
2857c478bd9Sstevel@tonic-gate extern void saveino(ino_t, struct dinode *);
2867c478bd9Sstevel@tonic-gate extern void resetino(ino_t);
2877c478bd9Sstevel@tonic-gate extern long getigen(ino_t);
2887c478bd9Sstevel@tonic-gate extern int lf_ismounted(char *, char *);
2897c478bd9Sstevel@tonic-gate extern int isoperator(uid_t, gid_t);
2907c478bd9Sstevel@tonic-gate extern int lockfs(char *, char *);
2917c478bd9Sstevel@tonic-gate extern int openi(ino_t, long, char *);
2927c478bd9Sstevel@tonic-gate extern caddr_t mapfile(int, off_t, off_t, int);
2937c478bd9Sstevel@tonic-gate extern void unmapfile(void);
2947c478bd9Sstevel@tonic-gate extern void stattoi(struct stat *, struct dinode *);
2957c478bd9Sstevel@tonic-gate extern void dumpfile(int, caddr_t, off_t, off_t, off_t, int, int);
2967c478bd9Sstevel@tonic-gate extern void activepass(void);
2977c478bd9Sstevel@tonic-gate /*
2987c478bd9Sstevel@tonic-gate  * dumpoptr.c
2997c478bd9Sstevel@tonic-gate  */
3007c478bd9Sstevel@tonic-gate extern int query(char *);
3017c478bd9Sstevel@tonic-gate extern int query_once(char *, int);
3027c478bd9Sstevel@tonic-gate extern void interrupt(int);
3037c478bd9Sstevel@tonic-gate extern void broadcast(char *);
3047c478bd9Sstevel@tonic-gate extern void timeest(int, int);
3057c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/
3067c478bd9Sstevel@tonic-gate extern void msg(const char *, ...);
3077c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/
3087c478bd9Sstevel@tonic-gate extern void msgtail(const char *, ...);
3097c478bd9Sstevel@tonic-gate extern void lastdump(int);
3107c478bd9Sstevel@tonic-gate extern char *getresponse(char *, char *);
3117c478bd9Sstevel@tonic-gate /*
3127c478bd9Sstevel@tonic-gate  * dumptape.c
3137c478bd9Sstevel@tonic-gate  */
3147c478bd9Sstevel@tonic-gate extern void alloctape(void);
3157c478bd9Sstevel@tonic-gate extern void reset(void);
3167c478bd9Sstevel@tonic-gate extern void spclrec(void);
3177c478bd9Sstevel@tonic-gate extern void taprec(uchar_t *, int, int);
3187c478bd9Sstevel@tonic-gate extern void dmpblk(daddr32_t, size_t, off_t);
3197c478bd9Sstevel@tonic-gate extern void toslave(void (*)(ino_t), ino_t);
3207c478bd9Sstevel@tonic-gate extern void doinode(ino_t);
3217c478bd9Sstevel@tonic-gate extern void dospcl(ino_t);
3227c478bd9Sstevel@tonic-gate extern void flushcmds(void);
3237c478bd9Sstevel@tonic-gate extern void flusht(void);
3247c478bd9Sstevel@tonic-gate extern void nextdevice(void);
3257c478bd9Sstevel@tonic-gate extern int isrewind(int);
3267c478bd9Sstevel@tonic-gate extern void trewind(void);
3277c478bd9Sstevel@tonic-gate extern void close_rewind(void);
3287c478bd9Sstevel@tonic-gate extern void changevol(void);
3297c478bd9Sstevel@tonic-gate extern void otape(int);
3307c478bd9Sstevel@tonic-gate extern void dumpabort(void);
3317c478bd9Sstevel@tonic-gate extern void dumpailing(void);
3327c478bd9Sstevel@tonic-gate extern void Exit(int);
3337c478bd9Sstevel@tonic-gate extern void positiontape(char *);
3347c478bd9Sstevel@tonic-gate /*
3357c478bd9Sstevel@tonic-gate  * dumptraverse.c
3367c478bd9Sstevel@tonic-gate  */
3377c478bd9Sstevel@tonic-gate extern void pass(void (*)(struct dinode *), uchar_t *);
3387c478bd9Sstevel@tonic-gate extern void mark(struct dinode *);
3397c478bd9Sstevel@tonic-gate extern void active_mark(struct dinode *);
3407c478bd9Sstevel@tonic-gate extern void markshad(struct dinode *);
3417c478bd9Sstevel@tonic-gate extern void estshad(struct dinode *);
3427c478bd9Sstevel@tonic-gate extern void freeshad();
3437c478bd9Sstevel@tonic-gate extern void add(struct dinode *);
3447c478bd9Sstevel@tonic-gate extern void dirdump(struct dinode *);
3457c478bd9Sstevel@tonic-gate extern void dump(struct dinode *);
3467c478bd9Sstevel@tonic-gate extern void lf_dump(struct dinode *);
3477c478bd9Sstevel@tonic-gate extern void dumpblocks(ino_t);
3487c478bd9Sstevel@tonic-gate extern void bitmap(uchar_t *, int);
3497c478bd9Sstevel@tonic-gate extern struct dinode *getino(ino_t);
3507c478bd9Sstevel@tonic-gate extern void bread(diskaddr_t, uchar_t *, size_t);
3517c478bd9Sstevel@tonic-gate extern int hasshortmeta(struct dinode **ip);
3527c478bd9Sstevel@tonic-gate /*
3537c478bd9Sstevel@tonic-gate  * lftw.c
3547c478bd9Sstevel@tonic-gate  */
3557c478bd9Sstevel@tonic-gate extern int lftw(const char *,
3567c478bd9Sstevel@tonic-gate 	int (*)(const char *, const struct stat *, int), int);
3577c478bd9Sstevel@tonic-gate extern int lf_lftw(const char *,
3587c478bd9Sstevel@tonic-gate 	int (*)(const char *, const struct stat64 *, int), int);
3597c478bd9Sstevel@tonic-gate /*
3607c478bd9Sstevel@tonic-gate  * partial.c
3617c478bd9Sstevel@tonic-gate  */
3627c478bd9Sstevel@tonic-gate extern void partial_check(void);
3637c478bd9Sstevel@tonic-gate extern void lf_partial_check(void);
3647c478bd9Sstevel@tonic-gate extern int partial_mark(int, char **);
3657c478bd9Sstevel@tonic-gate /*
3667c478bd9Sstevel@tonic-gate  * unctime.c
3677c478bd9Sstevel@tonic-gate  */
3687c478bd9Sstevel@tonic-gate extern time_t unctime(char *);
3697c478bd9Sstevel@tonic-gate #else	/* !STDC */
3707c478bd9Sstevel@tonic-gate /*
3717c478bd9Sstevel@tonic-gate  * dumpfstab.c
3727c478bd9Sstevel@tonic-gate  */
3737c478bd9Sstevel@tonic-gate extern void mnttabread();
3747c478bd9Sstevel@tonic-gate extern struct mntent *mnttabsearch();
3757c478bd9Sstevel@tonic-gate extern void setmnttab();
3767c478bd9Sstevel@tonic-gate extern struct mntent *getmnttab();
3777c478bd9Sstevel@tonic-gate /*
3787c478bd9Sstevel@tonic-gate  * dumpitime.c
3797c478bd9Sstevel@tonic-gate  */
3807c478bd9Sstevel@tonic-gate extern char *prdate();
3817c478bd9Sstevel@tonic-gate extern void inititimes();
3827c478bd9Sstevel@tonic-gate extern void getitime();
3837c478bd9Sstevel@tonic-gate extern void putitime();
3847c478bd9Sstevel@tonic-gate extern void est();
3857c478bd9Sstevel@tonic-gate extern time32_t is_fssnap_dump();
3867c478bd9Sstevel@tonic-gate extern void bmapest();
3877c478bd9Sstevel@tonic-gate /*
3887c478bd9Sstevel@tonic-gate  * dumplabel.c
3897c478bd9Sstevel@tonic-gate  */
3907c478bd9Sstevel@tonic-gate extern void getlabel();
3917c478bd9Sstevel@tonic-gate /*
3927c478bd9Sstevel@tonic-gate  * dumpmain.c
3937c478bd9Sstevel@tonic-gate  */
3947c478bd9Sstevel@tonic-gate extern void child_chdir();
3957c478bd9Sstevel@tonic-gate extern char *unrawname();
3967c478bd9Sstevel@tonic-gate extern void sigAbort();
3977c478bd9Sstevel@tonic-gate extern char *rawname();
3987c478bd9Sstevel@tonic-gate extern char *lf_rawname();
3997c478bd9Sstevel@tonic-gate extern time_t timeclock();
4007c478bd9Sstevel@tonic-gate #ifdef signal
4017c478bd9Sstevel@tonic-gate extern void nsignal();
4027c478bd9Sstevel@tonic-gate #endif
4037c478bd9Sstevel@tonic-gate extern int safe_file_open();
4047c478bd9Sstevel@tonic-gate extern int safe_device_open();
4057c478bd9Sstevel@tonic-gate extern FILE *safe_fopen();
4067c478bd9Sstevel@tonic-gate /*
4077c478bd9Sstevel@tonic-gate  * dumponline.c
4087c478bd9Sstevel@tonic-gate  */
4097c478bd9Sstevel@tonic-gate extern void allocino();
4107c478bd9Sstevel@tonic-gate extern void freeino();
4117c478bd9Sstevel@tonic-gate extern void saveino();
4127c478bd9Sstevel@tonic-gate extern void resetino();
4137c478bd9Sstevel@tonic-gate extern long getigen();
4147c478bd9Sstevel@tonic-gate extern int lf_ismounted();
4157c478bd9Sstevel@tonic-gate extern int isoperator();
4167c478bd9Sstevel@tonic-gate extern ulong_t lockfs();
4177c478bd9Sstevel@tonic-gate extern int openi();
4187c478bd9Sstevel@tonic-gate extern caddr_t mapfile();
4197c478bd9Sstevel@tonic-gate extern void unmapfile();
4207c478bd9Sstevel@tonic-gate extern void stattoi();
4217c478bd9Sstevel@tonic-gate extern void dumpfile();
4227c478bd9Sstevel@tonic-gate extern void activepass();
4237c478bd9Sstevel@tonic-gate /*
4247c478bd9Sstevel@tonic-gate  * dumpoptr.c
4257c478bd9Sstevel@tonic-gate  */
4267c478bd9Sstevel@tonic-gate extern int query();
4277c478bd9Sstevel@tonic-gate extern int query_once();
4287c478bd9Sstevel@tonic-gate extern void interrupt();
4297c478bd9Sstevel@tonic-gate extern void broadcast();
4307c478bd9Sstevel@tonic-gate extern void timeest();
4317c478bd9Sstevel@tonic-gate extern void msg();
4327c478bd9Sstevel@tonic-gate extern void msgtail();
4337c478bd9Sstevel@tonic-gate extern void lastdump();
4347c478bd9Sstevel@tonic-gate extern char *getresponse();
4357c478bd9Sstevel@tonic-gate /*
4367c478bd9Sstevel@tonic-gate  * dumptape.c
4377c478bd9Sstevel@tonic-gate  */
4387c478bd9Sstevel@tonic-gate extern void alloctape();
4397c478bd9Sstevel@tonic-gate extern void reset();
4407c478bd9Sstevel@tonic-gate extern void spclrec();
4417c478bd9Sstevel@tonic-gate extern void taprec();
4427c478bd9Sstevel@tonic-gate extern void dmpblk();
4437c478bd9Sstevel@tonic-gate extern void toslave();
4447c478bd9Sstevel@tonic-gate extern void doinode();
4457c478bd9Sstevel@tonic-gate extern void dospcl();
4467c478bd9Sstevel@tonic-gate extern void flushcmds();
4477c478bd9Sstevel@tonic-gate extern void flusht();
4487c478bd9Sstevel@tonic-gate extern void nextdevice();
4497c478bd9Sstevel@tonic-gate extern int isrewind();
4507c478bd9Sstevel@tonic-gate extern void trewind();
4517c478bd9Sstevel@tonic-gate extern void close_rewind();
4527c478bd9Sstevel@tonic-gate extern void changevol();
4537c478bd9Sstevel@tonic-gate extern void otape();
4547c478bd9Sstevel@tonic-gate extern void dumpabort();
4557c478bd9Sstevel@tonic-gate extern void dumpailing();
4567c478bd9Sstevel@tonic-gate extern void Exit();
4577c478bd9Sstevel@tonic-gate extern void positiontape();
4587c478bd9Sstevel@tonic-gate /*
4597c478bd9Sstevel@tonic-gate  * dumptraverse.c
4607c478bd9Sstevel@tonic-gate  */
4617c478bd9Sstevel@tonic-gate extern void pass();
4627c478bd9Sstevel@tonic-gate extern void mark();
4637c478bd9Sstevel@tonic-gate extern void active_mark();
4647c478bd9Sstevel@tonic-gate extern void markshad();
4657c478bd9Sstevel@tonic-gate extern void estshad();
4667c478bd9Sstevel@tonic-gate extern void freeshad();
4677c478bd9Sstevel@tonic-gate extern void add();
4687c478bd9Sstevel@tonic-gate extern void dirdump();
4697c478bd9Sstevel@tonic-gate extern void dump();
4707c478bd9Sstevel@tonic-gate extern void lf_dump();
4717c478bd9Sstevel@tonic-gate extern void dumpblocks();
4727c478bd9Sstevel@tonic-gate extern void bitmap();
4737c478bd9Sstevel@tonic-gate extern struct dinode *getino();
4747c478bd9Sstevel@tonic-gate extern void bread();
4757c478bd9Sstevel@tonic-gate extern int hasshortmeta();
4767c478bd9Sstevel@tonic-gate /*
4777c478bd9Sstevel@tonic-gate  * lftw.c
4787c478bd9Sstevel@tonic-gate  */
4797c478bd9Sstevel@tonic-gate extern int lftw();
4807c478bd9Sstevel@tonic-gate extern int lf_lftw();
4817c478bd9Sstevel@tonic-gate /*
4827c478bd9Sstevel@tonic-gate  * partial.c
4837c478bd9Sstevel@tonic-gate  */
4847c478bd9Sstevel@tonic-gate extern void partial_check();
4857c478bd9Sstevel@tonic-gate extern void lf_partial_check();
4867c478bd9Sstevel@tonic-gate extern int partial_mark();
4877c478bd9Sstevel@tonic-gate /*
4887c478bd9Sstevel@tonic-gate  * unctime.c
4897c478bd9Sstevel@tonic-gate  */
4907c478bd9Sstevel@tonic-gate extern time_t unctime();
4917c478bd9Sstevel@tonic-gate #endif /* __STDC__ */
4937c478bd9Sstevel@tonic-gate /* Insufficiently-featureful system header files... */
4947c478bd9Sstevel@tonic-gate NOTE(ALIGNMENT(mmap, 8))
4977c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
4987c478bd9Sstevel@tonic-gate }
4997c478bd9Sstevel@tonic-gate #endif
5017c478bd9Sstevel@tonic-gate #endif /* _DUMP_H */