4 * This file is based on ECMA-167 3rd edition (June 1997)
7 * Copyright (c) 2001-2002 Ben Fennema <bfennema@falcon.csc.calpoly.edu>
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
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.
19 * Alternatively, this software may be distributed under the terms of the
20 * GNU Public License ("GPL").
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
35 #include <linux/types.h>
40 /* Character set specification (ECMA 167r3 1/7.2.1) */
43 uint8_t charSetInfo[63];
44 } __attribute__ ((packed)) charspec;
46 /* Character Set Type (ECMA 167r3 1/7.2.1.1) */
47 #define CHARSPEC_TYPE_CS0 0x00 /* (1/7.2.2) */
48 #define CHARSPEC_TYPE_CS1 0x01 /* (1/7.2.3) */
49 #define CHARSPEC_TYPE_CS2 0x02 /* (1/7.2.4) */
50 #define CHARSPEC_TYPE_CS3 0x03 /* (1/7.2.5) */
51 #define CHARSPEC_TYPE_CS4 0x04 /* (1/7.2.6) */
52 #define CHARSPEC_TYPE_CS5 0x05 /* (1/7.2.7) */
53 #define CHARSPEC_TYPE_CS6 0x06 /* (1/7.2.8) */
54 #define CHARSPEC_TYPE_CS7 0x07 /* (1/7.2.9) */
55 #define CHARSPEC_TYPE_CS8 0x08 /* (1/7.2.10) */
57 typedef uint8_t dstring;
59 /* Timestamp (ECMA 167r3 1/7.3) */
61 __le16 typeAndTimezone;
69 uint8_t hundredsOfMicroseconds;
71 } __attribute__ ((packed)) timestamp;
74 uint16_t typeAndTimezone;
82 uint8_t hundredsOfMicroseconds;
84 } __attribute__ ((packed)) kernel_timestamp;
86 /* Type and Time Zone (ECMA 167r3 1/7.3.1) */
87 #define TIMESTAMP_TYPE_MASK 0xF000
88 #define TIMESTAMP_TYPE_CUT 0x0000
89 #define TIMESTAMP_TYPE_LOCAL 0x1000
90 #define TIMESTAMP_TYPE_AGREEMENT 0x2000
91 #define TIMESTAMP_TIMEZONE_MASK 0x0FFF
93 /* Entity identifier (ECMA 167r3 1/7.4) */
97 uint8_t identSuffix[8];
98 } __attribute__ ((packed)) regid;
100 /* Flags (ECMA 167r3 1/7.4.1) */
101 #define ENTITYID_FLAGS_DIRTY 0x00
102 #define ENTITYID_FLAGS_PROTECTED 0x01
104 /* Volume Structure Descriptor (ECMA 167r3 2/9.1) */
105 #define VSD_STD_ID_LEN 5
106 struct volStructDesc {
108 uint8_t stdIdent[VSD_STD_ID_LEN];
109 uint8_t structVersion;
110 uint8_t structData[2041];
111 } __attribute__ ((packed));
113 /* Standard Identifier (EMCA 167r2 2/9.1.2) */
114 #define VSD_STD_ID_NSR02 "NSR02" /* (3/9.1) */
116 /* Standard Identifier (ECMA 167r3 2/9.1.2) */
117 #define VSD_STD_ID_BEA01 "BEA01" /* (2/9.2) */
118 #define VSD_STD_ID_BOOT2 "BOOT2" /* (2/9.4) */
119 #define VSD_STD_ID_CD001 "CD001" /* (ECMA-119) */
120 #define VSD_STD_ID_CDW02 "CDW02" /* (ECMA-168) */
121 #define VSD_STD_ID_NSR03 "NSR03" /* (3/9.1) */
122 #define VSD_STD_ID_TEA01 "TEA01" /* (2/9.3) */
124 /* Beginning Extended Area Descriptor (ECMA 167r3 2/9.2) */
125 struct beginningExtendedAreaDesc {
127 uint8_t stdIdent[VSD_STD_ID_LEN];
128 uint8_t structVersion;
129 uint8_t structData[2041];
130 } __attribute__ ((packed));
132 /* Terminating Extended Area Descriptor (ECMA 167r3 2/9.3) */
133 struct terminatingExtendedAreaDesc {
135 uint8_t stdIdent[VSD_STD_ID_LEN];
136 uint8_t structVersion;
137 uint8_t structData[2041];
138 } __attribute__ ((packed));
140 /* Boot Descriptor (ECMA 167r3 2/9.4) */
143 uint8_t stdIdent[VSD_STD_ID_LEN];
144 uint8_t structVersion;
148 __le32 bootExtLocation;
149 __le32 bootExtLength;
152 timestamp descCreationDateAndTime;
154 uint8_t reserved2[32];
155 uint8_t bootUse[1906];
156 } __attribute__ ((packed));
158 /* Flags (ECMA 167r3 2/9.4.12) */
159 #define BOOT_FLAGS_ERASE 0x01
161 /* Extent Descriptor (ECMA 167r3 3/7.1) */
165 } __attribute__ ((packed)) extent_ad;
169 uint32_t extLocation;
172 /* Descriptor Tag (ECMA 167r3 3/7.2) */
180 __le16 descCRCLength;
182 } __attribute__ ((packed)) tag;
184 /* Tag Identifier (ECMA 167r3 3/7.2.1) */
185 #define TAG_IDENT_PVD 0x0001
186 #define TAG_IDENT_AVDP 0x0002
187 #define TAG_IDENT_VDP 0x0003
188 #define TAG_IDENT_IUVD 0x0004
189 #define TAG_IDENT_PD 0x0005
190 #define TAG_IDENT_LVD 0x0006
191 #define TAG_IDENT_USD 0x0007
192 #define TAG_IDENT_TD 0x0008
193 #define TAG_IDENT_LVID 0x0009
195 /* NSR Descriptor (ECMA 167r3 3/9.1) */
198 uint8_t stdIdent[VSD_STD_ID_LEN];
199 uint8_t structVersion;
201 uint8_t structData[2040];
202 } __attribute__ ((packed));
204 /* Primary Volume Descriptor (ECMA 167r3 3/10.1) */
205 struct primaryVolDesc {
207 __le32 volDescSeqNum;
208 __le32 primaryVolDescNum;
209 dstring volIdent[32];
212 __le16 interchangeLvl;
213 __le16 maxInterchangeLvl;
215 __le32 maxCharSetList;
216 dstring volSetIdent[128];
217 charspec descCharSet;
218 charspec explanatoryCharSet;
219 extent_ad volAbstract;
220 extent_ad volCopyright;
222 timestamp recordingDateAndTime;
225 __le32 predecessorVolDescSeqLocation;
227 uint8_t reserved[22];
228 } __attribute__ ((packed));
230 /* Flags (ECMA 167r3 3/10.1.21) */
231 #define PVD_FLAGS_VSID_COMMON 0x0001
233 /* Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2) */
234 struct anchorVolDescPtr {
236 extent_ad mainVolDescSeqExt;
237 extent_ad reserveVolDescSeqExt;
238 uint8_t reserved[480];
239 } __attribute__ ((packed));
241 /* Volume Descriptor Pointer (ECMA 167r3 3/10.3) */
244 __le32 volDescSeqNum;
245 extent_ad nextVolDescSeqExt;
246 uint8_t reserved[484];
247 } __attribute__ ((packed));
249 /* Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) */
250 struct impUseVolDesc {
252 __le32 volDescSeqNum;
255 } __attribute__ ((packed));
257 /* Partition Descriptor (ECMA 167r3 3/10.5) */
258 struct partitionDesc {
260 __le32 volDescSeqNum;
261 __le16 partitionFlags;
262 __le16 partitionNumber;
263 regid partitionContents;
264 uint8_t partitionContentsUse[128];
266 __le32 partitionStartingLocation;
267 __le32 partitionLength;
270 uint8_t reserved[156];
271 } __attribute__ ((packed));
273 /* Partition Flags (ECMA 167r3 3/10.5.3) */
274 #define PD_PARTITION_FLAGS_ALLOC 0x0001
276 /* Partition Contents (ECMA 167r2 3/10.5.3) */
277 #define PD_PARTITION_CONTENTS_NSR02 "+NSR02"
279 /* Partition Contents (ECMA 167r3 3/10.5.5) */
280 #define PD_PARTITION_CONTENTS_FDC01 "+FDC01"
281 #define PD_PARTITION_CONTENTS_CD001 "+CD001"
282 #define PD_PARTITION_CONTENTS_CDW02 "+CDW02"
283 #define PD_PARTITION_CONTENTS_NSR03 "+NSR03"
285 /* Access Type (ECMA 167r3 3/10.5.7) */
286 #define PD_ACCESS_TYPE_NONE 0x00000000
287 #define PD_ACCESS_TYPE_READ_ONLY 0x00000001
288 #define PD_ACCESS_TYPE_WRITE_ONCE 0x00000002
289 #define PD_ACCESS_TYPE_REWRITABLE 0x00000003
290 #define PD_ACCESS_TYPE_OVERWRITABLE 0x00000004
292 /* Logical Volume Descriptor (ECMA 167r3 3/10.6) */
293 struct logicalVolDesc {
295 __le32 volDescSeqNum;
296 charspec descCharSet;
297 dstring logicalVolIdent[128];
298 __le32 logicalBlockSize;
300 uint8_t logicalVolContentsUse[16];
301 __le32 mapTableLength;
302 __le32 numPartitionMaps;
305 extent_ad integritySeqExt;
306 uint8_t partitionMaps[0];
307 } __attribute__ ((packed));
309 /* Generic Partition Map (ECMA 167r3 3/10.7.1) */
310 struct genericPartitionMap {
311 uint8_t partitionMapType;
312 uint8_t partitionMapLength;
313 uint8_t partitionMapping[0];
314 } __attribute__ ((packed));
316 /* Partition Map Type (ECMA 167r3 3/10.7.1.1) */
317 #define GP_PARTITION_MAP_TYPE_UNDEF 0x00
318 #define GP_PARTIITON_MAP_TYPE_1 0x01
319 #define GP_PARTITION_MAP_TYPE_2 0x02
321 /* Type 1 Partition Map (ECMA 167r3 3/10.7.2) */
322 struct genericPartitionMap1 {
323 uint8_t partitionMapType;
324 uint8_t partitionMapLength;
327 } __attribute__ ((packed));
329 /* Type 2 Partition Map (ECMA 167r3 3/10.7.3) */
330 struct genericPartitionMap2 {
331 uint8_t partitionMapType;
332 uint8_t partitionMapLength;
333 uint8_t partitionIdent[62];
334 } __attribute__ ((packed));
336 /* Unallocated Space Descriptor (ECMA 167r3 3/10.8) */
337 struct unallocSpaceDesc {
339 __le32 volDescSeqNum;
340 __le32 numAllocDescs;
341 extent_ad allocDescs[0];
342 } __attribute__ ((packed));
344 /* Terminating Descriptor (ECMA 167r3 3/10.9) */
345 struct terminatingDesc {
347 uint8_t reserved[496];
348 } __attribute__ ((packed));
350 /* Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10) */
351 struct logicalVolIntegrityDesc {
353 timestamp recordingDateAndTime;
354 __le32 integrityType;
355 extent_ad nextIntegrityExt;
356 uint8_t logicalVolContentsUse[32];
357 __le32 numOfPartitions;
358 __le32 lengthOfImpUse;
359 __le32 freeSpaceTable[0];
362 } __attribute__ ((packed));
364 /* Integrity Type (ECMA 167r3 3/10.10.3) */
365 #define LVID_INTEGRITY_TYPE_OPEN 0x00000000
366 #define LVID_INTEGRITY_TYPE_CLOSE 0x00000001
368 /* Recorded Address (ECMA 167r3 4/7.1) */
370 __le32 logicalBlockNum;
371 __le16 partitionReferenceNum;
372 } __attribute__ ((packed)) lb_addr;
374 /* ... and its in-core analog */
376 uint32_t logicalBlockNum;
377 uint16_t partitionReferenceNum;
380 /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
384 } __attribute__ ((packed)) short_ad;
386 /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
391 } __attribute__ ((packed)) long_ad;
395 kernel_lb_addr extLocation;
399 /* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
402 __le32 recordedLength;
403 __le32 informationLength;
405 } __attribute__ ((packed)) ext_ad;
409 uint32_t recordedLength;
410 uint32_t informationLength;
411 kernel_lb_addr extLocation;
414 /* Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */
416 /* Tag Identifier (ECMA 167r3 4/7.2.1) */
417 #define TAG_IDENT_FSD 0x0100
418 #define TAG_IDENT_FID 0x0101
419 #define TAG_IDENT_AED 0x0102
420 #define TAG_IDENT_IE 0x0103
421 #define TAG_IDENT_TE 0x0104
422 #define TAG_IDENT_FE 0x0105
423 #define TAG_IDENT_EAHD 0x0106
424 #define TAG_IDENT_USE 0x0107
425 #define TAG_IDENT_SBD 0x0108
426 #define TAG_IDENT_PIE 0x0109
427 #define TAG_IDENT_EFE 0x010A
429 /* File Set Descriptor (ECMA 167r3 4/14.1) */
432 timestamp recordingDateAndTime;
433 __le16 interchangeLvl;
434 __le16 maxInterchangeLvl;
436 __le32 maxCharSetList;
438 __le32 fileSetDescNum;
439 charspec logicalVolIdentCharSet;
440 dstring logicalVolIdent[128];
441 charspec fileSetCharSet;
442 dstring fileSetIdent[32];
443 dstring copyrightFileIdent[32];
444 dstring abstractFileIdent[32];
445 long_ad rootDirectoryICB;
448 long_ad streamDirectoryICB;
449 uint8_t reserved[32];
450 } __attribute__ ((packed));
452 /* Partition Header Descriptor (ECMA 167r3 4/14.3) */
453 struct partitionHeaderDesc {
454 short_ad unallocSpaceTable;
455 short_ad unallocSpaceBitmap;
456 short_ad partitionIntegrityTable;
457 short_ad freedSpaceTable;
458 short_ad freedSpaceBitmap;
459 uint8_t reserved[88];
460 } __attribute__ ((packed));
462 /* File Identifier Descriptor (ECMA 167r3 4/14.4) */
463 struct fileIdentDesc {
465 __le16 fileVersionNum;
466 uint8_t fileCharacteristics;
467 uint8_t lengthFileIdent;
469 __le16 lengthOfImpUse;
471 uint8_t fileIdent[0];
473 } __attribute__ ((packed));
475 /* File Characteristics (ECMA 167r3 4/14.4.3) */
476 #define FID_FILE_CHAR_HIDDEN 0x01
477 #define FID_FILE_CHAR_DIRECTORY 0x02
478 #define FID_FILE_CHAR_DELETED 0x04
479 #define FID_FILE_CHAR_PARENT 0x08
480 #define FID_FILE_CHAR_METADATA 0x10
482 /* Allocation Ext Descriptor (ECMA 167r3 4/14.5) */
483 struct allocExtDesc {
485 __le32 previousAllocExtLocation;
486 __le32 lengthAllocDescs;
487 } __attribute__ ((packed));
489 /* ICB Tag (ECMA 167r3 4/14.6) */
491 __le32 priorRecordedNumDirectEntries;
493 __le16 strategyParameter;
497 lb_addr parentICBLocation;
499 } __attribute__ ((packed)) icbtag;
501 /* Strategy Type (ECMA 167r3 4/14.6.2) */
502 #define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000
503 #define ICBTAG_STRATEGY_TYPE_1 0x0001
504 #define ICBTAG_STRATEGY_TYPE_2 0x0002
505 #define ICBTAG_STRATEGY_TYPE_3 0x0003
506 #define ICBTAG_STRATEGY_TYPE_4 0x0004
508 /* File Type (ECMA 167r3 4/14.6.6) */
509 #define ICBTAG_FILE_TYPE_UNDEF 0x00
510 #define ICBTAG_FILE_TYPE_USE 0x01
511 #define ICBTAG_FILE_TYPE_PIE 0x02
512 #define ICBTAG_FILE_TYPE_IE 0x03
513 #define ICBTAG_FILE_TYPE_DIRECTORY 0x04
514 #define ICBTAG_FILE_TYPE_REGULAR 0x05
515 #define ICBTAG_FILE_TYPE_BLOCK 0x06
516 #define ICBTAG_FILE_TYPE_CHAR 0x07
517 #define ICBTAG_FILE_TYPE_EA 0x08
518 #define ICBTAG_FILE_TYPE_FIFO 0x09
519 #define ICBTAG_FILE_TYPE_SOCKET 0x0A
520 #define ICBTAG_FILE_TYPE_TE 0x0B
521 #define ICBTAG_FILE_TYPE_SYMLINK 0x0C
522 #define ICBTAG_FILE_TYPE_STREAMDIR 0x0D
524 /* Flags (ECMA 167r3 4/14.6.8) */
525 #define ICBTAG_FLAG_AD_MASK 0x0007
526 #define ICBTAG_FLAG_AD_SHORT 0x0000
527 #define ICBTAG_FLAG_AD_LONG 0x0001
528 #define ICBTAG_FLAG_AD_EXTENDED 0x0002
529 #define ICBTAG_FLAG_AD_IN_ICB 0x0003
530 #define ICBTAG_FLAG_SORTED 0x0008
531 #define ICBTAG_FLAG_NONRELOCATABLE 0x0010
532 #define ICBTAG_FLAG_ARCHIVE 0x0020
533 #define ICBTAG_FLAG_SETUID 0x0040
534 #define ICBTAG_FLAG_SETGID 0x0080
535 #define ICBTAG_FLAG_STICKY 0x0100
536 #define ICBTAG_FLAG_CONTIGUOUS 0x0200
537 #define ICBTAG_FLAG_SYSTEM 0x0400
538 #define ICBTAG_FLAG_TRANSFORMED 0x0800
539 #define ICBTAG_FLAG_MULTIVERSIONS 0x1000
540 #define ICBTAG_FLAG_STREAM 0x2000
542 /* Indirect Entry (ECMA 167r3 4/14.7) */
543 struct indirectEntry {
547 } __attribute__ ((packed));
549 /* Terminal Entry (ECMA 167r3 4/14.8) */
550 struct terminalEntry {
553 } __attribute__ ((packed));
555 /* File Entry (ECMA 167r3 4/14.9) */
562 __le16 fileLinkCount;
563 uint8_t recordFormat;
564 uint8_t recordDisplayAttr;
566 __le64 informationLength;
567 __le64 logicalBlocksRecorded;
568 timestamp accessTime;
569 timestamp modificationTime;
572 long_ad extendedAttrICB;
575 __le32 lengthExtendedAttr;
576 __le32 lengthAllocDescs;
577 uint8_t extendedAttr[0];
578 uint8_t allocDescs[0];
579 } __attribute__ ((packed));
581 /* Permissions (ECMA 167r3 4/14.9.5) */
582 #define FE_PERM_O_EXEC 0x00000001U
583 #define FE_PERM_O_WRITE 0x00000002U
584 #define FE_PERM_O_READ 0x00000004U
585 #define FE_PERM_O_CHATTR 0x00000008U
586 #define FE_PERM_O_DELETE 0x00000010U
587 #define FE_PERM_G_EXEC 0x00000020U
588 #define FE_PERM_G_WRITE 0x00000040U
589 #define FE_PERM_G_READ 0x00000080U
590 #define FE_PERM_G_CHATTR 0x00000100U
591 #define FE_PERM_G_DELETE 0x00000200U
592 #define FE_PERM_U_EXEC 0x00000400U
593 #define FE_PERM_U_WRITE 0x00000800U
594 #define FE_PERM_U_READ 0x00001000U
595 #define FE_PERM_U_CHATTR 0x00002000U
596 #define FE_PERM_U_DELETE 0x00004000U
598 /* Record Format (ECMA 167r3 4/14.9.7) */
599 #define FE_RECORD_FMT_UNDEF 0x00
600 #define FE_RECORD_FMT_FIXED_PAD 0x01
601 #define FE_RECORD_FMT_FIXED 0x02
602 #define FE_RECORD_FMT_VARIABLE8 0x03
603 #define FE_RECORD_FMT_VARIABLE16 0x04
604 #define FE_RECORD_FMT_VARIABLE16_MSB 0x05
605 #define FE_RECORD_FMT_VARIABLE32 0x06
606 #define FE_RECORD_FMT_PRINT 0x07
607 #define FE_RECORD_FMT_LF 0x08
608 #define FE_RECORD_FMT_CR 0x09
609 #define FE_RECORD_FMT_CRLF 0x0A
610 #define FE_RECORD_FMT_LFCR 0x0B
612 /* Record Display Attributes (ECMA 167r3 4/14.9.8) */
613 #define FE_RECORD_DISPLAY_ATTR_UNDEF 0x00
614 #define FE_RECORD_DISPLAY_ATTR_1 0x01
615 #define FE_RECORD_DISPLAY_ATTR_2 0x02
616 #define FE_RECORD_DISPLAY_ATTR_3 0x03
618 /* Extended Attribute Header Descriptor (ECMA 167r3 4/14.10.1) */
619 struct extendedAttrHeaderDesc {
621 __le32 impAttrLocation;
622 __le32 appAttrLocation;
623 } __attribute__ ((packed));
625 /* Generic Format (ECMA 167r3 4/14.10.2) */
626 struct genericFormat {
632 } __attribute__ ((packed));
634 /* Character Set Information (ECMA 167r3 4/14.10.3) */
640 __le32 escapeSeqLength;
642 uint8_t escapeSeq[0];
643 } __attribute__ ((packed));
645 /* Alternate Permissions (ECMA 167r3 4/14.10.4) */
654 } __attribute__ ((packed));
656 /* File Times Extended Attribute (ECMA 167r3 4/14.10.5) */
657 struct fileTimesExtAttr {
663 __le32 fileTimeExistence;
665 } __attribute__ ((packed));
667 /* FileTimeExistence (ECMA 167r3 4/14.10.5.6) */
668 #define FTE_CREATION 0x00000001
669 #define FTE_DELETION 0x00000004
670 #define FTE_EFFECTIVE 0x00000008
671 #define FTE_BACKUP 0x00000002
673 /* Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */
674 struct infoTimesExtAttr {
680 __le32 infoTimeExistence;
681 uint8_t infoTimes[0];
682 } __attribute__ ((packed));
684 /* Device Specification (ECMA 167r3 4/14.10.7) */
691 __le32 majorDeviceIdent;
692 __le32 minorDeviceIdent;
694 } __attribute__ ((packed));
696 /* Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */
697 struct impUseExtAttr {
705 } __attribute__ ((packed));
707 /* Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */
708 struct appUseExtAttr {
716 } __attribute__ ((packed));
718 #define EXTATTR_CHAR_SET 1
719 #define EXTATTR_ALT_PERMS 3
720 #define EXTATTR_FILE_TIMES 5
721 #define EXTATTR_INFO_TIMES 6
722 #define EXTATTR_DEV_SPEC 12
723 #define EXTATTR_IMP_USE 2048
724 #define EXTATTR_APP_USE 65536
726 /* Unallocated Space Entry (ECMA 167r3 4/14.11) */
727 struct unallocSpaceEntry {
730 __le32 lengthAllocDescs;
731 uint8_t allocDescs[0];
732 } __attribute__ ((packed));
734 /* Space Bitmap Descriptor (ECMA 167r3 4/14.12) */
735 struct spaceBitmapDesc {
740 } __attribute__ ((packed));
742 /* Partition Integrity Entry (ECMA 167r3 4/14.13) */
743 struct partitionIntegrityEntry {
746 timestamp recordingDateAndTime;
747 uint8_t integrityType;
748 uint8_t reserved[175];
751 } __attribute__ ((packed));
753 /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
755 /* Extent Length (ECMA 167r3 4/14.14.1.1) */
756 #define EXT_RECORDED_ALLOCATED 0x00000000
757 #define EXT_NOT_RECORDED_ALLOCATED 0x40000000
758 #define EXT_NOT_RECORDED_NOT_ALLOCATED 0x80000000
759 #define EXT_NEXT_EXTENT_ALLOCDECS 0xC0000000
761 /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
763 /* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
765 /* Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */
766 struct logicalVolHeaderDesc {
768 uint8_t reserved[24];
769 } __attribute__ ((packed));
771 /* Path Component (ECMA 167r3 4/14.16.1) */
772 struct pathComponent {
773 uint8_t componentType;
774 uint8_t lengthComponentIdent;
775 __le16 componentFileVersionNum;
776 dstring componentIdent[0];
777 } __attribute__ ((packed));
779 /* File Entry (ECMA 167r3 4/14.17) */
780 struct extendedFileEntry {
786 __le16 fileLinkCount;
787 uint8_t recordFormat;
788 uint8_t recordDisplayAttr;
790 __le64 informationLength;
792 __le64 logicalBlocksRecorded;
793 timestamp accessTime;
794 timestamp modificationTime;
795 timestamp createTime;
799 long_ad extendedAttrICB;
800 long_ad streamDirectoryICB;
803 __le32 lengthExtendedAttr;
804 __le32 lengthAllocDescs;
805 uint8_t extendedAttr[0];
806 uint8_t allocDescs[0];
807 } __attribute__ ((packed));
809 #endif /* _ECMA_167_H */