udftools

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
osta_udf.h
Go to the documentation of this file.
1 /*
2 * osta_udf.h
3 *
4 * This file is based on OSTA UDF(tm) 2.01 (March 15, 2000)
5 * http://www.osta.org
6 *
7 * Copyright (c) 2001-2002 Ben Fennema <bfennema@falcon.csc.calpoly.edu>
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions, and the following disclaimer,
15 * without modification.
16 * 2. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
18 *
19 * Alternatively, this software may be distributed under the terms of the
20 * GNU Public License ("GPL").
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
26 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
40 #include "ecma_167.h"
41
42 #ifndef _OSTA_UDF_H
43 #define _OSTA_UDF_H 1
44
45 /* OSTA CS0 Charspec (UDF 2.01 2.1.2) */
46 #define UDF_CHAR_SET_TYPE 0
47 #define UDF_CHAR_SET_INFO "OSTA Compressed Unicode"
48
49 /* Entity Identifier (UDF 2.01 2.1.5) */
50 /* Identifiers (UDF 2.01 2.1.5.2) */
51 #define UDF_ID_DEVELOPER "*Linux UDFFS"
52 #define UDF_ID_COMPLIANT "*OSTA UDF Compliant"
53 #define UDF_ID_LV_INFO "*UDF LV Info"
54 #define UDF_ID_FREE_EA "*UDF FreeEASpace"
55 #define UDF_ID_FREE_APP_EA "*UDF FreeAppEASpace"
56 #define UDF_ID_DVD_CGMS "*UDF DVD CGMS Info"
57 #define UDF_ID_OS2_EA "*UDF OS/2 EA"
58 #define UDF_ID_OS2_EA_LENGTH "*UDF OS/2 EALength"
59 #define UDF_ID_MAC_VOLUME "*UDF Mac VolumeInfo"
60 #define UDF_ID_MAC_FINDER "*UDF Mac FinderInfo"
61 #define UDF_ID_MAC_UNIQUE "*UDF Mac UniqueIDTable"
62 #define UDF_ID_MAC_RESOURCE "*UDF Mac ResourceFork"
63 #define UDF_ID_VIRTUAL "*UDF Virtual Partition"
64 #define UDF_ID_SPARABLE "*UDF Sparable Partition"
65 #define UDF_ID_ALLOC "*UDF Virtual Alloc Tbl"
66 #define UDF_ID_SPARING "*UDF Sparing Table"
67
68 /* Identifier Suffix (UDF 2.01 2.1.5.3) */
69 #define IS_DF_HARD_WRITE_PROTECT 0x01
70 #define IS_DF_SOFT_WRITE_PROTECT 0x02
71
72 struct UDFIdentSuffix
73 {
74 uint16_t UDFRevision;
75 uint8_t OSClass;
76 uint8_t OSIdentifier;
77 uint8_t reserved[4];
78 } __attribute__ ((packed));
79
80 struct impIdentSuffix
81 {
82 uint8_t OSClass;
83 uint8_t OSIdentifier;
84 uint8_t reserved[6];
85 } __attribute__ ((packed));
86
87 struct appIdentSuffix
88 {
89 uint8_t impUse[8];
90 } __attribute__ ((packed));
91
92 /* Logical Volume Integrity Descriptor (UDF 2.01 2.2.6) */
93 /* Implementation Use (UDF 2.01 2.2.6.4) */
94 struct logicalVolIntegrityDescImpUse
95 {
96 regid impIdent;
97 uint32_t numFiles;
98 uint32_t numDirs;
99 uint16_t minUDFReadRev;
100 uint16_t minUDFWriteRev;
101 uint16_t maxUDFWriteRev;
102 uint8_t impUse[0];
103 } __attribute__ ((packed));
104
105 /* Implementation Use Volume Descriptor (UDF 2.01 2.2.7) */
106 /* Implementation Use (UDF 2.01 2.2.7.2) */
107 struct impUseVolDescImpUse
108 {
109 charspec LVICharset;
110 dstring logicalVolIdent[128];
111 dstring LVInfo1[36];
112 dstring LVInfo2[36];
113 dstring LVInfo3[36];
114 regid impIdent;
115 uint8_t impUse[128];
116 } __attribute__ ((packed));
117
118 struct udfPartitionMap2
119 {
120 uint8_t partitionMapType;
121 uint8_t partitionMapLength;
122 uint8_t reserved1[2];
123 regid partIdent;
124 uint16_t volSeqNum;
125 uint16_t partitionNum;
126 } __attribute__ ((packed));
127
128 /* Virtual Partition Map (UDF 2.01 2.2.8) */
129 struct virtualPartitionMap
130 {
131 uint8_t partitionMapType;
132 uint8_t partitionMapLength;
133 uint8_t reserved1[2];
134 regid partIdent;
135 uint16_t volSeqNum;
136 uint16_t partitionNum;
137 uint8_t reserved2[24];
138 } __attribute__ ((packed));
139
140 /* Sparable Partition Map (UDF 2.01 2.2.9) */
141 struct sparablePartitionMap
142 {
143 uint8_t partitionMapType;
144 uint8_t partitionMapLength;
145 uint8_t reserved1[2];
146 regid partIdent;
147 uint16_t volSeqNum;
148 uint16_t partitionNum;
149 uint16_t packetLength;
150 uint8_t numSparingTables;
151 uint8_t reserved2[1];
152 uint32_t sizeSparingTable;
153 uint32_t locSparingTable[4];
154 } __attribute__ ((packed));
155
156 /* Virtual Allocation Table (UDF 1.5 2.2.10) */
157 struct virtualAllocationTable15
158 {
159 uint32_t vatEntry[0];
160 regid vatIdent;
161 uint32_t previousVATICBLoc;
162 } __attribute__ ((packed));
163
164 #define ICBTAG_FILE_TYPE_VAT15 0x00U
165
166 /* Virtual Allocation Table (UDF 2.01 2.2.10) */
167 struct virtualAllocationTable20
168 {
169 uint16_t lengthHeader;
170 uint16_t lengthImpUse;
171 dstring logicalVolIdent[128];
172 uint32_t previousVATICBLoc;
173 uint32_t numFiles;
174 uint32_t numDirs;
175 uint16_t minUDFReadRev;
176 uint16_t minUDFWriteRev;
177 uint16_t maxUDFWriteRev;
178 uint16_t reserved;
179 uint8_t impUse[0];
180 uint32_t vatEntry[0];
181 } __attribute__ ((packed));
182
183 #define ICBTAG_FILE_TYPE_VAT20 0xF8U
184
185 /* Sparing Table (UDF 2.01 2.2.11) */
186 struct sparingEntry
187 {
188 uint32_t origLocation;
189 uint32_t mappedLocation;
190 } __attribute__ ((packed));
191
192 struct sparingTable
193 {
194 tag descTag;
195 regid sparingIdent;
196 uint16_t reallocationTableLen;
197 uint16_t reserved;
198 uint32_t sequenceNum;
199 struct sparingEntry
200 mapEntry[0];
201 } __attribute__ ((packed));
202
203 /* struct long_ad ICB - ADImpUse (UDF 2.01 2.2.4.3) */
204 struct allocDescImpUse
205 {
206 uint16_t flags;
207 uint8_t impUse[4];
208 } __attribute__ ((packed));
209
210 #define AD_IU_EXT_ERASED 0x0001
211
212 /* Real-Time Files (UDF 2.01 6.11) */
213 #define ICBTAG_FILE_TYPE_REALTIME 0xF9U
214
215 /* Implementation Use Extended Attribute (UDF 2.01 3.3.4.5) */
216 /* FreeEASpace (UDF 2.01 3.3.4.5.1.1) */
217 struct freeEaSpace
218 {
219 uint16_t headerChecksum;
220 uint8_t freeEASpace[0];
221 } __attribute__ ((packed));
222
223 /* DVD Copyright Management Information (UDF 2.01 3.3.4.5.1.2) */
224 struct DVDCopyrightImpUse
225 {
226 uint16_t headerChecksum;
227 uint8_t CGMSInfo;
228 uint8_t dataType;
229 uint8_t protectionSystemInfo[4];
230 } __attribute__ ((packed));
231
232 /* Application Use Extended Attribute (UDF 2.01 3.3.4.6) */
233 /* FreeAppEASpace (UDF 2.01 3.3.4.6.1) */
234 struct freeAppEASpace
235 {
236 uint16_t headerChecksum;
237 uint8_t freeEASpace[0];
238 } __attribute__ ((packed));
239
240 /* UDF Defined System Stream (UDF 2.01 3.3.7) */
241 #define UDF_ID_UNIQUE_ID "*UDF Unique ID Mapping Data"
242 #define UDF_ID_NON_ALLOC "*UDF Non-Allocatable Space"
243 #define UDF_ID_POWER_CAL "*UDF Power Cal Table"
244 #define UDF_ID_BACKUP "*UDF Backup"
245
246 /* Operating System Identifiers (UDF 2.01 6.3) */
247 #define UDF_OS_CLASS_UNDEF 0x00U
248 #define UDF_OS_CLASS_DOS 0x01U
249 #define UDF_OS_CLASS_OS2 0x02U
250 #define UDF_OS_CLASS_MAC 0x03U
251 #define UDF_OS_CLASS_UNIX 0x04U
252 #define UDF_OS_CLASS_WIN9X 0x05U
253 #define UDF_OS_CLASS_WINNT 0x06U
254 #define UDF_OS_CLASS_OS400 0x07U
255 #define UDF_OS_CLASS_BEOS 0x08U
256 #define UDF_OS_CLASS_WINCE 0x09U
257
258 #define UDF_OS_ID_UNDEF 0x00U
259 #define UDF_OS_ID_DOS 0x00U
260 #define UDF_OS_ID_OS2 0x00U
261 #define UDF_OS_ID_MAC 0x00U
262 #define UDF_OS_ID_UNIX 0x00U
263 #define UDF_OS_ID_AIX 0x01U
264 #define UDF_OS_ID_SOLARIS 0x02U
265 #define UDF_OS_ID_HPUX 0x03U
266 #define UDF_OS_ID_IRIX 0x04U
267 #define UDF_OS_ID_LINUX 0x05U
268 #define UDF_OS_ID_MKLINUX 0x06U
269 #define UDF_OS_ID_FREEBSD 0x07U
270 #define UDF_OS_ID_WIN9X 0x00U
271 #define UDF_OS_ID_WINNT 0x00U
272 #define UDF_OS_ID_OS400 0x00U
273 #define UDF_OS_ID_BEOS 0x00U
274 #define UDF_OS_ID_WINCE 0x00U
275
276 #endif /* _OSTA_UDF_H */
virtualPartitionMap::reserved1
uint8_t reserved1[2]
Definition: osta_udf.h:133
virtualAllocationTable20::reserved
uint16_t reserved
Definition: osta_udf.h:178
virtualAllocationTable20::logicalVolIdent
dstring logicalVolIdent[128]
Definition: osta_udf.h:171
udfPartitionMap2::partitionMapLength
uint8_t partitionMapLength
Definition: osta_udf.h:121
DVDCopyrightImpUse::protectionSystemInfo
uint8_t protectionSystemInfo[4]
Definition: osta_udf.h:229
logicalVolIntegrityDescImpUse::impIdent
regid impIdent
Definition: osta_udf.h:96
impUseVolDescImpUse::LVICharset
charspec LVICharset
Definition: osta_udf.h:109
sparingEntry
Definition: osta_udf.h:186
impIdentSuffix::reserved
uint8_t reserved[6]
Definition: osta_udf.h:84
virtualPartitionMap::partitionNum
uint16_t partitionNum
Definition: osta_udf.h:136
sparablePartitionMap::volSeqNum
uint16_t volSeqNum
Definition: osta_udf.h:147
freeAppEASpace
Definition: osta_udf.h:234
freeAppEASpace::freeEASpace
uint8_t freeEASpace[0]
Definition: osta_udf.h:237
sparingTable::mapEntry
struct sparingEntry mapEntry[0]
Definition: osta_udf.h:199
udfPartitionMap2::reserved1
uint8_t reserved1[2]
Definition: osta_udf.h:122
logicalVolIntegrityDescImpUse::numDirs
uint32_t numDirs
Definition: osta_udf.h:98
sparingTable
Definition: osta_udf.h:192
udfPartitionMap2
Definition: osta_udf.h:118
sparablePartitionMap::sizeSparingTable
uint32_t sizeSparingTable
Definition: osta_udf.h:152
sparablePartitionMap::locSparingTable
uint32_t locSparingTable[4]
Definition: osta_udf.h:153
ecma_167.h
DVDCopyrightImpUse
Definition: osta_udf.h:224
sparablePartitionMap::reserved1
uint8_t reserved1[2]
Definition: osta_udf.h:145
impIdentSuffix::OSClass
uint8_t OSClass
Definition: osta_udf.h:82
logicalVolIntegrityDescImpUse::numFiles
uint32_t numFiles
Definition: osta_udf.h:97
udfPartitionMap2::partitionMapType
uint8_t partitionMapType
Definition: osta_udf.h:120
appIdentSuffix
Definition: osta_udf.h:87
sparablePartitionMap
Definition: osta_udf.h:141
virtualAllocationTable20::impUse
uint8_t impUse[0]
Definition: osta_udf.h:179
sparingTable::descTag
tag descTag
Definition: osta_udf.h:194
virtualAllocationTable20::vatEntry
uint32_t vatEntry[0]
Definition: osta_udf.h:180
virtualPartitionMap::partIdent
regid partIdent
Definition: osta_udf.h:134
virtualAllocationTable15
Definition: osta_udf.h:157
virtualPartitionMap::volSeqNum
uint16_t volSeqNum
Definition: osta_udf.h:135
allocDescImpUse::flags
uint16_t flags
Definition: osta_udf.h:206
impUseVolDescImpUse::logicalVolIdent
dstring logicalVolIdent[128]
Definition: osta_udf.h:110
impUseVolDescImpUse::LVInfo1
dstring LVInfo1[36]
Definition: osta_udf.h:111
impUseVolDescImpUse
Definition: osta_udf.h:107
sparablePartitionMap::reserved2
uint8_t reserved2[1]
Definition: osta_udf.h:151
virtualAllocationTable20::lengthImpUse
uint16_t lengthImpUse
Definition: osta_udf.h:170
dstring
uint8_t dstring
Definition: ecma_167.h:63
sparingTable::reallocationTableLen
uint16_t reallocationTableLen
Definition: osta_udf.h:196
impUseVolDescImpUse::impUse
uint8_t impUse[128]
Definition: osta_udf.h:115
virtualAllocationTable15::vatEntry
uint32_t vatEntry[0]
Definition: osta_udf.h:159
impUseVolDescImpUse::impIdent
regid impIdent
Definition: osta_udf.h:114
UDFIdentSuffix
Definition: osta_udf.h:72
logicalVolIntegrityDescImpUse::maxUDFWriteRev
uint16_t maxUDFWriteRev
Definition: osta_udf.h:101
impIdentSuffix
Definition: osta_udf.h:80
sparablePartitionMap::partitionMapLength
uint8_t partitionMapLength
Definition: osta_udf.h:144
UDFIdentSuffix::UDFRevision
uint16_t UDFRevision
Definition: osta_udf.h:74
freeEaSpace
Definition: osta_udf.h:217
sparablePartitionMap::packetLength
uint16_t packetLength
Definition: osta_udf.h:149
allocDescImpUse::impUse
uint8_t impUse[4]
Definition: osta_udf.h:207
virtualAllocationTable20::numFiles
uint32_t numFiles
Definition: osta_udf.h:173
freeEaSpace::freeEASpace
uint8_t freeEASpace[0]
Definition: osta_udf.h:220
virtualPartitionMap::partitionMapLength
uint8_t partitionMapLength
Definition: osta_udf.h:132
impUseVolDescImpUse::LVInfo2
dstring LVInfo2[36]
Definition: osta_udf.h:112
UDFIdentSuffix::OSIdentifier
uint8_t OSIdentifier
Definition: osta_udf.h:76
virtualAllocationTable15::previousVATICBLoc
uint32_t previousVATICBLoc
Definition: osta_udf.h:161
udfPartitionMap2::volSeqNum
uint16_t volSeqNum
Definition: osta_udf.h:124
DVDCopyrightImpUse::CGMSInfo
uint8_t CGMSInfo
Definition: osta_udf.h:227
virtualAllocationTable20::minUDFReadRev
uint16_t minUDFReadRev
Definition: osta_udf.h:175
freeAppEASpace::headerChecksum
uint16_t headerChecksum
Definition: osta_udf.h:236
sparablePartitionMap::partitionNum
uint16_t partitionNum
Definition: osta_udf.h:148
allocDescImpUse
Definition: osta_udf.h:204
DVDCopyrightImpUse::headerChecksum
uint16_t headerChecksum
Definition: osta_udf.h:226
virtualAllocationTable20
Definition: osta_udf.h:167
sparingEntry::mappedLocation
uint32_t mappedLocation
Definition: osta_udf.h:189
UDFIdentSuffix::OSClass
uint8_t OSClass
Definition: osta_udf.h:75
virtualAllocationTable20::lengthHeader
uint16_t lengthHeader
Definition: osta_udf.h:169
virtualAllocationTable15::vatIdent
regid vatIdent
Definition: osta_udf.h:160
sparingTable::sequenceNum
uint32_t sequenceNum
Definition: osta_udf.h:198
udfPartitionMap2::partIdent
regid partIdent
Definition: osta_udf.h:123
virtualAllocationTable20::previousVATICBLoc
uint32_t previousVATICBLoc
Definition: osta_udf.h:172
virtualAllocationTable20::minUDFWriteRev
uint16_t minUDFWriteRev
Definition: osta_udf.h:176
__attribute__
struct UDFIdentSuffix __attribute__((packed))
virtualAllocationTable20::numDirs
uint32_t numDirs
Definition: osta_udf.h:174
freeEaSpace::headerChecksum
uint16_t headerChecksum
Definition: osta_udf.h:219
logicalVolIntegrityDescImpUse::minUDFWriteRev
uint16_t minUDFWriteRev
Definition: osta_udf.h:100
logicalVolIntegrityDescImpUse::minUDFReadRev
uint16_t minUDFReadRev
Definition: osta_udf.h:99
virtualPartitionMap::partitionMapType
uint8_t partitionMapType
Definition: osta_udf.h:131
sparablePartitionMap::partIdent
regid partIdent
Definition: osta_udf.h:146
appIdentSuffix::impUse
uint8_t impUse[8]
Definition: osta_udf.h:89
logicalVolIntegrityDescImpUse
Definition: osta_udf.h:94
sparablePartitionMap::numSparingTables
uint8_t numSparingTables
Definition: osta_udf.h:150
impIdentSuffix::OSIdentifier
uint8_t OSIdentifier
Definition: osta_udf.h:83
sparingTable::sparingIdent
regid sparingIdent
Definition: osta_udf.h:195
virtualAllocationTable20::maxUDFWriteRev
uint16_t maxUDFWriteRev
Definition: osta_udf.h:177
virtualPartitionMap::reserved2
uint8_t reserved2[24]
Definition: osta_udf.h:137
sparablePartitionMap::partitionMapType
uint8_t partitionMapType
Definition: osta_udf.h:143
sparingEntry::origLocation
uint32_t origLocation
Definition: osta_udf.h:188
UDFIdentSuffix::reserved
uint8_t reserved[4]
Definition: osta_udf.h:77
sparingTable::reserved
uint16_t reserved
Definition: osta_udf.h:197
virtualPartitionMap
Definition: osta_udf.h:129
udfPartitionMap2::partitionNum
uint16_t partitionNum
Definition: osta_udf.h:125
DVDCopyrightImpUse::dataType
uint8_t dataType
Definition: osta_udf.h:228
logicalVolIntegrityDescImpUse::impUse
uint8_t impUse[0]
Definition: osta_udf.h:102
impUseVolDescImpUse::LVInfo3
dstring LVInfo3[36]
Definition: osta_udf.h:113