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 uint16_t typeAndTimezone;
71 uint8_t hundredsOfMicroseconds;
73 } __attribute__ ((packed)) timestamp;
75 /* Type and Time Zone (ECMA 167r3 1/7.3.1) */
76 #define TIMESTAMP_TYPE_MASK 0xF000
77 #define TIMESTAMP_TYPE_CUT 0x0000
78 #define TIMESTAMP_TYPE_LOCAL 0x1000
79 #define TIMESTAMP_TYPE_AGREEMENT 0x2000
80 #define TIMESTAMP_TIMEZONE_MASK 0x0FFF
82 /* Entity identifier (ECMA 167r3 1/7.4) */
87 uint8_t identSuffix[8];
88 } __attribute__ ((packed)) regid;
90 /* Flags (ECMA 167r3 1/7.4.1) */
91 #define ENTITYID_FLAGS_DIRTY 0x00
92 #define ENTITYID_FLAGS_PROTECTED 0x01
94 /* Volume Structure Descriptor (ECMA 167r3 2/9.1) */
95 #define VSD_STD_ID_LEN 5
99 uint8_t stdIdent[VSD_STD_ID_LEN];
100 uint8_t structVersion;
101 uint8_t structData[2041];
102 } __attribute__ ((packed));
104 /* Standard Identifier (EMCA 167r2 2/9.1.2) */
105 #define VSD_STD_ID_NSR02 "NSR02" /* (3/9.1) */
107 /* Standard Identifier (ECMA 167r3 2/9.1.2) */
108 #define VSD_STD_ID_BEA01 "BEA01" /* (2/9.2) */
109 #define VSD_STD_ID_BOOT2 "BOOT2" /* (2/9.4) */
110 #define VSD_STD_ID_CD001 "CD001" /* (ECMA-119) */
111 #define VSD_STD_ID_CDW02 "CDW02" /* (ECMA-168) */
112 #define VSD_STD_ID_NSR03 "NSR03" /* (3/9.1) */
113 #define VSD_STD_ID_TEA01 "TEA01" /* (2/9.3) */
115 /* Beginning Extended Area Descriptor (ECMA 167r3 2/9.2) */
116 struct beginningExtendedAreaDesc
119 uint8_t stdIdent[VSD_STD_ID_LEN];
120 uint8_t structVersion;
121 uint8_t structData[2041];
122 } __attribute__ ((packed));
124 /* Terminating Extended Area Descriptor (ECMA 167r3 2/9.3) */
125 struct terminatingExtendedAreaDesc
128 uint8_t stdIdent[VSD_STD_ID_LEN];
129 uint8_t structVersion;
130 uint8_t structData[2041];
131 } __attribute__ ((packed));
133 /* Boot Descriptor (ECMA 167r3 2/9.4) */
137 uint8_t stdIdent[VSD_STD_ID_LEN];
138 uint8_t structVersion;
142 uint32_t bootExtLocation;
143 uint32_t bootExtLength;
144 uint64_t loadAddress;
145 uint64_t startAddress;
146 timestamp descCreationDateAndTime;
148 uint8_t reserved2[32];
149 uint8_t bootUse[1906];
150 } __attribute__ ((packed));
152 /* Flags (ECMA 167r3 2/9.4.12) */
153 #define BOOT_FLAGS_ERASE 0x01
155 /* Extent Descriptor (ECMA 167r3 3/7.1) */
159 uint32_t extLocation;
160 } __attribute__ ((packed)) extent_ad;
162 /* Descriptor Tag (ECMA 167r3 3/7.2) */
166 uint16_t descVersion;
169 uint16_t tagSerialNum;
171 uint16_t descCRCLength;
172 uint32_t tagLocation;
173 } __attribute__ ((packed)) tag;
175 /* Tag Identifier (ECMA 167r3 3/7.2.1) */
176 #define TAG_IDENT_PVD 0x0001
177 #define TAG_IDENT_AVDP 0x0002
178 #define TAG_IDENT_VDP 0x0003
179 #define TAG_IDENT_IUVD 0x0004
180 #define TAG_IDENT_PD 0x0005
181 #define TAG_IDENT_LVD 0x0006
182 #define TAG_IDENT_USD 0x0007
183 #define TAG_IDENT_TD 0x0008
184 #define TAG_IDENT_LVID 0x0009
186 /* NSR Descriptor (ECMA 167r3 3/9.1) */
190 uint8_t stdIdent[VSD_STD_ID_LEN];
191 uint8_t structVersion;
193 uint8_t structData[2040];
194 } __attribute__ ((packed));
196 /* Primary Volume Descriptor (ECMA 167r3 3/10.1) */
197 struct primaryVolDesc
200 uint32_t volDescSeqNum;
201 uint32_t primaryVolDescNum;
202 dstring volIdent[32];
204 uint16_t maxVolSeqNum;
205 uint16_t interchangeLvl;
206 uint16_t maxInterchangeLvl;
207 uint32_t charSetList;
208 uint32_t maxCharSetList;
209 dstring volSetIdent[128];
210 charspec descCharSet;
211 charspec explanatoryCharSet;
212 extent_ad volAbstract;
213 extent_ad volCopyright;
215 timestamp recordingDateAndTime;
218 uint32_t predecessorVolDescSeqLocation;
220 uint8_t reserved[22];
221 } __attribute__ ((packed));
223 /* Flags (ECMA 167r3 3/10.1.21) */
224 #define PVD_FLAGS_VSID_COMMON 0x0001
226 /* Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2) */
227 struct anchorVolDescPtr
230 extent_ad mainVolDescSeqExt;
231 extent_ad reserveVolDescSeqExt;
232 uint8_t reserved[480];
233 } __attribute__ ((packed));
235 /* Volume Descriptor Pointer (ECMA 167r3 3/10.3) */
239 uint32_t volDescSeqNum;
240 extent_ad nextVolDescSeqExt;
241 uint8_t reserved[484];
242 } __attribute__ ((packed));
244 /* Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) */
248 uint32_t volDescSeqNum;
251 } __attribute__ ((packed));
253 /* Partition Descriptor (ECMA 167r3 3/10.5) */
257 uint32_t volDescSeqNum;
258 uint16_t partitionFlags;
259 uint16_t partitionNumber;
260 regid partitionContents;
261 uint8_t partitionContentsUse[128];
263 uint32_t partitionStartingLocation;
264 uint32_t partitionLength;
267 uint8_t reserved[156];
268 } __attribute__ ((packed));
270 /* Partition Flags (ECMA 167r3 3/10.5.3) */
271 #define PD_PARTITION_FLAGS_ALLOC 0x0001
273 /* Partition Contents (ECMA 167r2 3/10.5.3) */
274 #define PD_PARTITION_CONTENTS_NSR02 "+NSR02"
276 /* Partition Contents (ECMA 167r3 3/10.5.5) */
277 #define PD_PARTITION_CONTENTS_FDC01 "+FDC01"
278 #define PD_PARTITION_CONTENTS_CD001 "+CD001"
279 #define PD_PARTITION_CONTENTS_CDW02 "+CDW02"
280 #define PD_PARTITION_CONTENTS_NSR03 "+NSR03"
282 /* Access Type (ECMA 167r3 3/10.5.7) */
283 #define PD_ACCESS_TYPE_NONE 0x00000000
284 #define PD_ACCESS_TYPE_READ_ONLY 0x00000001
285 #define PD_ACCESS_TYPE_WRITE_ONCE 0x00000002
286 #define PD_ACCESS_TYPE_REWRITABLE 0x00000003
287 #define PD_ACCESS_TYPE_OVERWRITABLE 0x00000004
289 /* Logical Volume Descriptor (ECMA 167r3 3/10.6) */
290 struct logicalVolDesc
293 uint32_t volDescSeqNum;
294 charspec descCharSet;
295 dstring logicalVolIdent[128];
296 uint32_t logicalBlockSize;
298 uint8_t logicalVolContentsUse[16];
299 uint32_t mapTableLength;
300 uint32_t numPartitionMaps;
303 extent_ad integritySeqExt;
304 uint8_t partitionMaps[0];
305 } __attribute__ ((packed));
307 /* Generic Partition Map (ECMA 167r3 3/10.7.1) */
308 struct genericPartitionMap
310 uint8_t partitionMapType;
311 uint8_t partitionMapLength;
312 uint8_t partitionMapping[0];
313 } __attribute__ ((packed));
315 /* Partition Map Type (ECMA 167r3 3/10.7.1.1) */
316 #define GP_PARTITION_MAP_TYPE_UNDEF 0x00
317 #define GP_PARTIITON_MAP_TYPE_1 0x01
318 #define GP_PARTITION_MAP_TYPE_2 0x02
320 /* Type 1 Partition Map (ECMA 167r3 3/10.7.2) */
321 struct genericPartitionMap1
323 uint8_t partitionMapType;
324 uint8_t partitionMapLength;
326 uint16_t partitionNum;
327 } __attribute__ ((packed));
329 /* Type 2 Partition Map (ECMA 167r3 3/10.7.3) */
330 struct genericPartitionMap2
332 uint8_t partitionMapType;
333 uint8_t partitionMapLength;
334 uint8_t partitionIdent[62];
335 } __attribute__ ((packed));
337 /* Unallocated Space Descriptor (ECMA 167r3 3/10.8) */
338 struct unallocSpaceDesc
341 uint32_t volDescSeqNum;
342 uint32_t numAllocDescs;
343 extent_ad allocDescs[0];
344 } __attribute__ ((packed));
346 /* Terminating Descriptor (ECMA 167r3 3/10.9) */
347 struct terminatingDesc
350 uint8_t reserved[496];
351 } __attribute__ ((packed));
353 /* Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10) */
354 struct logicalVolIntegrityDesc
357 timestamp recordingDateAndTime;
358 uint32_t integrityType;
359 extent_ad nextIntegrityExt;
360 uint8_t logicalVolContentsUse[32];
361 uint32_t numOfPartitions;
362 uint32_t lengthOfImpUse;
363 uint32_t freeSpaceTable[0];
364 uint32_t sizeTable[0];
366 } __attribute__ ((packed));
368 /* Integrity Type (ECMA 167r3 3/10.10.3) */
369 #define LVID_INTEGRITY_TYPE_OPEN 0x00000000
370 #define LVID_INTEGRITY_TYPE_CLOSE 0x00000001
372 /* Recorded Address (ECMA 167r3 4/7.1) */
375 uint32_t logicalBlockNum;
376 uint16_t partitionReferenceNum;
377 } __attribute__ ((packed)) lb_addr;
379 /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
383 uint32_t extPosition;
384 } __attribute__ ((packed)) short_ad;
386 /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
392 } __attribute__ ((packed)) long_ad;
394 /* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
398 uint32_t recordedLength;
399 uint32_t informationLength;
401 } __attribute__ ((packed)) ext_ad;
403 /* Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */
405 /* Tag Identifier (ECMA 167r3 4/7.2.1) */
406 #define TAG_IDENT_FSD 0x0100
407 #define TAG_IDENT_FID 0x0101
408 #define TAG_IDENT_AED 0x0102
409 #define TAG_IDENT_IE 0x0103
410 #define TAG_IDENT_TE 0x0104
411 #define TAG_IDENT_FE 0x0105
412 #define TAG_IDENT_EAHD 0x0106
413 #define TAG_IDENT_USE 0x0107
414 #define TAG_IDENT_SBD 0x0108
415 #define TAG_IDENT_PIE 0x0109
416 #define TAG_IDENT_EFE 0x010A
418 /* File Set Descriptor (ECMA 167r3 4/14.1) */
422 timestamp recordingDateAndTime;
423 uint16_t interchangeLvl;
424 uint16_t maxInterchangeLvl;
425 uint32_t charSetList;
426 uint32_t maxCharSetList;
428 uint32_t fileSetDescNum;
429 charspec logicalVolIdentCharSet;
430 dstring logicalVolIdent[128];
431 charspec fileSetCharSet;
432 dstring fileSetIdent[32];
433 dstring copyrightFileIdent[32];
434 dstring abstractFileIdent[32];
435 long_ad rootDirectoryICB;
438 long_ad streamDirectoryICB;
439 uint8_t reserved[32];
440 } __attribute__ ((packed));
442 /* Partition Header Descriptor (ECMA 167r3 4/14.3) */
443 struct partitionHeaderDesc
445 short_ad unallocSpaceTable;
446 short_ad unallocSpaceBitmap;
447 short_ad partitionIntegrityTable;
448 short_ad freedSpaceTable;
449 short_ad freedSpaceBitmap;
450 uint8_t reserved[88];
451 } __attribute__ ((packed));
453 /* File Identifier Descriptor (ECMA 167r3 4/14.4) */
457 uint16_t fileVersionNum;
458 uint8_t fileCharacteristics;
459 uint8_t lengthFileIdent;
461 uint16_t lengthOfImpUse;
463 uint8_t fileIdent[0];
465 } __attribute__ ((packed));
467 /* File Characteristics (ECMA 167r3 4/14.4.3) */
468 #define FID_FILE_CHAR_HIDDEN 0x01
469 #define FID_FILE_CHAR_DIRECTORY 0x02
470 #define FID_FILE_CHAR_DELETED 0x04
471 #define FID_FILE_CHAR_PARENT 0x08
472 #define FID_FILE_CHAR_METADATA 0x10
474 /* Allocation Ext Descriptor (ECMA 167r3 4/14.5) */
478 uint32_t previousAllocExtLocation;
479 uint32_t lengthAllocDescs;
480 } __attribute__ ((packed));
482 /* ICB Tag (ECMA 167r3 4/14.6) */
485 uint32_t priorRecordedNumDirectEntries;
486 uint16_t strategyType;
487 uint16_t strategyParameter;
491 lb_addr parentICBLocation;
493 } __attribute__ ((packed)) icbtag;
495 /* Strategy Type (ECMA 167r3 4/14.6.2) */
496 #define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000
497 #define ICBTAG_STRATEGY_TYPE_1 0x0001
498 #define ICBTAG_STRATEGY_TYPE_2 0x0002
499 #define ICBTAG_STRATEGY_TYPE_3 0x0003
500 #define ICBTAG_STRATEGY_TYPE_4 0x0004
502 /* File Type (ECMA 167r3 4/14.6.6) */
503 #define ICBTAG_FILE_TYPE_UNDEF 0x00
504 #define ICBTAG_FILE_TYPE_USE 0x01
505 #define ICBTAG_FILE_TYPE_PIE 0x02
506 #define ICBTAG_FILE_TYPE_IE 0x03
507 #define ICBTAG_FILE_TYPE_DIRECTORY 0x04
508 #define ICBTAG_FILE_TYPE_REGULAR 0x05
509 #define ICBTAG_FILE_TYPE_BLOCK 0x06
510 #define ICBTAG_FILE_TYPE_CHAR 0x07
511 #define ICBTAG_FILE_TYPE_EA 0x08
512 #define ICBTAG_FILE_TYPE_FIFO 0x09
513 #define ICBTAG_FILE_TYPE_SOCKET 0x0A
514 #define ICBTAG_FILE_TYPE_TE 0x0B
515 #define ICBTAG_FILE_TYPE_SYMLINK 0x0C
516 #define ICBTAG_FILE_TYPE_STREAMDIR 0x0D
518 /* Flags (ECMA 167r3 4/14.6.8) */
519 #define ICBTAG_FLAG_AD_MASK 0x0007
520 #define ICBTAG_FLAG_AD_SHORT 0x0000
521 #define ICBTAG_FLAG_AD_LONG 0x0001
522 #define ICBTAG_FLAG_AD_EXTENDED 0x0002
523 #define ICBTAG_FLAG_AD_IN_ICB 0x0003
524 #define ICBTAG_FLAG_SORTED 0x0008
525 #define ICBTAG_FLAG_NONRELOCATABLE 0x0010
526 #define ICBTAG_FLAG_ARCHIVE 0x0020
527 #define ICBTAG_FLAG_SETUID 0x0040
528 #define ICBTAG_FLAG_SETGID 0x0080
529 #define ICBTAG_FLAG_STICKY 0x0100
530 #define ICBTAG_FLAG_CONTIGUOUS 0x0200
531 #define ICBTAG_FLAG_SYSTEM 0x0400
532 #define ICBTAG_FLAG_TRANSFORMED 0x0800
533 #define ICBTAG_FLAG_MULTIVERSIONS 0x1000
534 #define ICBTAG_FLAG_STREAM 0x2000
536 /* Indirect Entry (ECMA 167r3 4/14.7) */
542 } __attribute__ ((packed));
544 /* Terminal Entry (ECMA 167r3 4/14.8) */
549 } __attribute__ ((packed));
551 /* File Entry (ECMA 167r3 4/14.9) */
558 uint32_t permissions;
559 uint16_t fileLinkCount;
560 uint8_t recordFormat;
561 uint8_t recordDisplayAttr;
562 uint32_t recordLength;
563 uint64_t informationLength;
564 uint64_t logicalBlocksRecorded;
565 timestamp accessTime;
566 timestamp modificationTime;
569 long_ad extendedAttrICB;
572 uint32_t lengthExtendedAttr;
573 uint32_t lengthAllocDescs;
574 uint8_t extendedAttr[0];
575 uint8_t allocDescs[0];
576 } __attribute__ ((packed));
578 /* Permissions (ECMA 167r3 4/14.9.5) */
579 #define FE_PERM_O_EXEC 0x00000001U
580 #define FE_PERM_O_WRITE 0x00000002U
581 #define FE_PERM_O_READ 0x00000004U
582 #define FE_PERM_O_CHATTR 0x00000008U
583 #define FE_PERM_O_DELETE 0x00000010U
584 #define FE_PERM_G_EXEC 0x00000020U
585 #define FE_PERM_G_WRITE 0x00000040U
586 #define FE_PERM_G_READ 0x00000080U
587 #define FE_PERM_G_CHATTR 0x00000100U
588 #define FE_PERM_G_DELETE 0x00000200U
589 #define FE_PERM_U_EXEC 0x00000400U
590 #define FE_PERM_U_WRITE 0x00000800U
591 #define FE_PERM_U_READ 0x00001000U
592 #define FE_PERM_U_CHATTR 0x00002000U
593 #define FE_PERM_U_DELETE 0x00004000U
595 /* Record Format (ECMA 167r3 4/14.9.7) */
596 #define FE_RECORD_FMT_UNDEF 0x00
597 #define FE_RECORD_FMT_FIXED_PAD 0x01
598 #define FE_RECORD_FMT_FIXED 0x02
599 #define FE_RECORD_FMT_VARIABLE8 0x03
600 #define FE_RECORD_FMT_VARIABLE16 0x04
601 #define FE_RECORD_FMT_VARIABLE16_MSB 0x05
602 #define FE_RECORD_FMT_VARIABLE32 0x06
603 #define FE_RECORD_FMT_PRINT 0x07
604 #define FE_RECORD_FMT_LF 0x08
605 #define FE_RECORD_FMT_CR 0x09
606 #define FE_RECORD_FMT_CRLF 0x0A
607 #define FE_RECORD_FMT_LFCR 0x0B
609 /* Record Display Attributes (ECMA 167r3 4/14.9.8) */
610 #define FE_RECORD_DISPLAY_ATTR_UNDEF 0x00
611 #define FE_RECORD_DISPLAY_ATTR_1 0x01
612 #define FE_RECORD_DISPLAY_ATTR_2 0x02
613 #define FE_RECORD_DISPLAY_ATTR_3 0x03
615 /* Extended Attribute Header Descriptor (ECMA 167r3 4/14.10.1) */
616 struct extendedAttrHeaderDesc
619 uint32_t impAttrLocation;
620 uint32_t appAttrLocation;
621 } __attribute__ ((packed));
623 /* Generic Format (ECMA 167r3 4/14.10.2) */
631 } __attribute__ ((packed));
633 /* Character Set Information (ECMA 167r3 4/14.10.3) */
640 uint32_t escapeSeqLength;
642 uint8_t escapeSeq[0];
643 } __attribute__ ((packed));
645 /* Alternate Permissions (ECMA 167r3 4/14.10.4) */
655 } __attribute__ ((packed));
657 /* File Times Extended Attribute (ECMA 167r3 4/14.10.5) */
658 struct fileTimesExtAttr
665 uint32_t fileTimeExistence;
667 } __attribute__ ((packed));
669 /* FileTimeExistence (ECMA 167r3 4/14.10.5.6) */
670 #define FTE_CREATION 0x00000001
671 #define FTE_DELETION 0x00000004
672 #define FTE_EFFECTIVE 0x00000008
673 #define FTE_BACKUP 0x00000002
675 /* Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */
676 struct infoTimesExtAttr
683 uint32_t infoTimeExistence;
684 uint8_t infoTimes[0];
685 } __attribute__ ((packed));
687 /* Device Specification (ECMA 167r3 4/14.10.7) */
694 uint32_t impUseLength;
695 uint32_t majorDeviceIdent;
696 uint32_t minorDeviceIdent;
698 } __attribute__ ((packed));
700 /* Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */
707 uint32_t impUseLength;
710 } __attribute__ ((packed));
712 /* Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */
719 uint32_t appUseLength;
722 } __attribute__ ((packed));
724 #define EXTATTR_CHAR_SET 1
725 #define EXTATTR_ALT_PERMS 3
726 #define EXTATTR_FILE_TIMES 5
727 #define EXTATTR_INFO_TIMES 6
728 #define EXTATTR_DEV_SPEC 12
729 #define EXTATTR_IMP_USE 2048
730 #define EXTATTR_APP_USE 65536
733 /* Unallocated Space Entry (ECMA 167r3 4/14.11) */
734 struct unallocSpaceEntry
738 uint32_t lengthAllocDescs;
739 uint8_t allocDescs[0];
740 } __attribute__ ((packed));
742 /* Space Bitmap Descriptor (ECMA 167r3 4/14.12) */
743 struct spaceBitmapDesc
749 } __attribute__ ((packed));
751 /* Partition Integrity Entry (ECMA 167r3 4/14.13) */
752 struct partitionIntegrityEntry
756 timestamp recordingDateAndTime;
757 uint8_t integrityType;
758 uint8_t reserved[175];
761 } __attribute__ ((packed));
763 /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
765 /* Extent Length (ECMA 167r3 4/14.14.1.1) */
766 #define EXT_RECORDED_ALLOCATED 0x00000000
767 #define EXT_NOT_RECORDED_ALLOCATED 0x40000000
768 #define EXT_NOT_RECORDED_NOT_ALLOCATED 0x80000000
769 #define EXT_NEXT_EXTENT_ALLOCDECS 0xC0000000
771 /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
773 /* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
775 /* Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */
776 struct logicalVolHeaderDesc
779 uint8_t reserved[24];
780 } __attribute__ ((packed));
782 /* Path Component (ECMA 167r3 4/14.16.1) */
785 uint8_t componentType;
786 uint8_t lengthComponentIdent;
787 uint16_t componentFileVersionNum;
788 dstring componentIdent[0];
789 } __attribute__ ((packed));
791 /* File Entry (ECMA 167r3 4/14.17) */
792 struct extendedFileEntry
798 uint32_t permissions;
799 uint16_t fileLinkCount;
800 uint8_t recordFormat;
801 uint8_t recordDisplayAttr;
802 uint32_t recordLength;
803 uint64_t informationLength;
805 uint64_t logicalBlocksRecorded;
806 timestamp accessTime;
807 timestamp modificationTime;
808 timestamp createTime;
812 long_ad extendedAttrICB;
813 long_ad streamDirectoryICB;
816 uint32_t lengthExtendedAttr;
817 uint32_t lengthAllocDescs;
818 uint8_t extendedAttr[0];
819 uint8_t allocDescs[0];
820 } __attribute__ ((packed));
822 #endif /* _ECMA_167_H */