hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/fs/udf/osta_udf.h
....@@ -1,10 +1,11 @@
11 /*
22 * osta_udf.h
33 *
4
- * This file is based on OSTA UDF(tm) 2.50 (April 30, 2003)
4
+ * This file is based on OSTA UDF(tm) 2.60 (March 1, 2005)
55 * http://www.osta.org
66 *
7
- * Copyright (c) 2001-2004 Ben Fennema <bfennema@falcon.csc.calpoly.edu>
7
+ * Copyright (c) 2001-2004 Ben Fennema
8
+ * Copyright (c) 2017-2019 Pali Rohár <pali@kernel.org>
89 * All rights reserved.
910 *
1011 * Redistribution and use in source and binary forms, with or without
....@@ -32,38 +33,57 @@
3233 * SUCH DAMAGE.
3334 */
3435
36
+/**
37
+ * @file
38
+ * OSTA-UDF defines and structure definitions
39
+ */
40
+
3541 #include "ecma_167.h"
3642
3743 #ifndef _OSTA_UDF_H
3844 #define _OSTA_UDF_H 1
3945
40
-/* OSTA CS0 Charspec (UDF 2.50 2.1.2) */
46
+/* OSTA CS0 Charspec (UDF 2.60 2.1.2) */
4147 #define UDF_CHAR_SET_TYPE 0
4248 #define UDF_CHAR_SET_INFO "OSTA Compressed Unicode"
4349
44
-/* Entity Identifier (UDF 2.50 2.1.5) */
45
-/* Identifiers (UDF 2.50 2.1.5.2) */
50
+/* Entity Identifier (UDF 2.60 2.1.5) */
51
+/* Identifiers (UDF 2.60 2.1.5.2) */
52
+/* Implementation Use Extended Attribute (UDF 2.60 3.3.4.5) */
53
+/* Virtual Allocation Table (UDF 1.50 2.2.10) */
54
+/* Logical Volume Extended Information (UDF 1.50 Errata, DCN 5003, 3.3.4.5.1.3) */
55
+/* OS2EA (UDF 1.50 3.3.4.5.3.1) */
56
+/* MacUniqueIDTable (UDF 1.50 3.3.4.5.4.3) */
57
+/* MacResourceFork (UDF 1.50 3.3.4.5.4.4) */
4658 #define UDF_ID_DEVELOPER "*Linux UDFFS"
4759 #define UDF_ID_COMPLIANT "*OSTA UDF Compliant"
4860 #define UDF_ID_LV_INFO "*UDF LV Info"
4961 #define UDF_ID_FREE_EA "*UDF FreeEASpace"
5062 #define UDF_ID_FREE_APP_EA "*UDF FreeAppEASpace"
5163 #define UDF_ID_DVD_CGMS "*UDF DVD CGMS Info"
64
+#define UDF_ID_VAT_LVEXTENSION "*UDF VAT LVExtension"
5265 #define UDF_ID_OS2_EA "*UDF OS/2 EA"
5366 #define UDF_ID_OS2_EA_LENGTH "*UDF OS/2 EALength"
5467 #define UDF_ID_MAC_VOLUME "*UDF Mac VolumeInfo"
5568 #define UDF_ID_MAC_FINDER "*UDF Mac FinderInfo"
5669 #define UDF_ID_MAC_UNIQUE "*UDF Mac UniqueIDTable"
5770 #define UDF_ID_MAC_RESOURCE "*UDF Mac ResourceFork"
71
+#define UDF_ID_OS400_DIRINFO "*UDF OS/400 DirInfo"
5872 #define UDF_ID_VIRTUAL "*UDF Virtual Partition"
5973 #define UDF_ID_SPARABLE "*UDF Sparable Partition"
6074 #define UDF_ID_ALLOC "*UDF Virtual Alloc Tbl"
6175 #define UDF_ID_SPARING "*UDF Sparing Table"
6276 #define UDF_ID_METADATA "*UDF Metadata Partition"
6377
64
-/* Identifier Suffix (UDF 2.50 2.1.5.3) */
65
-#define IS_DF_HARD_WRITE_PROTECT 0x01
66
-#define IS_DF_SOFT_WRITE_PROTECT 0x02
78
+/* Identifier Suffix (UDF 2.60 2.1.5.3) */
79
+#define DOMAIN_FLAGS_HARD_WRITE_PROTECT 0x01
80
+#define DOMAIN_FLAGS_SOFT_WRITE_PROTECT 0x02
81
+
82
+struct domainIdentSuffix {
83
+ __le16 UDFRevision;
84
+ uint8_t domainFlags;
85
+ uint8_t reserved[5];
86
+} __packed;
6787
6888 struct UDFIdentSuffix {
6989 __le16 UDFRevision;
....@@ -75,15 +95,15 @@
7595 struct impIdentSuffix {
7696 uint8_t OSClass;
7797 uint8_t OSIdentifier;
78
- uint8_t reserved[6];
98
+ uint8_t impUse[6];
7999 } __packed;
80100
81101 struct appIdentSuffix {
82102 uint8_t impUse[8];
83103 } __packed;
84104
85
-/* Logical Volume Integrity Descriptor (UDF 2.50 2.2.6) */
86
-/* Implementation Use (UDF 2.50 2.2.6.4) */
105
+/* Logical Volume Integrity Descriptor (UDF 2.60 2.2.6) */
106
+/* Implementation Use (UDF 2.60 2.2.6.4) */
87107 struct logicalVolIntegrityDescImpUse {
88108 struct regid impIdent;
89109 __le32 numFiles;
....@@ -94,8 +114,8 @@
94114 uint8_t impUse[0];
95115 } __packed;
96116
97
-/* Implementation Use Volume Descriptor (UDF 2.50 2.2.7) */
98
-/* Implementation Use (UDF 2.50 2.2.7.2) */
117
+/* Implementation Use Volume Descriptor (UDF 2.60 2.2.7) */
118
+/* Implementation Use (UDF 2.60 2.2.7.2) */
99119 struct impUseVolDescImpUse {
100120 struct charspec LVICharset;
101121 dstring logicalVolIdent[128];
....@@ -115,7 +135,7 @@
115135 __le16 partitionNum;
116136 } __packed;
117137
118
-/* Virtual Partition Map (UDF 2.50 2.2.8) */
138
+/* Virtual Partition Map (UDF 2.60 2.2.8) */
119139 struct virtualPartitionMap {
120140 uint8_t partitionMapType;
121141 uint8_t partitionMapLength;
....@@ -126,7 +146,7 @@
126146 uint8_t reserved2[24];
127147 } __packed;
128148
129
-/* Sparable Partition Map (UDF 2.50 2.2.9) */
149
+/* Sparable Partition Map (UDF 2.60 2.2.9) */
130150 struct sparablePartitionMap {
131151 uint8_t partitionMapType;
132152 uint8_t partitionMapLength;
....@@ -141,7 +161,7 @@
141161 __le32 locSparingTable[4];
142162 } __packed;
143163
144
-/* Metadata Partition Map (UDF 2.4.0 2.2.10) */
164
+/* Metadata Partition Map (UDF 2.60 2.2.10) */
145165 struct metadataPartitionMap {
146166 uint8_t partitionMapType;
147167 uint8_t partitionMapLength;
....@@ -160,14 +180,14 @@
160180
161181 /* Virtual Allocation Table (UDF 1.5 2.2.10) */
162182 struct virtualAllocationTable15 {
163
- __le32 VirtualSector[0];
183
+ __le32 vatEntry[0];
164184 struct regid vatIdent;
165185 __le32 previousVATICBLoc;
166186 } __packed;
167187
168188 #define ICBTAG_FILE_TYPE_VAT15 0x00U
169189
170
-/* Virtual Allocation Table (UDF 2.50 2.2.11) */
190
+/* Virtual Allocation Table (UDF 2.60 2.2.11) */
171191 struct virtualAllocationTable20 {
172192 __le16 lengthHeader;
173193 __le16 lengthImpUse;
....@@ -175,9 +195,9 @@
175195 __le32 previousVATICBLoc;
176196 __le32 numFiles;
177197 __le32 numDirs;
178
- __le16 minReadRevision;
179
- __le16 minWriteRevision;
180
- __le16 maxWriteRevision;
198
+ __le16 minUDFReadRev;
199
+ __le16 minUDFWriteRev;
200
+ __le16 maxUDFWriteRev;
181201 __le16 reserved;
182202 uint8_t impUse[0];
183203 __le32 vatEntry[0];
....@@ -185,7 +205,7 @@
185205
186206 #define ICBTAG_FILE_TYPE_VAT20 0xF8U
187207
188
-/* Sparing Table (UDF 2.50 2.2.12) */
208
+/* Sparing Table (UDF 2.60 2.2.12) */
189209 struct sparingEntry {
190210 __le32 origLocation;
191211 __le32 mappedLocation;
....@@ -201,12 +221,12 @@
201221 mapEntry[0];
202222 } __packed;
203223
204
-/* Metadata File (and Metadata Mirror File) (UDF 2.50 2.2.13.1) */
224
+/* Metadata File (and Metadata Mirror File) (UDF 2.60 2.2.13.1) */
205225 #define ICBTAG_FILE_TYPE_MAIN 0xFA
206226 #define ICBTAG_FILE_TYPE_MIRROR 0xFB
207227 #define ICBTAG_FILE_TYPE_BITMAP 0xFC
208228
209
-/* struct struct long_ad ICB - ADImpUse (UDF 2.50 2.2.4.3) */
229
+/* struct long_ad ICB - ADImpUse (UDF 2.60 2.2.4.3) */
210230 struct allocDescImpUse {
211231 __le16 flags;
212232 uint8_t impUse[4];
....@@ -214,17 +234,17 @@
214234
215235 #define AD_IU_EXT_ERASED 0x0001
216236
217
-/* Real-Time Files (UDF 2.50 6.11) */
237
+/* Real-Time Files (UDF 2.60 6.11) */
218238 #define ICBTAG_FILE_TYPE_REALTIME 0xF9U
219239
220
-/* Implementation Use Extended Attribute (UDF 2.50 3.3.4.5) */
221
-/* FreeEASpace (UDF 2.50 3.3.4.5.1.1) */
240
+/* Implementation Use Extended Attribute (UDF 2.60 3.3.4.5) */
241
+/* FreeEASpace (UDF 2.60 3.3.4.5.1.1) */
222242 struct freeEaSpace {
223243 __le16 headerChecksum;
224244 uint8_t freeEASpace[0];
225245 } __packed;
226246
227
-/* DVD Copyright Management Information (UDF 2.50 3.3.4.5.1.2) */
247
+/* DVD Copyright Management Information (UDF 2.60 3.3.4.5.1.2) */
228248 struct DVDCopyrightImpUse {
229249 __le16 headerChecksum;
230250 uint8_t CGMSInfo;
....@@ -232,20 +252,35 @@
232252 uint8_t protectionSystemInfo[4];
233253 } __packed;
234254
235
-/* Application Use Extended Attribute (UDF 2.50 3.3.4.6) */
236
-/* FreeAppEASpace (UDF 2.50 3.3.4.6.1) */
255
+/* Logical Volume Extended Information (UDF 1.50 Errata, DCN 5003, 3.3.4.5.1.3) */
256
+struct LVExtensionEA {
257
+ __le16 headerChecksum;
258
+ __le64 verificationID;
259
+ __le32 numFiles;
260
+ __le32 numDirs;
261
+ dstring logicalVolIdent[128];
262
+} __packed;
263
+
264
+/* Application Use Extended Attribute (UDF 2.60 3.3.4.6) */
265
+/* FreeAppEASpace (UDF 2.60 3.3.4.6.1) */
237266 struct freeAppEASpace {
238267 __le16 headerChecksum;
239268 uint8_t freeEASpace[0];
240269 } __packed;
241270
242
-/* UDF Defined System Stream (UDF 2.50 3.3.7) */
271
+/* UDF Defined System Stream (UDF 2.60 3.3.7) */
243272 #define UDF_ID_UNIQUE_ID "*UDF Unique ID Mapping Data"
244273 #define UDF_ID_NON_ALLOC "*UDF Non-Allocatable Space"
245274 #define UDF_ID_POWER_CAL "*UDF Power Cal Table"
246275 #define UDF_ID_BACKUP "*UDF Backup"
247276
248
-/* Operating System Identifiers (UDF 2.50 6.3) */
277
+/* UDF Defined Non-System Streams (UDF 2.60 3.3.8) */
278
+#define UDF_ID_MAC_RESOURCE_FORK_STREAM "*UDF Macintosh Resource Fork"
279
+/* #define UDF_ID_OS2_EA "*UDF OS/2 EA" */
280
+#define UDF_ID_NT_ACL "*UDF NT ACL"
281
+#define UDF_ID_UNIX_ACL "*UDF UNIX ACL"
282
+
283
+/* Operating System Identifiers (UDF 2.60 6.3) */
249284 #define UDF_OS_CLASS_UNDEF 0x00U
250285 #define UDF_OS_CLASS_DOS 0x01U
251286 #define UDF_OS_CLASS_OS2 0x02U
....@@ -270,6 +305,7 @@
270305 #define UDF_OS_ID_LINUX 0x05U
271306 #define UDF_OS_ID_MKLINUX 0x06U
272307 #define UDF_OS_ID_FREEBSD 0x07U
308
+#define UDF_OS_ID_NETBSD 0x08U
273309 #define UDF_OS_ID_WIN9X 0x00U
274310 #define UDF_OS_ID_WINNT 0x00U
275311 #define UDF_OS_ID_OS400 0x00U