]>
git.wh0rd.org - dump.git/blob - compat/include/protocols/dumprestore.h
2 * Ported to Linux's Second Extended File System as part of the
3 * dump and restore backup suit
4 * Remy Card <card@Linux.EU.Org>, 1994-1997
5 * Stelian Pop <pop@noos.fr>, 1999-2000
6 * Stelian Pop <pop@noos.fr> - AlcĂ´ve <www.alcove.fr>, 2000
8 * $Id: dumprestore.h,v 1.12 2001/03/20 10:02:48 stelian Exp $
12 * Copyright (c) 1980, 1993
13 * The Regents of the University of California. All rights reserved.
14 * (c) UNIX System Laboratories, Inc.
15 * All or some portions of this file are derived from material licensed
16 * to the University of California by American Telephone and Telegraph
17 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
18 * the permission of UNIX System Laboratories, Inc.
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 * 3. All advertising materials mentioning features or use of this software
29 * must display the following acknowledgement:
30 * This product includes software developed by the University of
31 * California, Berkeley and its contributors.
32 * 4. Neither the name of the University nor the names of its contributors
33 * may be used to endorse or promote products derived from this software
34 * without specific prior written permission.
36 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
37 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
40 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
42 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49 #ifndef _PROTOCOLS_DUMPRESTORE_H_
50 #define _PROTOCOLS_DUMPRESTORE_H_
55 * TP_BSIZE is the size of file blocks on the dump tapes.
56 * Note that TP_BSIZE must be a multiple of DEV_BSIZE.
58 * NTREC is the number of TP_BSIZE blocks that are written
59 * in each tape record. HIGHDENSITYTREC is the number of
60 * TP_BSIZE blocks that are written in each tape record on
61 * 6250 BPI or higher density tapes.
63 * TP_NINDIR is the number of indirect pointers in a TS_INODE
64 * or TS_ADDR record. Note that it must be a power of two.
68 #define HIGHDENSITYTREC 32
69 #define TP_NINDIR (TP_BSIZE/2)
73 #define OFS_MAGIC (int)60011
74 #define NFS_MAGIC (int)60012
75 #define CHECKSUM (int)84446
77 typedef u_int32_t dump_ino_t
;
82 int32_t c_type
; /* record type (see below) */
83 int32_t c_date
; /* date of this dump */
84 int32_t c_ddate
; /* date of previous dump */
85 int32_t c_volume
; /* dump volume number */
86 daddr_t c_tapea
; /* logical block of this record */
87 dump_ino_t c_inumber
; /* number of inode */
88 int32_t c_magic
; /* magic number (see above) */
89 int32_t c_checksum
; /* record checksum */
91 struct new_bsd_inode c_dinode
;
93 struct dinode c_dinode
; /* ownership and mode of inode */
95 int32_t c_count
; /* number of valid c_addr entries */
96 char c_addr
[TP_NINDIR
]; /* 1 => data; 0 => hole in inode */
97 char c_label
[LBLSIZE
]; /* dump label */
98 int32_t c_level
; /* level of this dump */
99 char c_filesys
[NAMELEN
]; /* name of dumpped file system */
100 char c_dev
[NAMELEN
]; /* name of dumpped device */
101 char c_host
[NAMELEN
]; /* name of dumpped host */
102 int32_t c_flags
; /* additional information */
103 int32_t c_firstrec
; /* first record on volume */
104 int32_t c_spare
[32]; /* reserved for future uses */
107 #define spcl u_spcl.s_spcl
109 * special record types
111 #define TS_TAPE 1 /* dump tape header */
112 #define TS_INODE 2 /* beginning of file record */
113 #define TS_ADDR 4 /* continuation of file record */
114 #define TS_BITS 3 /* map of inodes on tape */
115 #define TS_CLRI 6 /* map of inodes deleted since last dump */
116 #define TS_END 5 /* end of volume marker */
121 #define DR_NEWHEADER 0x0001 /* new format tape header */
122 #define DR_NEWINODEFMT 0x0002 /* new format inodes on tape */
123 #define DR_COMPRESSED 0x0080 /* dump tape is compressed */
125 /* used for compressed dump tapes */
127 unsigned int compressed
:1;
128 unsigned int flags
:3;
129 unsigned int length
:28;
130 char buf
[0]; /* the data */
133 #endif /* !_DUMPRESTORE_H_ */