3 * dumpscan - routines for scanning and manipulating AFS volume dumps
5 * Copyright (c) 1998, 2001 Carnegie Mellon University
8 * Permission to use, copy, modify and distribute this software and its
9 * documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation.
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
16 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 * Carnegie Mellon requests users of this software to return to
20 * Software Distribution Coordinator or Software_Distribution@CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
25 * any improvements or extensions that they make and grant Carnegie Mellon
26 * the rights to redistribute these changes.
29 /* dumpfmt.h - Description of AFS dump format */
36 /* AFS dump file format:
37 * All data in AFS dumps is tagged; that is, each data item is preceeded
38 * by a 1-byte tag which identifies what the data item is. There is no
39 * explicit mention of what the data type is, but the type of each possible
40 * data item (and thus, each possible tag) is fixed. Usually this is
41 * a relatively simple, fixed amount of data (byte, short, word), but
42 * sometimes it is more complex.
44 * There is some amount of structure to an AFS volume dump. Basically,
45 * you get a dump header, followed by a volume header, followed by some
46 * vnodes, followed by a dump end. Each of these items (header, vnode,
47 * dump end) consists of a tag, a fixed amount of required information,
48 * and 0 or more tagged attributes (except dump-end, which has no attributes).
50 * Vnodes, in turn, are usually listed in a particular order. First, we
51 * list all the directory vnodes in the volume, in increasing order by
52 * vnode. Then, we list all the file vnodes, again in increasing order.
53 * Directory vnodes must have a complete set of attributes and data, but
54 * in an incremental dump, file vnodes may have no attributes if the vnode
55 * has not changed since the reference date.
57 * The primary purpose of this file is to define the tags and some magic
58 * numbers. There is also some information that is defined in the Transarc
59 * provided header files.
65 #define DUMPBEGINMAGIC 0xb3a11322
66 #define DUMPENDMAGIC 0x3a214b6e
69 /** TOP-LEVEL TAGS **/
70 #define TAG_DUMPHEADER 1
71 #define TAG_VOLHEADER 2
76 /** DUMP HEADER TAGS **/
77 #define DHTAG_VOLNAME 'n'
78 #define DHTAG_VOLID 'v'
79 #define DHTAG_DUMPTIMES 't'
82 /** VOLUME HEADER TAGS **/
83 #define VHTAG_VOLID 'i'
84 #define VHTAG_VERS 'v'
85 #define VHTAG_VOLNAME 'n'
86 #define VHTAG_INSERV 's'
87 #define VHTAG_BLESSED 'b'
88 #define VHTAG_VUNIQ 'u'
89 #define VHTAG_TYPE 't'
90 #define VHTAG_PARENT 'p'
91 #define VHTAG_CLONE 'c'
92 #define VHTAG_MAXQUOTA 'q'
93 #define VHTAG_MINQUOTA 'm'
94 #define VHTAG_DISKUSED 'd'
95 #define VHTAG_FILECNT 'f'
96 #define VHTAG_ACCOUNT 'a'
97 #define VHTAG_OWNER 'o'
98 #define VHTAG_CREAT 'C'
99 #define VHTAG_ACCESS 'A'
100 #define VHTAG_UPDATE 'U'
101 #define VHTAG_EXPIRE 'E'
102 #define VHTAG_BACKUP 'B'
103 #define VHTAG_OFFLINE 'O'
104 #define VHTAG_MOTD 'M'
105 #define VHTAG_WEEKUSE 'W'
106 #define VHTAG_DUDATE 'D'
107 #define VHTAG_DAYUSE 'Z'
111 #define VTAG_TYPE 't'
112 #define VTAG_NLINKS 'l'
113 #define VTAG_DVERS 'v'
114 #define VTAG_CLIENT_DATE 'm'
115 #define VTAG_AUTHOR 'a'
116 #define VTAG_OWNER 'o'
117 #define VTAG_GROUP 'g'
118 #define VTAG_MODE 'b'
119 #define VTAG_PARENT 'p'
120 #define VTAG_SERVER_DATE 's'
122 #define VTAG_DATA 'f'
125 #define AFS_DIR_MAGIC 1234
126 #define AFS_DIR_EPP 64
127 #define AFS_DIR_MAXPAGES 128
128 #define AFS_DIR_NHASH 128
134 char freebitmap[AFS_DIR_EPP/8];
135 char padding[32 - (5 + AFS_DIR_EPP/8)];
139 afs_dir_pagehdr pagehdr;
140 char allomap[AFS_DIR_MAXPAGES];
141 afs_uint16 hash[AFS_DIR_NHASH];
155 afs_dir_pagehdr header;
156 afs_dir_direntry entry[AFS_DIR_EPP];
159 #endif /* _DUMPFMT_H_ */