1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 #include "ecma_167.h"
36
37 #ifndef _OSTA_UDF_H
38 #define _OSTA_UDF_H 1
39
40
41 #define UDF_CHAR_SET_TYPE 0
42 #define UDF_CHAR_SET_INFO "OSTA Compressed Unicode"
43
44
45
46 #define UDF_ID_DEVELOPER "*Linux UDFFS"
47 #define UDF_ID_COMPLIANT "*OSTA UDF Compliant"
48 #define UDF_ID_LV_INFO "*UDF LV Info"
49 #define UDF_ID_FREE_EA "*UDF FreeEASpace"
50 #define UDF_ID_FREE_APP_EA "*UDF FreeAppEASpace"
51 #define UDF_ID_DVD_CGMS "*UDF DVD CGMS Info"
52 #define UDF_ID_OS2_EA "*UDF OS/2 EA"
53 #define UDF_ID_OS2_EA_LENGTH "*UDF OS/2 EALength"
54 #define UDF_ID_MAC_VOLUME "*UDF Mac VolumeInfo"
55 #define UDF_ID_MAC_FINDER "*UDF Mac FinderInfo"
56 #define UDF_ID_MAC_UNIQUE "*UDF Mac UniqueIDTable"
57 #define UDF_ID_MAC_RESOURCE "*UDF Mac ResourceFork"
58 #define UDF_ID_VIRTUAL "*UDF Virtual Partition"
59 #define UDF_ID_SPARABLE "*UDF Sparable Partition"
60 #define UDF_ID_ALLOC "*UDF Virtual Alloc Tbl"
61 #define UDF_ID_SPARING "*UDF Sparing Table"
62 #define UDF_ID_METADATA "*UDF Metadata Partition"
63
64
65 #define IS_DF_HARD_WRITE_PROTECT 0x01
66 #define IS_DF_SOFT_WRITE_PROTECT 0x02
67
68 struct UDFIdentSuffix {
69 __le16 UDFRevision;
70 uint8_t OSClass;
71 uint8_t OSIdentifier;
72 uint8_t reserved[4];
73 } __packed;
74
75 struct impIdentSuffix {
76 uint8_t OSClass;
77 uint8_t OSIdentifier;
78 uint8_t reserved[6];
79 } __packed;
80
81 struct appIdentSuffix {
82 uint8_t impUse[8];
83 } __packed;
84
85
86
87 struct logicalVolIntegrityDescImpUse {
88 struct regid impIdent;
89 __le32 numFiles;
90 __le32 numDirs;
91 __le16 minUDFReadRev;
92 __le16 minUDFWriteRev;
93 __le16 maxUDFWriteRev;
94 uint8_t impUse[0];
95 } __packed;
96
97
98
99 struct impUseVolDescImpUse {
100 struct charspec LVICharset;
101 dstring logicalVolIdent[128];
102 dstring LVInfo1[36];
103 dstring LVInfo2[36];
104 dstring LVInfo3[36];
105 struct regid impIdent;
106 uint8_t impUse[128];
107 } __packed;
108
109 struct udfPartitionMap2 {
110 uint8_t partitionMapType;
111 uint8_t partitionMapLength;
112 uint8_t reserved1[2];
113 struct regid partIdent;
114 __le16 volSeqNum;
115 __le16 partitionNum;
116 } __packed;
117
118
119 struct virtualPartitionMap {
120 uint8_t partitionMapType;
121 uint8_t partitionMapLength;
122 uint8_t reserved1[2];
123 struct regid partIdent;
124 __le16 volSeqNum;
125 __le16 partitionNum;
126 uint8_t reserved2[24];
127 } __packed;
128
129
130 struct sparablePartitionMap {
131 uint8_t partitionMapType;
132 uint8_t partitionMapLength;
133 uint8_t reserved1[2];
134 struct regid partIdent;
135 __le16 volSeqNum;
136 __le16 partitionNum;
137 __le16 packetLength;
138 uint8_t numSparingTables;
139 uint8_t reserved2[1];
140 __le32 sizeSparingTable;
141 __le32 locSparingTable[4];
142 } __packed;
143
144
145 struct metadataPartitionMap {
146 uint8_t partitionMapType;
147 uint8_t partitionMapLength;
148 uint8_t reserved1[2];
149 struct regid partIdent;
150 __le16 volSeqNum;
151 __le16 partitionNum;
152 __le32 metadataFileLoc;
153 __le32 metadataMirrorFileLoc;
154 __le32 metadataBitmapFileLoc;
155 __le32 allocUnitSize;
156 __le16 alignUnitSize;
157 uint8_t flags;
158 uint8_t reserved2[5];
159 } __packed;
160
161
162 struct virtualAllocationTable15 {
163 __le32 VirtualSector[0];
164 struct regid vatIdent;
165 __le32 previousVATICBLoc;
166 } __packed;
167
168 #define ICBTAG_FILE_TYPE_VAT15 0x00U
169
170
171 struct virtualAllocationTable20 {
172 __le16 lengthHeader;
173 __le16 lengthImpUse;
174 dstring logicalVolIdent[128];
175 __le32 previousVATICBLoc;
176 __le32 numFiles;
177 __le32 numDirs;
178 __le16 minReadRevision;
179 __le16 minWriteRevision;
180 __le16 maxWriteRevision;
181 __le16 reserved;
182 uint8_t impUse[0];
183 __le32 vatEntry[0];
184 } __packed;
185
186 #define ICBTAG_FILE_TYPE_VAT20 0xF8U
187
188
189 struct sparingEntry {
190 __le32 origLocation;
191 __le32 mappedLocation;
192 } __packed;
193
194 struct sparingTable {
195 struct tag descTag;
196 struct regid sparingIdent;
197 __le16 reallocationTableLen;
198 __le16 reserved;
199 __le32 sequenceNum;
200 struct sparingEntry
201 mapEntry[0];
202 } __packed;
203
204
205 #define ICBTAG_FILE_TYPE_MAIN 0xFA
206 #define ICBTAG_FILE_TYPE_MIRROR 0xFB
207 #define ICBTAG_FILE_TYPE_BITMAP 0xFC
208
209
210 struct allocDescImpUse {
211 __le16 flags;
212 uint8_t impUse[4];
213 } __packed;
214
215 #define AD_IU_EXT_ERASED 0x0001
216
217
218 #define ICBTAG_FILE_TYPE_REALTIME 0xF9U
219
220
221
222 struct freeEaSpace {
223 __le16 headerChecksum;
224 uint8_t freeEASpace[0];
225 } __packed;
226
227
228 struct DVDCopyrightImpUse {
229 __le16 headerChecksum;
230 uint8_t CGMSInfo;
231 uint8_t dataType;
232 uint8_t protectionSystemInfo[4];
233 } __packed;
234
235
236
237 struct freeAppEASpace {
238 __le16 headerChecksum;
239 uint8_t freeEASpace[0];
240 } __packed;
241
242
243 #define UDF_ID_UNIQUE_ID "*UDF Unique ID Mapping Data"
244 #define UDF_ID_NON_ALLOC "*UDF Non-Allocatable Space"
245 #define UDF_ID_POWER_CAL "*UDF Power Cal Table"
246 #define UDF_ID_BACKUP "*UDF Backup"
247
248
249 #define UDF_OS_CLASS_UNDEF 0x00U
250 #define UDF_OS_CLASS_DOS 0x01U
251 #define UDF_OS_CLASS_OS2 0x02U
252 #define UDF_OS_CLASS_MAC 0x03U
253 #define UDF_OS_CLASS_UNIX 0x04U
254 #define UDF_OS_CLASS_WIN9X 0x05U
255 #define UDF_OS_CLASS_WINNT 0x06U
256 #define UDF_OS_CLASS_OS400 0x07U
257 #define UDF_OS_CLASS_BEOS 0x08U
258 #define UDF_OS_CLASS_WINCE 0x09U
259
260 #define UDF_OS_ID_UNDEF 0x00U
261 #define UDF_OS_ID_DOS 0x00U
262 #define UDF_OS_ID_OS2 0x00U
263 #define UDF_OS_ID_MAC 0x00U
264 #define UDF_OS_ID_MAX_OSX 0x01U
265 #define UDF_OS_ID_UNIX 0x00U
266 #define UDF_OS_ID_AIX 0x01U
267 #define UDF_OS_ID_SOLARIS 0x02U
268 #define UDF_OS_ID_HPUX 0x03U
269 #define UDF_OS_ID_IRIX 0x04U
270 #define UDF_OS_ID_LINUX 0x05U
271 #define UDF_OS_ID_MKLINUX 0x06U
272 #define UDF_OS_ID_FREEBSD 0x07U
273 #define UDF_OS_ID_WIN9X 0x00U
274 #define UDF_OS_ID_WINNT 0x00U
275 #define UDF_OS_ID_OS400 0x00U
276 #define UDF_OS_ID_BEOS 0x00U
277 #define UDF_OS_ID_WINCE 0x00U
278
279 #endif