|
|
1.1 root 1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)dump.h 5.4 (Berkeley) 2/23/87
7: */
8:
9: #define NI 16
10: #define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
11: #define MAXNINDIR (MAXBSIZE / sizeof(daddr_t))
12:
13: #include <stdio.h>
14: #include <ctype.h>
15: #include <sys/param.h>
16: #include <sys/stat.h>
17: #include <sys/fs.h>
18: #include <sys/inode.h>
19: #include <protocols/dumprestore.h>
20: #include <sys/dir.h>
21: #include <utmp.h>
22: #include <sys/time.h>
23: #include <signal.h>
24: #include <fstab.h>
25:
26: #define MWORD(m,i) (m[(unsigned)(i-1)/NBBY])
27: #define MBIT(i) (1<<((unsigned)(i-1)%NBBY))
28: #define BIS(i,w) (MWORD(w,i) |= MBIT(i))
29: #define BIC(i,w) (MWORD(w,i) &= ~MBIT(i))
30: #define BIT(i,w) (MWORD(w,i) & MBIT(i))
31:
32: int msiz;
33: char *clrmap;
34: char *dirmap;
35: char *nodmap;
36:
37: /*
38: * All calculations done in 0.1" units!
39: */
40:
41: char *disk; /* name of the disk file */
42: char *tape; /* name of the tape file */
43: char *increm; /* name of the file containing incremental information*/
44: char *temp; /* name of the file for doing rewrite of increm */
45: char lastincno; /* increment number of previous dump */
46: char incno; /* increment number */
47: int uflag; /* update flag */
48: int fi; /* disk file descriptor */
49: int to; /* tape file descriptor */
50: int pipeout; /* true => output to standard output */
51: ino_t ino; /* current inumber; used globally */
52: int nsubdir;
53: int newtape; /* new tape flag */
54: int nadded; /* number of added sub directories */
55: int dadded; /* directory added flag */
56: int density; /* density in 0.1" units */
57: long tsize; /* tape size in 0.1" units */
58: long esize; /* estimated tape size, blocks */
59: long asize; /* number of 0.1" units written on current tape */
60: int etapes; /* estimated number of tapes */
61:
62: int notify; /* notify operator flag */
63: int blockswritten; /* number of blocks written on current tape */
64: int tapeno; /* current tape number */
65: time_t tstart_writing; /* when started writing the first tape block */
66: char *processname;
67: struct fs *sblock; /* the file system super block */
68: char buf[MAXBSIZE];
69: long dev_bsize;
70:
71: char *ctime();
72: char *prdate();
73: long atol();
74: int mark();
75: int add();
76: int dirdump();
77: int dump();
78: int tapsrec();
79: int dmpspc();
80: int dsrch();
81: int nullf();
82: char *getsuffix();
83: char *rawname();
84: struct dinode *getino();
85:
86: int interrupt(); /* in case operator bangs on console */
87:
88: #define HOUR (60L*60L)
89: #define DAY (24L*HOUR)
90: #define YEAR (365L*DAY)
91:
92: /*
93: * Exit status codes
94: */
95: #define X_FINOK 0 /* normal exit */
96: #define X_REWRITE 2 /* restart writing from the check point */
97: #define X_ABORT 3 /* abort all of dump; don't attempt checkpointing*/
98:
99: #define NINCREM "/etc/dumpdates" /*new format incremental info*/
100: #define TEMP "/etc/dtmp" /*output temp file*/
101:
102: #define TAPE "/dev/rmt8" /* default tape device */
103: #define DISK "/dev/rrp1g" /* default disk */
104: #define OPGRENT "operator" /* group entry to notify */
105: #define DIALUP "ttyd" /* prefix for dialups */
106:
107: struct fstab *fstabsearch(); /* search in fs_file and fs_spec */
108:
109: /*
110: * The contents of the file NINCREM is maintained both on
111: * a linked list, and then (eventually) arrayified.
112: */
113: struct idates {
114: char id_name[MAXNAMLEN+3];
115: char id_incno;
116: time_t id_ddate;
117: };
118: struct itime{
119: struct idates it_value;
120: struct itime *it_next;
121: };
122: struct itime *ithead; /* head of the list version */
123: int nidates; /* number of records (might be zero) */
124: int idates_in; /* we have read the increment file */
125: struct idates **idatev; /* the arrayfied version */
126: #define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i])
127:
128: /*
129: * We catch these interrupts
130: */
131: int sighup();
132: int sigquit();
133: int sigill();
134: int sigtrap();
135: int sigfpe();
136: int sigkill();
137: int sigbus();
138: int sigsegv();
139: int sigsys();
140: int sigalrm();
141: int sigterm();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.