revert between 56095 -> 55830 in arch
[AROS.git] / rom / filesys / cdfs / udf.h
blobe30ab418a7e5eeb05ae92d40bea61ed1b397e5e0
1 /*
2 * Copyright (C) 2013, The AROS Development Team
3 * All right reserved.
4 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
6 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
7 */
9 #ifndef UDF_H
10 #define UDF_H
12 #include <exec/types.h>
14 /* UDF 1.5 support, based off of the OSTA subset of ECMA-167
15 * Data structures for Plain, Spare, and VAT filesystems
19 typedef UBYTE Uint8;
20 typedef BYTE Int8;
21 typedef struct { USHORT le16; } Uint16;
22 typedef struct { USHORT le16; } Int16;
23 typedef struct { ULONG le32; } Uint32;
24 typedef struct { ULONG le32; } Int32;
25 typedef struct { UQUAD le32; } Uint64;
26 typedef struct { UQUAD le32; } Int64;
28 typedef struct osta_compressed {
29 Uint8 CompressionID;
30 #define OSTA_COMPRESSIONID_8BIT 8 // UTF-8 stream
31 #define OSTA_COMPRESSIONID_16BIT 16 // UTF-16 stream
32 UBYTE Stream[0];
33 } osta_compressed;
35 typedef struct charspec {
36 Uint8 CharacterSetType;
37 #define UDF_CS0 0 /* UDF OSTA Compressed Unicode */
38 #define UDF_CS1 1 /* ECMA-6 (ISO/IEC 10646-1) */
39 #define UDF_CS2 2 /* ECMA-119 file identifiers:
40 * 0123456789._
41 * ABCDEFGHIJKLMNOPQRSTUVWXYZ
43 #define UDF_CS3 3 /* ISO/IEC 9945-1:
44 * 0123456789._-
45 * abcdefghijklmnopqrstuvwxyz
46 * ABCDEFGHIJKLMNOPQRSTUVWXYZ
48 #define UDF_CS4 4 /* International ECMA-6 */
49 #define UDF_CS5 5 /* ECMA-94 (Latin-1) */
50 #define UDF_CS6 6 /* ECMA-35 + ECMA-48 */
51 #define UDF_CS7 7 /* EMCA-35 + ECMA-48 + their extension characters */
52 #define UDF_CS8 8 /* Portable set:
53 * 0123456789._-!#$%&'()^`{}~
54 * abcdefghijklmnopqrstuvwxyz
55 * ABCDEFGHIJKLMNOPQRSTUVWXYZ
57 UBYTE CharacterSetInfo[63];
58 #define UDF_CS0_OSTA_INFORMATION "OSTA Compressed Unicode"
59 /* CS0 - Valid graphic characters
60 * CS1 - Valid graphic characters
61 * CS2 - ZERO
62 * CS3 - ZERO
63 * CS4 - ZERO
64 * CS5 - ZERO
65 * CS6 - Valid graphic characters
66 * CS7 - Valid graphic characters
67 * CS8 - ZERO
69 } charspec __packed;
70 // UDF 1.02 calls 'charspec' 'Charspec'
71 #define Charspec charspec
73 typedef struct dstring {
74 Uint8 Length;
75 UBYTE Data[0];
76 } dstring __packed;
78 typedef struct timestamp {
79 Uint16 TypeAndZone;
80 #define UDF_TZ_TYPE_of(x) (((x) >> 12) & 0xf)
81 #define UDF_TZ_TYPE_UCT 0
82 #define UDF_TZ_TYPE_LOCAL 1
83 #define UDF_TZ_TYPE_UNKNOWN 2
84 #define UDF_TZ_of(x) (((x) & 0x7ff) | (((x) >> 11) * 0xf800))
85 #define UDF_TZ_UNSPEC -2047
86 Int16 Year; // 1 - 9999
87 Uint8 Month; // 1 - 12
88 Uint8 Day; // 1 - 31
89 Uint8 Hour; // 0 - 23
90 Uint8 Minute; // 0 - 59
91 Uint8 Second; // 0 - 59
92 Uint8 Centiseconds; // 0 - 99
93 Uint8 HundredsofMicrosecs; // 0 - 99
94 Uint8 Microseconds; // 0 - 99
95 } timestamp __packed;
97 struct regid {
98 Uint8 Flags;
99 #define UDF_REGID_DIRTY (1 << 0)
100 #define UDF_REGID_PROTECTED (1 << 1)
101 UBYTE Identifier[23];
102 union {
103 UBYTE Suffix[8];
104 struct DomainIdentifierSuffix {
105 Uint16 UDFRevision;
106 Uint8 DomainFlags;
107 #define UDF_REGID_DOMAINFLAGS_WPROTECT_HARD (1 << 0)
108 #define UDF_REGID_DOMAINFLAGS_WPROTECT_SOFT (1 << 1)
109 UBYTE Reserved[5];
110 } DomainSuffix;
111 struct UDFIdentifierSuffix {
112 Uint16 UDFRevision;
113 Uint8 OSClass;
114 #define UTF_OSCLASS_UNDEFINED 0
115 #define UTF_OSCLASS_DOS 1
116 #define UTF_OSCLASS_OS2 2
117 #define UTF_OSCLASS_MACOS 3
118 #define UTF_OSCLASS_UNIX 4
119 #define UTF_OSCLASS_WIN9X 5
120 #define UTF_OSCLASS_WINNT 6
121 #define UTF_OSCLASS_OS400 7
122 #define UTF_OSCLASS_BEOS 8
123 #define UTF_OSCLASS_WINCE 9
124 Uint8 OSIdentifier;
125 UBYTE Reserved[4];
126 } UDFSuffix;
127 struct ImplentationIdentifierSuffix {
128 Uint8 OSClass;
129 Uint8 OSIdentifier;
130 UBYTE ImplementationUse[6];
131 } ImplementationSuffix;
133 } regid __packed;
135 // UDF 1.02 calls 'regid' 'EntityID' (following ISO 13346 1/7.4 naming)
136 #define EnityID regid
139 typedef struct extent_ad {
140 Uint32 Length;
141 Uint32 Location;
142 } extent_ad __packed;
144 typedef struct tag {
145 Uint16 TagIdentifier;
146 #define UDF_TAG_PRIMARY_VOLUME 1
147 #define UDF_TAG_ANCHOR_VOLUME_PTR 2
148 #define UDF_TAG_VOLUME_PTR 3
150 #define UDF_TAG_PARTITION 5
151 #define UDF_TAG_LOGICAL_VOLUME 6
152 #define UDF_TAG_UNALLOCATED_SPACE 7
153 #define UDF_TAG_TERMINATING 8
154 #define UDF_TAG_LOGICAL_VOLUME_INT 9
155 Uint16 DescriptorVersion; /* 2 = NSR02, 3 = NSR03 */
156 Uint8 TagChecksum; /* Checksum of bytes 0-3 & 5-15 mod 256 */
157 UBYTE Reserved[1];
158 Uint16 TagSerialNumber;
159 Uint16 DescriptorCRC; /* CRC-ITU-T (x^16 + x^12 + x^5 + 1) */
160 Uint16 DescriptorCRCLength;
161 UInt32 TagLocation; /* Extent of this tag */
162 } tag __packed;
164 /****************** Volume & Partitions ******************/
166 struct udfVolume {
167 Uint8 Type; /* 0 0 0 */
168 UBYTE Id[5]; /* BEA01, BOOT2, NSR02, NSR03, TEA01 */
169 Uint8 Version; /* 1 1 1 */
170 union {
171 UBYTE Data[2041];
172 struct UDF_VolumeDescriptor_BOOT2 {
173 UBYTE Reserved[1];
174 regid ArchitectureType;
175 regid BootIdentifier;
176 Uint32 BootExtentLocation;
177 Uint32 BootExtentLength;
178 Uint64 LoadAddress;
179 Uint64 StartAddress;
180 timestamp CreationTime;
181 Uint16 Flags;
182 #define UDF_BOOT2_IGNORE (1 << 0)
183 UBYTE Reserved[32];
184 UBYTE BootUse[1906];
185 } BOOT2;
186 struct { } BEA01;
187 struct { } TEA01;
188 struct { } NSR02;
189 struct { } NSR03;
190 } __packed;
192 struct udfPrimaryVolume {
193 tag Tag;
194 Uint32 VolumeDescriptorSequenceNumber;
195 Uint32 PrimaryVolumeDescriptorNumber;
196 union {
197 dstring VolumeIdentifier;
198 UBYTE VolumeIdentifier_[32];
200 Uint16 VolumeSequenceNumber;
201 Uint16 MaximumVolumeSequenceNumber;
202 Uint16 InterchangeLevel;
203 #define UDF_VOLUME_INTERCHANGE_SINGLE 2
204 #define UDF_VOLUME_INTERCHANGE_MULTI 3
205 Uint16 MaximumInterchangeLevel;
206 Uint32 CharacterSetList;
207 #define UDF_VOLUME_CHARACTERSETLIST (1 << 0) // This is the ONLY value allowed!
208 Uint32 MaximumCharacterSetList;
209 union {
210 dstring VolumeSetIdentifier;
211 UBYTE VolumeSetIdentifier_[128];
213 charspec DescriptorCharacterSet;
214 charspec ExplanatoryCharacterSet;
215 extent_ad VolumeAbstract;
216 extent_ad VolumeCopyright;
217 regid ApplicationIdentifier;
218 timestamp RecordingDateandTime;
219 regid ImplementationIdentifier;
220 UBYTE ImplementationUse[64];
221 Uint32 PredecessorVolumeDescriptorSequenceLocation;
222 Uint16 Flags;
223 #define UDF_PRIMARY_VOLUME_COMMON (1 << 0)
224 UBYTE Reserved[22];
225 } __packed;
227 struct udfAnchorVolumePointer {
228 tag Tag;
229 extent_ad MainVolumeDescriptorSequenceExtent;
230 extent_ad ReserveVolumeDescriptorSequenceExtent;
231 UBYTE Reserved[480];
232 } __packed;
234 struct udfVolumePointer {
235 tag Tag;
236 Uint32 VolumeSequenceNumber;
237 extent_ad NextVolumeExtent;
238 UBYTE Reserved[484];
239 } __packed;
241 struct udfPartition {
242 tag Tag;
243 Uint32 VolumeSequenceNumber;
244 Uint16 Flags;
245 #define UDF_PARTITION_FLAGS_ALLOCATED (1 << 0)
246 Uint16 Number;
247 regid Contents; /* "+FDC01" - ECMA-107
248 * "+CD001" - ECMA-119
249 * "+CDW02" - ECMA-168
250 * "+NSR02" - ECMA-167/2
251 * "+NSR03" - ECMA-167
253 UBYTE ContentsUse[128];
254 Uint32 AccessType;
255 #define UDF_PARTITION_ACCESSTYPE_RO 1 /* Read only */
256 #define UDF_PARTITION_ACCESSTYPE_WORM 2 /* Write once */
257 #define UDF_PARTITION_ACCESSTYPE_REW 3 /* Read/Erase/Write */
258 #define UDF_PARTITION_ACCESSTYPE_RW 4 /* Read/Write */
259 Uint32 StartingLocation;
260 Uint32 Length;
261 regid ImplementationIdentifier;
262 UBYTE ImplementationUse[128];
263 UBYTE Reserved[156];
264 } __packed;
266 struct udfLogicalVolume {
267 tag Tag;
268 Uint32 VolumeDescriptorSequenceNumber;
269 charspec DescriptorCharacterSet;
270 union {
271 dstring Identifier;
272 UBYTE Identifier_[128];
274 Uint32 LogicalBlockSize;
275 regid DomainIdentifier;
276 UBYTE LogicalVolumeContentsUse[16];
277 Uint32 MapTableLength; /* MT_L */
278 Uint32 NumberOfParititionMaps;
279 regid ImplementationIdentifier;
280 UBYTE ImplementationUse[128];
281 extent_ad IntegritySequenceExtent;
282 UBYTE PartitionMaps[0];
283 } __packed;
285 struct udfPartitionMap {
286 Uint8 Type;
287 #define UDF_PARTITIONMAP_TYPE_1 1
288 #define UDF_PARTITIONMAP_TYPE_2 2
289 Uint8 Length;
290 union {
291 UBYTE Data[0];
292 struct {
293 Uint16 VolumeSequenceNumber;
294 Uint16 PartitionNumber;
295 } Type_1;
296 struct {
297 UBYTE Reserved[2];
298 regid PartitionTypeIdentifier;
299 Uint16 VolumeSequenceNumber;
300 Uint16 PartitionNumber;
301 UBYTE Reserved[24];
302 } Type_2;
304 } __packed;
306 struct udfSparingTable {
307 tag Tag;
308 regid Identifier;
309 Uint16 MapEntries;
310 UBYTE Reserved[2];
311 Uint32 SequenceNumber;
312 struct udfSparingMapEntry {
313 Uint32 OriginalLocation;
314 #define UDF_MAPENTRY_AVAILABLE 0xffffffff
315 #define UDF_MAPENTRY_DEFECTIVE 0xfffffff0
316 Uint32 MappedLocation;
317 } MapEntry[0];
320 struct udfUnallocatedSpaceDesc {
321 tag Tag;
322 Uint32 VolumeDescriptorSequenceNumber;
323 Uint32 NumberofAlloctionDescriptors;
324 extent_ad AlloctionDescriptor[0];
325 } __packed;
327 struct udfTerminating {
328 tag Tag;
329 UBYTE Reserved[496];
330 } __packed;
332 struct udfLogicalVolumeIntegrityDesc {
333 tag Tag;
334 timestamp RecordingDateandTime;
335 Uint32 IntegrityType;
336 #define UDF_LOGICALVOLUMEINTEGRITY_TYPE_OPEN 0
337 #define UDF_LOGICALVOLUMEINTEGRITY_TYPE_CLOSE 1
338 extent_ad NextIntegrityExtent;
339 UBYTE LogicalVolumeContentsUse[32];
340 Uint32 NumberOfPartitions;
341 Uint32 LengthOfImplementationUse;
342 Uint32 Data[0]; /* Free Space Table, Size Table, Impl. Use */
343 } __packed;
345 struct udfLogicalVolumeIntegrityImplementationUse {
346 regid ImplementationID;
347 Uint32 NumberofFiles;
348 Uint32 NumberofDirectories;
349 Uint16 MinimumUDFReadRevision;
350 Uint16 MinimumUDFWriteRevision;
351 Uint16 MaximumUDFWriteRevision;
352 UBYTE ImplementationUse[0];
353 } __packed;
355 struct udfImpUseVolume {
356 tag Tag;
357 Uint32 VolumeDescriptorSequenceNumber;
358 regid ImplementationIdentifier;
359 union {
360 UBYTE ImplementationUse[460];
361 struct LVInformation {
362 charspec LVICharset;
363 union {
364 dstring LogicalVolumeIdentifier;
365 UBYTE LogicalVolumeIdentifier_[128];
367 union {
368 dstring LVInfo1;
369 UBYTE LVInfo1_[36];
371 union {
372 dstring LVInfo2;
373 UBYTE LVInfo2_[36];
375 union {
376 dstring LVInfo3;
377 UBYTE LVInfo3_[36];
379 regid ImplementationId;
380 UBYTE ImplementationUse[128];
381 } LVInformation;
383 } __packed;
387 /****************** Filesystem ***************************/
389 typedef struct lb_addr {
390 Uint32 LogicalBlock;
391 Uint16 Partition;
392 } lb_addr __packed;
394 typedef struct short_ad {
395 Uint32 TypeLength;
396 #define UDF_SHORT_AD_LENGTH_of(x) ((x) & 0x3fffffff)
397 #define UDF_SHORT_AD_TYPE_of(x) (((x) >> 30) & 3)
398 #define UDF_SHORT_AD_TYPE_RECORDED 0
399 #define UDF_SHORT_AD_TYPE_ALLOCATED 1
400 #define UDF_SHORT_AD_TYPE_FREE 2
401 #define UDF_SHORT_AD_TYPE_NEXT 3
402 Uint32 ExtentLocation;
403 } short_ad __packed;
405 typedef struct long_ad {
406 Uint32 ExtentLength;
407 lb_addr ExtentLocation;
408 union {
409 UBYTE ImplementationUse[6];
410 struct ADImpUse {
411 Uint16 flags;
412 UBYTE impUse[4];
413 } ADImpUse;
415 } long_ad __packed;
417 /* NOTE: This is here for completeness
418 * ext_ad structures ARE NOT USED in UDF <= 2.60
420 typedef struct ext_ad {
421 Uint32 ExtentLength;
422 Uint32 RecordedLength;
423 Uint32 InformationLength;
424 lb_addr ExtentLocation;
425 UBYTE ImplementationUse[2];
426 } ext_ad __packed;
428 #define UDF_TAG_FILE_SET 256
429 #define UDF_TAG_FILE_IDENTIFIER 257
430 #define UDF_TAG_ALLOCATION_EXTENT 258
431 #define UDF_TAG_INDIRECT_ENTRY 259
432 #define UDF_TAG_TERMINAL_ENTRY 260
433 #define UDF_TAG_FILE_ENTRY 261
434 #define UDF_TAG_EXTENDED_ATTRIBUTE 262
435 #define UDF_TAG_UNALLOCATED_SPACE 263
436 #define UDF_TAG_SPACE_BITMAP 264
437 #define UDF_TAG_PARTITION_INTEGRITY 265
438 #define UDF_TAG_EXTENDED_FILE 266
440 // ECMA-167 4/14.1
441 struct udfFileSet {
442 tag Tag;
443 timestamp RecordingDateandTime;
444 Uint16 InterchangeLevel;
445 Uint16 MaximumInterchangeLevel;
446 Uint32 CharacterSetList;
447 Uint32 MaximumCharacterSetList;
448 Uint32 FileSetNumber;
449 Uint32 FileSetDescriptorNumber;
450 charspec LogicalVolumeIdentifierCharacterSet;
451 union {
452 dstring LogicalVolumeIdentifier;
453 UBYTE LogicalVolumeIdentifier_[128];
455 charspec FileSetCharacterSet;
456 union {
457 dstring Identifier;
458 UBYTE Identifier_[32];
460 union {
461 dstring CopyrightFileIdentifier;
462 UBYTE CopyrightFileIdentifier_[32];
464 union {
465 dstring AbstractFileIdentifier;
466 UBYTE AbstractFileIdentifier_[32];
468 long_ad RootDirectoryICB;
469 regid DomainIdentifier;
470 long_ad NextExtent;
471 UBYTE Reserved[48];
472 } __packed;
474 // ECMA-167 4/14.3
475 struct udfPartitionHeader {
476 short_ad UnallocatedSpaceTable;
477 short_ad UnallocatedSpaceBitmap;
478 short_ad PartitionIntegrityTable;
479 short_ad FreedSpaceTable;
480 short_ad FreedSpaceBitmap;
481 UBYTE Reserved[88];
482 } __packed;
484 // ECMA-167 4/14.4
485 struct udfFileIdentifier {
486 tag Tag;
487 Uint16 FileVersionNumber;
488 Uint8 FileCharacteristics;
489 #define UDF_FILEID_FLAGS_HIDDEN (1 << 0)
490 #define UDF_FILEID_FLAGS_DIRECTORY (1 << 1)
491 #define UDF_FILEID_FLAGS_DELETED (1 << 2)
492 #define UDF_FILEID_FLAGS_PARENT (1 << 3)
493 #define UDF_FILEID_FLAGS_METADATA (1 << 4)
494 Uint8 FileIdentifierLength; /* L_FI */
495 long_ad ICB;
496 Uint16 ImplementationUseLength; /* L_IU */
497 UBYTE Data[0]; /* L_IU + L_FI */
498 } __packed;
500 // ECMA-167 4/14.5
501 struct udfAllocationExtent {
502 tag Tag;
503 Uint32 PreviousAllocationExtentLocation; // Must be 0
504 Uint32 AllocationDescriptorLength;
505 // allocation descriptors follow
506 } __packed;
508 // ECMA-167 4/14.6
509 typedef struct icbtag {
510 Uint32 PriorRecordedNumberofDirectEntries;
511 Uint16 StrategyType;
512 #define UDF_ICBTAG_STRATEGY_1 // ECMA-167 4/A.2 Unused in UDF
513 #define UDF_ICBTAG_STRATEGY_2 // ECMA-167 4/A.3 Unused in UDF
514 #define UDF_ICBTAG_STRATEGY_3 // ECMA-167 4/A.4 Unused in UDF
515 #define UDF_ICBTAG_STRATEGY_4 // ECMA-167 4/A.5 UDF <= 2.60
516 #define UDF_ICBTAG_STRATEGY_4096 // UDF specific
517 UBYTE StrategyParameter[2];
518 Uint16 NumberofEntries;
519 UBYTE Reserved[1];
520 Uint8 FileType;
521 #define UDF_FILETYPE_UNALLOCATED_SPACE 1
522 #define UDF_FILETYPE_PARTITION_INTEGRITY 2
523 #define UDF_FILETYPE_INDIRECT_ENTRY 3
524 #define UDF_FILETYPE_DIRECTORY 4
525 #define UDF_FILETYPE_FILE 5
526 #define UDF_FILETYPE_DEVICE_BLOCK 6
527 #define UDF_FILETYPE_DEVICE_CHAR 7
528 #define UDF_FILETYPE_EXTENDED_ATTRIBUTE 8
529 #define UDF_FILETYPE_DEVICE_FIFO 9
530 #define UDF_FILETYPE_DEVICE_SOCKET 10
531 #define UDF_FILETYPE_TERMINAL_ENTRY 11
532 #define UDF_FILETYPE_SYMLINK 12
533 #define UDF_FILETYPE_STREAM_DIRECTORY 13
534 lb_addr ParentICBLocation;
535 Uint16 Flags;
536 #define UDF_ICBTAG_FLAGS_ALLOCTYPE_of(x) ((x) & 7)
537 #define UDF_ALLOCTYPE_SHORT_AD 0
538 #define UDF_ALLOCTYPE_LONG_AD 1
539 #define UDF_ALLOCTYPE_EXTENDED_AD 2 // NOT USED IN UDF!
540 #define UDF_ALLOCTYPE_TINY 3
541 #define UDF_ICBTAG_FLAGS_DIRECTORY_SORT (1 << 3)
542 #define UDF_ICBTAG_FLAGS_NON_RELOCATABLE (1 << 4)
543 #define UDF_ICBTAG_FLAGS_ARCHIVE (1 << 5)
544 #define UDF_ICBTAG_FLAGS_SETUID (1 << 6)
545 #define UDF_ICBTAG_FLAGS_SETGID (1 << 7)
546 #define UDF_ICBTAG_FLAGS_STICKY (1 << 8)
547 #define UDF_ICBTAG_FLAGS_CONTIGUOUS (1 << 9)
548 #define UDF_ICBTAG_FLAGS_SYSTEM (1 << 10)
549 #define UDF_ICBTAG_FLAGS_TRANSFORMED (1 << 11)
550 #define UDF_ICBTAG_FLAGS_MULTIVERSION (1 << 12)
551 #define UDF_ICBTAG_FLAGS_STREAM (1 << 13)
552 } icbtag __packed;
554 // ECMA-167 4/14.7
555 struct udfICBIndirect {
556 tag Tag;
557 icbtag ICBTag;
558 long_ad IndirectICB;
559 } __packed;
561 // ECMA-167 4/14.8
562 struct udfICBTerminal {
563 tag Tag;
564 icbtag ICBTag;
565 } __packed;
567 // ECMA-167 4/14.9
568 struct udfICBFileEntry {
569 tag Tag;
570 icbtag ICBTag;
571 Uint32 Uid;
572 Uint32 Gid;
573 Uint32 Permissions;
574 #define UDF_FILEPERM_OX (1 << 0)
575 #define UDF_FILEPERM_OW (1 << 1)
576 #define UDF_FILEPERM_OR (1 << 2)
577 #define UDF_FILEPERM_OA (1 << 3)
578 #define UDF_FILEPERM_OD (1 << 4)
579 #define UDF_FILEPERM_GX (1 << 5)
580 #define UDF_FILEPERM_GW (1 << 6)
581 #define UDF_FILEPERM_GR (1 << 7)
582 #define UDF_FILEPERM_GA (1 << 8)
583 #define UDF_FILEPERM_GD (1 << 9)
584 #define UDF_FILEPERM_UX (1 << 10)
585 #define UDF_FILEPERM_UW (1 << 11)
586 #define UDF_FILEPERM_UR (1 << 12)
587 #define UDF_FILEPERM_UA (1 << 13)
588 #define UDF_FILEPERM_UD (1 << 14)
589 Uint16 FileLinkCount;
590 Uint8 RecordFormat;
591 #define UDF_RECORDFORMAT_BIN 0 /* We only support this for now */
592 Uint8 RecordDisplayAttributes;
593 #define UDF_RECORDATTR_BIN 0 /* We only support this for now */
594 Uint32 RecordLength;
595 Uint64 InformationLength;
596 Uint64 LogicalBlocksRecorded;
597 timestamp AccessTime;
598 timestamp ModificationTime;
599 timestamp AttributeTime;
600 Uint32 Checkpoint;
601 long_ad ExtendedAttributeICB;
602 regid ImplementationIdentifier;
603 Uint64 UniqueId;
604 Uint32 ExtendedAttributeLength; // L_EA
605 Uint32 AllocationDescriptorLength; // L_AD
606 UBYTE Data[0]; // L_EA + L_AD
607 } __packed;
609 // ECMA-167 4/14.10 - Extended Attributes are ignored
611 // ECMA-167 4/14.11 - Unallocated Space
612 struct udfICBUnallocatedSpace {
613 tag Tag;
614 icbtag ICBTag;
615 Uint32 AllocationDescriptorLength; // L_AD
616 UBYTE Data[0]; // L_AD
617 } __packed;
619 // ECMA-167 4/14.12 - Space Bitmap Descriptor
620 struct udfSpaceBitmap {
621 tag Tag;
622 Uint32 Bits; // N_BT
623 Uint32 Bytes; // N_B
624 UBYTE Bitmap[0]; // N_B
625 } __packed;
627 // ECMA-167 4/14.13 - Partition Integrity
628 struct udfICBPartitionIntegrity {
629 tag Tag;
630 icbtag ICBTag;
631 timestamp RecordingTime;
632 Uint8 IntegrityType;
633 #define UDF_PARTITIONINTEGRITY_OPEN 0
634 #define UDF_PARTITIONINTEGRITY_CLOSE 1
635 #define UDF_PARTITIONINTEGRITY_STABLE 2
636 UBYTE Reserved[175];
637 regid ImplementationIdentifier;
638 UBYTE ImplementationUse[256];
639 } __packed;
641 // ECMA-167 4/14.16 - Pathname
642 struct udfPathComponent {
643 Uint8 Type;
644 #define UDF_PATHTYPE_ROOT 1
645 #define UDF_PATHTYPE_ROOT_OF 2 /* ":" */
646 #define UDF_PATHTYPE_PARENT_OF 3 /* "/" */
647 #define UDF_PATHTYPE_DIR_OF 4 /* "" */
648 #define UDF_PATHTYPE_FILE 5
649 Uint8 IdentifierLength; // L_CI
650 Uint16 FileVersion; // Shall be 0
651 UBYTE Identifier[0]; // L_CI bytes
652 } __packed;
654 #endif /* UDF_H */