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) */
44 uint8_t charSetInfo
[63];
45 } __attribute__ ((packed
)) charspec
;
47 /* Character Set Type (ECMA 167r3 1/7.2.1.1) */
48 #define CHARSPEC_TYPE_CS0 0x00 /* (1/7.2.2) */
49 #define CHARSPEC_TYPE_CS1 0x01 /* (1/7.2.3) */
50 #define CHARSPEC_TYPE_CS2 0x02 /* (1/7.2.4) */
51 #define CHARSPEC_TYPE_CS3 0x03 /* (1/7.2.5) */
52 #define CHARSPEC_TYPE_CS4 0x04 /* (1/7.2.6) */
53 #define CHARSPEC_TYPE_CS5 0x05 /* (1/7.2.7) */
54 #define CHARSPEC_TYPE_CS6 0x06 /* (1/7.2.8) */
55 #define CHARSPEC_TYPE_CS7 0x07 /* (1/7.2.9) */
56 #define CHARSPEC_TYPE_CS8 0x08 /* (1/7.2.10) */
58 typedef uint8_t dstring
;
60 /* Timestamp (ECMA 167r3 1/7.3) */
63 __le16 typeAndTimezone
;
71 uint8_t hundredsOfMicroseconds
;
73 } __attribute__ ((packed
)) timestamp
;
77 uint16_t typeAndTimezone
;
85 uint8_t hundredsOfMicroseconds
;
87 } __attribute__ ((packed
)) kernel_timestamp
;
89 /* Type and Time Zone (ECMA 167r3 1/7.3.1) */
90 #define TIMESTAMP_TYPE_MASK 0xF000
91 #define TIMESTAMP_TYPE_CUT 0x0000
92 #define TIMESTAMP_TYPE_LOCAL 0x1000
93 #define TIMESTAMP_TYPE_AGREEMENT 0x2000
94 #define TIMESTAMP_TIMEZONE_MASK 0x0FFF
96 /* Entity identifier (ECMA 167r3 1/7.4) */
101 uint8_t identSuffix
[8];
102 } __attribute__ ((packed
)) regid
;
104 /* Flags (ECMA 167r3 1/7.4.1) */
105 #define ENTITYID_FLAGS_DIRTY 0x00
106 #define ENTITYID_FLAGS_PROTECTED 0x01
108 /* Volume Structure Descriptor (ECMA 167r3 2/9.1) */
109 #define VSD_STD_ID_LEN 5
113 uint8_t stdIdent
[VSD_STD_ID_LEN
];
114 uint8_t structVersion
;
115 uint8_t structData
[2041];
116 } __attribute__ ((packed
));
118 /* Standard Identifier (EMCA 167r2 2/9.1.2) */
119 #define VSD_STD_ID_NSR02 "NSR02" /* (3/9.1) */
121 /* Standard Identifier (ECMA 167r3 2/9.1.2) */
122 #define VSD_STD_ID_BEA01 "BEA01" /* (2/9.2) */
123 #define VSD_STD_ID_BOOT2 "BOOT2" /* (2/9.4) */
124 #define VSD_STD_ID_CD001 "CD001" /* (ECMA-119) */
125 #define VSD_STD_ID_CDW02 "CDW02" /* (ECMA-168) */
126 #define VSD_STD_ID_NSR03 "NSR03" /* (3/9.1) */
127 #define VSD_STD_ID_TEA01 "TEA01" /* (2/9.3) */
129 /* Beginning Extended Area Descriptor (ECMA 167r3 2/9.2) */
130 struct beginningExtendedAreaDesc
133 uint8_t stdIdent
[VSD_STD_ID_LEN
];
134 uint8_t structVersion
;
135 uint8_t structData
[2041];
136 } __attribute__ ((packed
));
138 /* Terminating Extended Area Descriptor (ECMA 167r3 2/9.3) */
139 struct terminatingExtendedAreaDesc
142 uint8_t stdIdent
[VSD_STD_ID_LEN
];
143 uint8_t structVersion
;
144 uint8_t structData
[2041];
145 } __attribute__ ((packed
));
147 /* Boot Descriptor (ECMA 167r3 2/9.4) */
151 uint8_t stdIdent
[VSD_STD_ID_LEN
];
152 uint8_t structVersion
;
156 __le32 bootExtLocation
;
157 __le32 bootExtLength
;
160 timestamp descCreationDateAndTime
;
162 uint8_t reserved2
[32];
163 uint8_t bootUse
[1906];
164 } __attribute__ ((packed
));
166 /* Flags (ECMA 167r3 2/9.4.12) */
167 #define BOOT_FLAGS_ERASE 0x01
169 /* Extent Descriptor (ECMA 167r3 3/7.1) */
174 } __attribute__ ((packed
)) extent_ad
;
179 uint32_t extLocation
;
182 /* Descriptor Tag (ECMA 167r3 3/7.2) */
191 __le16 descCRCLength
;
193 } __attribute__ ((packed
)) tag
;
195 /* Tag Identifier (ECMA 167r3 3/7.2.1) */
196 #define TAG_IDENT_PVD 0x0001
197 #define TAG_IDENT_AVDP 0x0002
198 #define TAG_IDENT_VDP 0x0003
199 #define TAG_IDENT_IUVD 0x0004
200 #define TAG_IDENT_PD 0x0005
201 #define TAG_IDENT_LVD 0x0006
202 #define TAG_IDENT_USD 0x0007
203 #define TAG_IDENT_TD 0x0008
204 #define TAG_IDENT_LVID 0x0009
206 /* NSR Descriptor (ECMA 167r3 3/9.1) */
210 uint8_t stdIdent
[VSD_STD_ID_LEN
];
211 uint8_t structVersion
;
213 uint8_t structData
[2040];
214 } __attribute__ ((packed
));
216 /* Primary Volume Descriptor (ECMA 167r3 3/10.1) */
217 struct primaryVolDesc
220 __le32 volDescSeqNum
;
221 __le32 primaryVolDescNum
;
222 dstring volIdent
[32];
225 __le16 interchangeLvl
;
226 __le16 maxInterchangeLvl
;
228 __le32 maxCharSetList
;
229 dstring volSetIdent
[128];
230 charspec descCharSet
;
231 charspec explanatoryCharSet
;
232 extent_ad volAbstract
;
233 extent_ad volCopyright
;
235 timestamp recordingDateAndTime
;
238 __le32 predecessorVolDescSeqLocation
;
240 uint8_t reserved
[22];
241 } __attribute__ ((packed
));
243 /* Flags (ECMA 167r3 3/10.1.21) */
244 #define PVD_FLAGS_VSID_COMMON 0x0001
246 /* Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2) */
247 struct anchorVolDescPtr
250 extent_ad mainVolDescSeqExt
;
251 extent_ad reserveVolDescSeqExt
;
252 uint8_t reserved
[480];
253 } __attribute__ ((packed
));
255 /* Volume Descriptor Pointer (ECMA 167r3 3/10.3) */
259 __le32 volDescSeqNum
;
260 extent_ad nextVolDescSeqExt
;
261 uint8_t reserved
[484];
262 } __attribute__ ((packed
));
264 /* Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) */
268 __le32 volDescSeqNum
;
271 } __attribute__ ((packed
));
273 /* Partition Descriptor (ECMA 167r3 3/10.5) */
277 __le32 volDescSeqNum
;
278 __le16 partitionFlags
;
279 __le16 partitionNumber
;
280 regid partitionContents
;
281 uint8_t partitionContentsUse
[128];
283 __le32 partitionStartingLocation
;
284 __le32 partitionLength
;
287 uint8_t reserved
[156];
288 } __attribute__ ((packed
));
290 /* Partition Flags (ECMA 167r3 3/10.5.3) */
291 #define PD_PARTITION_FLAGS_ALLOC 0x0001
293 /* Partition Contents (ECMA 167r2 3/10.5.3) */
294 #define PD_PARTITION_CONTENTS_NSR02 "+NSR02"
296 /* Partition Contents (ECMA 167r3 3/10.5.5) */
297 #define PD_PARTITION_CONTENTS_FDC01 "+FDC01"
298 #define PD_PARTITION_CONTENTS_CD001 "+CD001"
299 #define PD_PARTITION_CONTENTS_CDW02 "+CDW02"
300 #define PD_PARTITION_CONTENTS_NSR03 "+NSR03"
302 /* Access Type (ECMA 167r3 3/10.5.7) */
303 #define PD_ACCESS_TYPE_NONE 0x00000000
304 #define PD_ACCESS_TYPE_READ_ONLY 0x00000001
305 #define PD_ACCESS_TYPE_WRITE_ONCE 0x00000002
306 #define PD_ACCESS_TYPE_REWRITABLE 0x00000003
307 #define PD_ACCESS_TYPE_OVERWRITABLE 0x00000004
309 /* Logical Volume Descriptor (ECMA 167r3 3/10.6) */
310 struct logicalVolDesc
313 __le32 volDescSeqNum
;
314 charspec descCharSet
;
315 dstring logicalVolIdent
[128];
316 __le32 logicalBlockSize
;
318 uint8_t logicalVolContentsUse
[16];
319 __le32 mapTableLength
;
320 __le32 numPartitionMaps
;
323 extent_ad integritySeqExt
;
324 uint8_t partitionMaps
[0];
325 } __attribute__ ((packed
));
327 /* Generic Partition Map (ECMA 167r3 3/10.7.1) */
328 struct genericPartitionMap
330 uint8_t partitionMapType
;
331 uint8_t partitionMapLength
;
332 uint8_t partitionMapping
[0];
333 } __attribute__ ((packed
));
335 /* Partition Map Type (ECMA 167r3 3/10.7.1.1) */
336 #define GP_PARTITION_MAP_TYPE_UNDEF 0x00
337 #define GP_PARTIITON_MAP_TYPE_1 0x01
338 #define GP_PARTITION_MAP_TYPE_2 0x02
340 /* Type 1 Partition Map (ECMA 167r3 3/10.7.2) */
341 struct genericPartitionMap1
343 uint8_t partitionMapType
;
344 uint8_t partitionMapLength
;
347 } __attribute__ ((packed
));
349 /* Type 2 Partition Map (ECMA 167r3 3/10.7.3) */
350 struct genericPartitionMap2
352 uint8_t partitionMapType
;
353 uint8_t partitionMapLength
;
354 uint8_t partitionIdent
[62];
355 } __attribute__ ((packed
));
357 /* Unallocated Space Descriptor (ECMA 167r3 3/10.8) */
358 struct unallocSpaceDesc
361 __le32 volDescSeqNum
;
362 __le32 numAllocDescs
;
363 extent_ad allocDescs
[0];
364 } __attribute__ ((packed
));
366 /* Terminating Descriptor (ECMA 167r3 3/10.9) */
367 struct terminatingDesc
370 uint8_t reserved
[496];
371 } __attribute__ ((packed
));
373 /* Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10) */
374 struct logicalVolIntegrityDesc
377 timestamp recordingDateAndTime
;
378 __le32 integrityType
;
379 extent_ad nextIntegrityExt
;
380 uint8_t logicalVolContentsUse
[32];
381 __le32 numOfPartitions
;
382 __le32 lengthOfImpUse
;
383 __le32 freeSpaceTable
[0];
386 } __attribute__ ((packed
));
388 /* Integrity Type (ECMA 167r3 3/10.10.3) */
389 #define LVID_INTEGRITY_TYPE_OPEN 0x00000000
390 #define LVID_INTEGRITY_TYPE_CLOSE 0x00000001
392 /* Recorded Address (ECMA 167r3 4/7.1) */
395 __le32 logicalBlockNum
;
396 __le16 partitionReferenceNum
;
397 } __attribute__ ((packed
)) lb_addr
;
399 /* ... and its in-core analog */
402 uint32_t logicalBlockNum
;
403 uint16_t partitionReferenceNum
;
406 /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
411 } __attribute__ ((packed
)) short_ad
;
413 /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
419 } __attribute__ ((packed
)) long_ad
;
424 kernel_lb_addr extLocation
;
428 /* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
432 __le32 recordedLength
;
433 __le32 informationLength
;
435 } __attribute__ ((packed
)) ext_ad
;
440 uint32_t recordedLength
;
441 uint32_t informationLength
;
442 kernel_lb_addr extLocation
;
445 /* Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */
447 /* Tag Identifier (ECMA 167r3 4/7.2.1) */
448 #define TAG_IDENT_FSD 0x0100
449 #define TAG_IDENT_FID 0x0101
450 #define TAG_IDENT_AED 0x0102
451 #define TAG_IDENT_IE 0x0103
452 #define TAG_IDENT_TE 0x0104
453 #define TAG_IDENT_FE 0x0105
454 #define TAG_IDENT_EAHD 0x0106
455 #define TAG_IDENT_USE 0x0107
456 #define TAG_IDENT_SBD 0x0108
457 #define TAG_IDENT_PIE 0x0109
458 #define TAG_IDENT_EFE 0x010A
460 /* File Set Descriptor (ECMA 167r3 4/14.1) */
464 timestamp recordingDateAndTime
;
465 __le16 interchangeLvl
;
466 __le16 maxInterchangeLvl
;
468 __le32 maxCharSetList
;
470 __le32 fileSetDescNum
;
471 charspec logicalVolIdentCharSet
;
472 dstring logicalVolIdent
[128];
473 charspec fileSetCharSet
;
474 dstring fileSetIdent
[32];
475 dstring copyrightFileIdent
[32];
476 dstring abstractFileIdent
[32];
477 long_ad rootDirectoryICB
;
480 long_ad streamDirectoryICB
;
481 uint8_t reserved
[32];
482 } __attribute__ ((packed
));
484 /* Partition Header Descriptor (ECMA 167r3 4/14.3) */
485 struct partitionHeaderDesc
487 short_ad unallocSpaceTable
;
488 short_ad unallocSpaceBitmap
;
489 short_ad partitionIntegrityTable
;
490 short_ad freedSpaceTable
;
491 short_ad freedSpaceBitmap
;
492 uint8_t reserved
[88];
493 } __attribute__ ((packed
));
495 /* File Identifier Descriptor (ECMA 167r3 4/14.4) */
499 __le16 fileVersionNum
;
500 uint8_t fileCharacteristics
;
501 uint8_t lengthFileIdent
;
503 __le16 lengthOfImpUse
;
505 uint8_t fileIdent
[0];
507 } __attribute__ ((packed
));
509 /* File Characteristics (ECMA 167r3 4/14.4.3) */
510 #define FID_FILE_CHAR_HIDDEN 0x01
511 #define FID_FILE_CHAR_DIRECTORY 0x02
512 #define FID_FILE_CHAR_DELETED 0x04
513 #define FID_FILE_CHAR_PARENT 0x08
514 #define FID_FILE_CHAR_METADATA 0x10
516 /* Allocation Ext Descriptor (ECMA 167r3 4/14.5) */
520 __le32 previousAllocExtLocation
;
521 __le32 lengthAllocDescs
;
522 } __attribute__ ((packed
));
524 /* ICB Tag (ECMA 167r3 4/14.6) */
527 __le32 priorRecordedNumDirectEntries
;
529 __le16 strategyParameter
;
533 lb_addr parentICBLocation
;
535 } __attribute__ ((packed
)) icbtag
;
537 /* Strategy Type (ECMA 167r3 4/14.6.2) */
538 #define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000
539 #define ICBTAG_STRATEGY_TYPE_1 0x0001
540 #define ICBTAG_STRATEGY_TYPE_2 0x0002
541 #define ICBTAG_STRATEGY_TYPE_3 0x0003
542 #define ICBTAG_STRATEGY_TYPE_4 0x0004
544 /* File Type (ECMA 167r3 4/14.6.6) */
545 #define ICBTAG_FILE_TYPE_UNDEF 0x00
546 #define ICBTAG_FILE_TYPE_USE 0x01
547 #define ICBTAG_FILE_TYPE_PIE 0x02
548 #define ICBTAG_FILE_TYPE_IE 0x03
549 #define ICBTAG_FILE_TYPE_DIRECTORY 0x04
550 #define ICBTAG_FILE_TYPE_REGULAR 0x05
551 #define ICBTAG_FILE_TYPE_BLOCK 0x06
552 #define ICBTAG_FILE_TYPE_CHAR 0x07
553 #define ICBTAG_FILE_TYPE_EA 0x08
554 #define ICBTAG_FILE_TYPE_FIFO 0x09
555 #define ICBTAG_FILE_TYPE_SOCKET 0x0A
556 #define ICBTAG_FILE_TYPE_TE 0x0B
557 #define ICBTAG_FILE_TYPE_SYMLINK 0x0C
558 #define ICBTAG_FILE_TYPE_STREAMDIR 0x0D
560 /* Flags (ECMA 167r3 4/14.6.8) */
561 #define ICBTAG_FLAG_AD_MASK 0x0007
562 #define ICBTAG_FLAG_AD_SHORT 0x0000
563 #define ICBTAG_FLAG_AD_LONG 0x0001
564 #define ICBTAG_FLAG_AD_EXTENDED 0x0002
565 #define ICBTAG_FLAG_AD_IN_ICB 0x0003
566 #define ICBTAG_FLAG_SORTED 0x0008
567 #define ICBTAG_FLAG_NONRELOCATABLE 0x0010
568 #define ICBTAG_FLAG_ARCHIVE 0x0020
569 #define ICBTAG_FLAG_SETUID 0x0040
570 #define ICBTAG_FLAG_SETGID 0x0080
571 #define ICBTAG_FLAG_STICKY 0x0100
572 #define ICBTAG_FLAG_CONTIGUOUS 0x0200
573 #define ICBTAG_FLAG_SYSTEM 0x0400
574 #define ICBTAG_FLAG_TRANSFORMED 0x0800
575 #define ICBTAG_FLAG_MULTIVERSIONS 0x1000
576 #define ICBTAG_FLAG_STREAM 0x2000
578 /* Indirect Entry (ECMA 167r3 4/14.7) */
584 } __attribute__ ((packed
));
586 /* Terminal Entry (ECMA 167r3 4/14.8) */
591 } __attribute__ ((packed
));
593 /* File Entry (ECMA 167r3 4/14.9) */
601 __le16 fileLinkCount
;
602 uint8_t recordFormat
;
603 uint8_t recordDisplayAttr
;
605 __le64 informationLength
;
606 __le64 logicalBlocksRecorded
;
607 timestamp accessTime
;
608 timestamp modificationTime
;
611 long_ad extendedAttrICB
;
614 __le32 lengthExtendedAttr
;
615 __le32 lengthAllocDescs
;
616 uint8_t extendedAttr
[0];
617 uint8_t allocDescs
[0];
618 } __attribute__ ((packed
));
620 /* Permissions (ECMA 167r3 4/14.9.5) */
621 #define FE_PERM_O_EXEC 0x00000001U
622 #define FE_PERM_O_WRITE 0x00000002U
623 #define FE_PERM_O_READ 0x00000004U
624 #define FE_PERM_O_CHATTR 0x00000008U
625 #define FE_PERM_O_DELETE 0x00000010U
626 #define FE_PERM_G_EXEC 0x00000020U
627 #define FE_PERM_G_WRITE 0x00000040U
628 #define FE_PERM_G_READ 0x00000080U
629 #define FE_PERM_G_CHATTR 0x00000100U
630 #define FE_PERM_G_DELETE 0x00000200U
631 #define FE_PERM_U_EXEC 0x00000400U
632 #define FE_PERM_U_WRITE 0x00000800U
633 #define FE_PERM_U_READ 0x00001000U
634 #define FE_PERM_U_CHATTR 0x00002000U
635 #define FE_PERM_U_DELETE 0x00004000U
637 /* Record Format (ECMA 167r3 4/14.9.7) */
638 #define FE_RECORD_FMT_UNDEF 0x00
639 #define FE_RECORD_FMT_FIXED_PAD 0x01
640 #define FE_RECORD_FMT_FIXED 0x02
641 #define FE_RECORD_FMT_VARIABLE8 0x03
642 #define FE_RECORD_FMT_VARIABLE16 0x04
643 #define FE_RECORD_FMT_VARIABLE16_MSB 0x05
644 #define FE_RECORD_FMT_VARIABLE32 0x06
645 #define FE_RECORD_FMT_PRINT 0x07
646 #define FE_RECORD_FMT_LF 0x08
647 #define FE_RECORD_FMT_CR 0x09
648 #define FE_RECORD_FMT_CRLF 0x0A
649 #define FE_RECORD_FMT_LFCR 0x0B
651 /* Record Display Attributes (ECMA 167r3 4/14.9.8) */
652 #define FE_RECORD_DISPLAY_ATTR_UNDEF 0x00
653 #define FE_RECORD_DISPLAY_ATTR_1 0x01
654 #define FE_RECORD_DISPLAY_ATTR_2 0x02
655 #define FE_RECORD_DISPLAY_ATTR_3 0x03
657 /* Extended Attribute Header Descriptor (ECMA 167r3 4/14.10.1) */
658 struct extendedAttrHeaderDesc
661 __le32 impAttrLocation
;
662 __le32 appAttrLocation
;
663 } __attribute__ ((packed
));
665 /* Generic Format (ECMA 167r3 4/14.10.2) */
673 } __attribute__ ((packed
));
675 /* Character Set Information (ECMA 167r3 4/14.10.3) */
682 __le32 escapeSeqLength
;
684 uint8_t escapeSeq
[0];
685 } __attribute__ ((packed
));
687 /* Alternate Permissions (ECMA 167r3 4/14.10.4) */
697 } __attribute__ ((packed
));
699 /* File Times Extended Attribute (ECMA 167r3 4/14.10.5) */
700 struct fileTimesExtAttr
707 __le32 fileTimeExistence
;
709 } __attribute__ ((packed
));
711 /* FileTimeExistence (ECMA 167r3 4/14.10.5.6) */
712 #define FTE_CREATION 0x00000001
713 #define FTE_DELETION 0x00000004
714 #define FTE_EFFECTIVE 0x00000008
715 #define FTE_BACKUP 0x00000002
717 /* Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */
718 struct infoTimesExtAttr
725 __le32 infoTimeExistence
;
726 uint8_t infoTimes
[0];
727 } __attribute__ ((packed
));
729 /* Device Specification (ECMA 167r3 4/14.10.7) */
737 __le32 majorDeviceIdent
;
738 __le32 minorDeviceIdent
;
740 } __attribute__ ((packed
));
742 /* Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */
752 } __attribute__ ((packed
));
754 /* Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */
764 } __attribute__ ((packed
));
766 #define EXTATTR_CHAR_SET 1
767 #define EXTATTR_ALT_PERMS 3
768 #define EXTATTR_FILE_TIMES 5
769 #define EXTATTR_INFO_TIMES 6
770 #define EXTATTR_DEV_SPEC 12
771 #define EXTATTR_IMP_USE 2048
772 #define EXTATTR_APP_USE 65536
775 /* Unallocated Space Entry (ECMA 167r3 4/14.11) */
776 struct unallocSpaceEntry
780 __le32 lengthAllocDescs
;
781 uint8_t allocDescs
[0];
782 } __attribute__ ((packed
));
784 /* Space Bitmap Descriptor (ECMA 167r3 4/14.12) */
785 struct spaceBitmapDesc
791 } __attribute__ ((packed
));
793 /* Partition Integrity Entry (ECMA 167r3 4/14.13) */
794 struct partitionIntegrityEntry
798 timestamp recordingDateAndTime
;
799 uint8_t integrityType
;
800 uint8_t reserved
[175];
803 } __attribute__ ((packed
));
805 /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
807 /* Extent Length (ECMA 167r3 4/14.14.1.1) */
808 #define EXT_RECORDED_ALLOCATED 0x00000000
809 #define EXT_NOT_RECORDED_ALLOCATED 0x40000000
810 #define EXT_NOT_RECORDED_NOT_ALLOCATED 0x80000000
811 #define EXT_NEXT_EXTENT_ALLOCDECS 0xC0000000
813 /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
815 /* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
817 /* Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */
818 struct logicalVolHeaderDesc
821 uint8_t reserved
[24];
822 } __attribute__ ((packed
));
824 /* Path Component (ECMA 167r3 4/14.16.1) */
827 uint8_t componentType
;
828 uint8_t lengthComponentIdent
;
829 __le16 componentFileVersionNum
;
830 dstring componentIdent
[0];
831 } __attribute__ ((packed
));
833 /* File Entry (ECMA 167r3 4/14.17) */
834 struct extendedFileEntry
841 __le16 fileLinkCount
;
842 uint8_t recordFormat
;
843 uint8_t recordDisplayAttr
;
845 __le64 informationLength
;
847 __le64 logicalBlocksRecorded
;
848 timestamp accessTime
;
849 timestamp modificationTime
;
850 timestamp createTime
;
854 long_ad extendedAttrICB
;
855 long_ad streamDirectoryICB
;
858 __le32 lengthExtendedAttr
;
859 __le32 lengthAllocDescs
;
860 uint8_t extendedAttr
[0];
861 uint8_t allocDescs
[0];
862 } __attribute__ ((packed
));
864 #endif /* _ECMA_167_H */