|
|
1.1 ! root 1: /* (-lgl ! 2: * COHERENT Version 3.0 ! 3: * Copyright (c) 1982, 1990 by Mark Williams Company. ! 4: * All rights reserved. May not be copied without permission. ! 5: -lgl) */ ! 6: /* ! 7: * Dump tapes. ! 8: * A dump tape begins with a header ! 9: * record. This contains the attributes of the ! 10: * tape. ! 11: * The remainder of the tape is filled with ! 12: * arrays of dumpdata records. The map comes first, ! 13: * then all the directories, then all the files. ! 14: */ ! 15: ! 16: #include <sys/types.h> ! 17: #include <sys/dir.h> ! 18: #include <sys/ino.h> ! 19: ! 20: /* ! 21: * Dump tape header. ! 22: * All entries are in cannonical ! 23: * format on the tape. ! 24: */ ! 25: struct dumpheader ! 26: { ! 27: int dh_magic; /* Magic number */ ! 28: ino_t dh_nino; /* # of inodes on file system */ ! 29: time_t dh_bdate; /* Date at beginning of dump */ ! 30: time_t dh_ddate; /* Dump since date */ ! 31: int dh_level; /* Dump level */ ! 32: int dh_reel; /* Reel number in dump */ ! 33: fsize_t dh_nbyte; /* Length of disc */ ! 34: int dh_blocking; /* Blocking factor */ ! 35: char dh_dev[DIRSIZ]; /* Name of dumped device */ ! 36: char dh_fname[6]; /* File system name */ ! 37: char dh_fpack[6]; /* File system pack name */ ! 38: int dh_checksum; /* Byte checksum */ ! 39: }; ! 40: ! 41: #define DH_MAG 0123456 /* Magic number */ ! 42: ! 43: /* ! 44: * Dump data blocks. ! 45: * These are all a big union. ! 46: * They are packed into much larger ! 47: * blocks on the tape. ! 48: */ ! 49: union dumpdata ! 50: { ! 51: struct { ! 52: int dd_type; /* Type = DD_EOT */ ! 53: } dd_st1; ! 54: ! 55: struct { ! 56: int dd_type; /* Type = DD_DATA */ ! 57: ino_t dd_ino; /* Inode number */ ! 58: daddr_t dd_block; /* Block number in file */ ! 59: int dd_size; /* Bytes used in this block */ ! 60: char dd_data[BUFSIZ];/* Data */ ! 61: } dd_st2; ! 62: ! 63: struct { ! 64: int dd_type; /* Type = DD_INO */ ! 65: ino_t dd_ino; /* Inode number */ ! 66: struct dinode dd_dinode; /* On disc inode */ ! 67: } dd_st3; ! 68: ! 69: struct { ! 70: int dd_type; /* Type = DD_MAP */ ! 71: ino_t dd_ino; /* Base inode of this map block */ ! 72: int dd_nmap; /* # of map entries */ ! 73: char dd_map[BUFSIZ]; /* Some map */ ! 74: } dd_st4; ! 75: }; ! 76: ! 77: #define DD_EOT 0 /* End of dump */ ! 78: #define DD_INO 1 /* Inode */ ! 79: #define DD_DATA 2 /* Data block */ ! 80: #define DD_MAP 3 /* Map */ ! 81: ! 82: #define DD_BUSY 01 /* Inode in use */ ! 83: #define DD_DUMP 02 /* Inode dumped */ ! 84: #define DD_DIR 04 /* Inode is a directory */ ! 85: #define DD_DEJA 010 /* Already seen flag (dump) */ ! 86: #define DD_HERE (DD_BUSY|DD_DUMP) /* On the tape */ ! 87: ! 88: /* ! 89: * This structure is used ! 90: * to hold the dump dates in the ! 91: * file `/etc/ddate'. ! 92: */ ! 93: struct idates { ! 94: char id_name[DIRSIZ]; /* Device name */ ! 95: int id_incno; /* Level */ ! 96: time_t id_ddate; /* The date of the dump */ ! 97: }; ! 98: ! 99: #define DDATE "/etc/ddate" /* Date file name */ ! 100: #define DTAPE "/dev/dump" /* Default dump tape */ ! 101: #define DFSYS "" /* No default file system */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.