Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / volser / dump.h
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
9
10 /*
11 System: Volser
12 Module: dump.h
13 Institution: The Information Technology Center, Carnegie-Mellon University
14
15 */
16
17 #define DUMPVERSION 1
18
19 #define DUMPENDMAGIC 0x3A214B6E
20 #define DUMPBEGINMAGIC 0xB3A11322
21
22 #define D_DUMPHEADER 1
23 #define D_VOLUMEHEADER 2
24 #define D_VNODE 3
25 #define D_DUMPEND 4
26
27 #define D_MAX 20
28
29 #define MAXDUMPTIMES 50
30
31 /* DumpHeader:
32 Each {from,to} pair of time values gives a span of time covered by this dump.
33 Merged dumps may have multiple pairs if there are dumps missing from the merge */
34
35 struct DumpHeader {
36 afs_int32 version;
37 VolumeId volumeId;
38 char volumeName[VNAMESIZE];
39 int nDumpTimes; /* Number of pairs */
40 struct {
41 afs_int32 from, to;
42 } dumpTimes[MAXDUMPTIMES];
43 };
44
45
46 /* Some handshaking constants for volume move */
47 #define SHAKE1 "x"
48 #define SHAKE2 "y"
49 #define SHAKE3 "z"
50 #define SHAKE4 "P"
51 #define SHAKE5 "Q"
52 #define SHAKE_ABORT "!"
53
54 /*
55 * - <length>: variable size length, 0x80=unknown (means that
56 * this section must be parsed to proceed)
57 * - If bit 7 is not set, bits 0-6 are the length
58 * - If bit 7 is set, bits 0-6 tell you how many bytes long the
59 * length is. The length follows immediately in MSB-first order.
60 * - The special value 0x80 means indefinite length.
61 * - 0xfe and 0xff would indicate a single-bit value, with the
62 * value stored in the low-order bit of the length.
63 *
64 * List of known tags in the dump header section (section 0)
65 *
66 * val hex what standard
67 * 1 0x01 D_DUMPHEADER
68 * 2 0x02 D_VOLUMEHEADER
69 * 4 0x04 D_DUMPEND
70 * 'n' 0x6e V_name
71 * 't' 0x74 fromtime, V_backupDate
72 * 'v' 0x76 V_id / V_parentId *
73 * 126 0x7e next tag critical *
74 */
75 /*
76 * List of known tags in the volume header section (section 1)
77 *
78 * val hex what standard
79 * 3 0x03 D_VNODE
80 * 4 0x04 D_DUMPEND
81 * 'A' 0x41 V_RaccessDate
82 * 'C' 0x43 V_creationDate
83 * 'D' 0x44 V_dayUseDate
84 * 'E' 0x45 V_expirationDate
85 * 'M' 0x4d nullstring (motd)
86 * 'O' 0x4f V_offlineMessage
87 * 'U' 0x55 V_updateDate
88 * 'W' 0x57 V_weekUse
89 * 'Z' 0x5a V_dayUse
90 * 'a' 0x61 V_acountNumber *
91 * 'b' 0x62 V_blessed
92 * 'c' 0x63 V_cloneId
93 * 'd' 0x64 V_diskused *
94 * 'f' 0x66 V_filecount *
95 * 'i' 0x69 V_id *
96 * 'm' 0x6d V_minquota *
97 * 'n' 0x6e V_name
98 * 'o' 0x6f V_owner *
99 * 'p' 0x70 V_parentId *
100 * 'q' 0x71 V_maxquota *
101 * 's' 0x73 V_inService
102 * 't' 0x74 V_type
103 * 'u' 0x75 V_uniquifier *
104 * 'v' 0x76 V_stamp.version *
105 * 126 0x7e next tag critical *
106 */
107 /*
108 * List of known tags in the vnode section (section 2)
109 *
110 * val hex what standard
111 * 3 0x03 D_VNODE
112 * 4 0x04 D_DUMPEND
113 * 'A' 0x41 VVnodeDiskACL
114 * 'a' 0x61 author *
115 * 'b' 0x62 modeBits
116 * 'f' 0x66 small file
117 * 'g' 0x67 group *
118 * 'h' 0x68 large file
119 * 'l' 0x6c linkcount
120 * 'm' 0x6d unixModifyTime *
121 * 'o' 0x6f owner *
122 * 'p' 0x70 parent *
123 * 's' 0x73 serverModifyTime *
124 * 't' 0x74 type
125 * 'u' 0x74 lastUsageTime *
126 * 'v' 0x76 dataVersion *
127 * 126 0x7e next tag critical *
128 */