VirtualBox

source: vbox/trunk/include/iprt/formats/iso9660.h@ 67794

Last change on this file since 67794 was 67794, checked in by vboxsync, 7 years ago

isomaker: Added API for setting the rock ridge name and adjusted RTFsIsoMakerAddUnnamedDir to take additional attributes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 59.2 KB
Line 
1/* $Id: iso9660.h 67794 2017-07-05 12:29:35Z vboxsync $ */
2/** @file
3 * IPRT, ISO 9660 File System
4 */
5
6/*
7 * Copyright (C) 2017 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef ___iprt_formats_iso9660_h
28#define ___iprt_formats_iso9660_h
29
30#include <iprt/types.h>
31#include <iprt/assert.h>
32
33
34/** @defgroup grp_rt_formats_iso9660 ISO 9660 structures and definitions
35 * @ingroup grp_rt_formats
36 * @{
37 */
38
39
40/** The (default) logical sectors size of ISO 9660. */
41#define ISO9660_SECTOR_SIZE 2048
42/** The (default) sector offset mask of ISO 9660. */
43#define ISO9660_SECTOR_OFFSET_MASK 2047
44/** Maximum filename length (level 2 & 3). */
45#define ISO9660_MAX_NAME_LEN 30
46
47
48/** Accessor for ISO9660U16 and ISO9660U32 that retrievs the member value for
49 * the host endianess. */
50#ifdef RT_BIG_ENDIAN
51# define ISO9660_GET_ENDIAN(a_pInt) ((a_pInt)->be)
52#else
53# define ISO9660_GET_ENDIAN(a_pInt) ((a_pInt)->le)
54#endif
55
56
57/**
58 * ISO 9660 16-bit unsigned integer type.
59 */
60typedef struct ISO9660U16
61{
62 /** Little endian. */
63 uint16_t le;
64 /** Big endian. */
65 uint16_t be;
66} ISO9660U16;
67/** Pointer to an ISO 9660 16-bit unsigned integer type. */
68typedef ISO9660U16 *PISO9660U16;
69/** Pointer to a const ISO 9660 16-bit unsigned integer type. */
70typedef ISO9660U16 const *PCISO9660U16;
71
72/** ISO 9660 big endian 16-bit unsigned integer. */
73typedef uint16_t ISO9660U16BE;
74
75
76/**
77 * ISO 9660 32-bit unsigned integer type.
78 */
79typedef struct ISO9660U32
80{
81 /** Little endian. */
82 uint32_t le;
83 /** Big endian. */
84 uint32_t be;
85} ISO9660U32;
86/** Pointer to an ISO 9660 32-bit unsigned integer type. */
87typedef ISO9660U32 *PISO9660U32;
88/** Pointer to a const ISO 9660 32-bit unsigned integer type. */
89typedef ISO9660U32 const *PCISO9660U32;
90
91/** ISO 9660 little endian 32-bit unsigned integer. */
92typedef uint32_t ISO9660U32LE;
93/** ISO 9660 big endian 32-bit unsigned integer. */
94typedef uint32_t ISO9660U32BE;
95
96/**
97 * ISO 9660 timestamp (date & time).
98 */
99typedef struct ISO9660TIMESTAMP
100{
101 /** 0x00: For digit year (0001-9999). */
102 char achYear[4];
103 /** 0x04: Month of the year (01-12). */
104 char achMonth[2];
105 /** 0x06: Day of month (01-31). */
106 char achDay[2];
107 /** 0x08: Hour of day (00-23). */
108 char achHour[2];
109 /** 0x0a: Minute of hour (00-59). */
110 char achMinute[2];
111 /** 0x0c: Second of minute (00-59). */
112 char achSecond[2];
113 /** 0x0e: Hundreth of second (00-99). */
114 char achCentisecond[2];
115 /** 0x10: The UTC (GMT) offset in 15 min units. */
116 int8_t offUtc;
117} ISO9660TIMESTAMP;
118AssertCompileSize(ISO9660TIMESTAMP, 17);
119/** Pointer to an ISO 9660 timestamp. */
120typedef ISO9660TIMESTAMP *PISO9660TIMESTAMP;
121/** Pointer to a const ISO 9660 timestamp. */
122typedef ISO9660TIMESTAMP const *PCISO9660TIMESTAMP;
123
124/**
125 * ISO 9660 record timestamp (date & time).
126 */
127typedef struct ISO9660RECTIMESTAMP
128{
129 /** 0: Years since 1900. */
130 uint8_t bYear;
131 /** 1: Month of year (1-12). */
132 uint8_t bMonth;
133 /** 2: Day of month (1-31). */
134 uint8_t bDay;
135 /** 3: Hour of day (0-23). */
136 uint8_t bHour;
137 /** 4: Minute of hour (0-59). */
138 uint8_t bMinute;
139 /** 5: Second of minute (0-59). */
140 uint8_t bSecond;
141 /** 6: The UTC (GMT) offset in 15 min units. */
142 int8_t offUtc;
143} ISO9660RECTIMESTAMP;
144AssertCompileSize(ISO9660RECTIMESTAMP, 7);
145/** Pointer to an ISO 9660 record timestamp. */
146typedef ISO9660RECTIMESTAMP *PISO9660RECTIMESTAMP;
147/** Pointer to a const ISO 9660 record timestamp. */
148typedef ISO9660RECTIMESTAMP const *PCISO9660RECTIMESTAMP;
149
150
151/**
152 * ISO 9660 directory record.
153 */
154#pragma pack(1)
155typedef struct ISO9660DIRREC
156{
157 /** 0x00: Length of this record in bytes. */
158 uint8_t cbDirRec;
159 /** 0x01: Extended attribute record length in logical blocks. */
160 uint8_t cExtAttrBlocks;
161 /** 0x02: Location of extent (logical block number).
162 * @note Misaligned. */
163 ISO9660U32 offExtent;
164 /** 0x0a: Size of the data (file section). Does not include EAs.
165 * @note Misaligned. */
166 ISO9660U32 cbData;
167 /** 0x12: Recording time and date. */
168 ISO9660RECTIMESTAMP RecTime;
169 /** 0x19: File flags (ISO9660_FILE_FLAGS_XXX). */
170 uint8_t fFileFlags;
171 /** 0x1a: File unit size for interlaved mode. */
172 uint8_t bFileUnitSize;
173 /** 0x1b: Interlave gap size. */
174 uint8_t bInterleaveGapSize;
175 /** 0x1c: Volume sequence number where the extent resides. */
176 ISO9660U16 VolumeSeqNo;
177 /** 0x20: Length of file identifier field. */
178 uint8_t bFileIdLength;
179 /** 0x21: File identifier (d-characters or d1-characters). */
180 char achFileId[1];
181 /* There are more fields following:
182 * - one byte optional padding so the following field is at an even boundrary.
183 * - system use field until cbDirRec is reached.
184 */
185} ISO9660DIRREC;
186#pragma pack()
187AssertCompileMemberOffset(ISO9660DIRREC, offExtent, 0x02);
188AssertCompileMemberOffset(ISO9660DIRREC, cbData, 0x0a);
189AssertCompileMemberOffset(ISO9660DIRREC, RecTime, 0x12);
190AssertCompileMemberOffset(ISO9660DIRREC, fFileFlags, 0x19);
191AssertCompileMemberOffset(ISO9660DIRREC, bFileIdLength, 0x20);
192AssertCompileMemberOffset(ISO9660DIRREC, achFileId, 0x21);
193/** Pointer to an ISO 9660 directory record. */
194typedef ISO9660DIRREC *PISO9660DIRREC;
195/** Pointer to a const ISO 9660 directory record. */
196typedef ISO9660DIRREC const *PCISO9660DIRREC;
197
198/** @name ISO9660_FILE_FLAGS_XXX
199 * @{ */
200/** Existence - Hide the file from the user. */
201#define ISO9660_FILE_FLAGS_HIDDEN UINT8_C(0x01)
202/** Directory - Indicates a directory as apposed to a regular file (0). */
203#define ISO9660_FILE_FLAGS_DIRECTORY UINT8_C(0x02)
204/** Assocated File - Indicates that the file is an associated file. */
205#define ISO9660_FILE_FLAGS_ASSOCIATED_FILE UINT8_C(0x04)
206/** Record - Indicates specified file content record format (see EAs). */
207#define ISO9660_FILE_FLAGS_RECORD UINT8_C(0x08)
208/** Protection - Indicates owner/group or permission protection in EAs. */
209#define ISO9660_FILE_FLAGS_PROTECTION UINT8_C(0x10)
210/** Reserved bit, MBZ. */
211#define ISO9660_FILE_FLAGS_RESERVED_5 UINT8_C(0x20)
212/** Reserved bit, MBZ. */
213#define ISO9660_FILE_FLAGS_RESERVED_6 UINT8_C(0x40)
214/** Multi-extend - Indicates that this isn't the final record for the file.
215 * @remarks Use for working around 4 GiB file size limitation. */
216#define ISO9660_FILE_FLAGS_MULTI_EXTENT UINT8_C(0x80)
217/** @} */
218
219
220/**
221 * ISO 9660 path table record.
222 */
223#pragma pack(1)
224typedef struct ISO9660PATHREC
225{
226 /** 0x00: Length of the achDirId field in bytes. */
227 uint8_t cbDirId;
228 /** 0x01: Extended attribute record length in bytes? */
229 uint8_t cbExtAttr;
230 /** 0x02: Location of extent (logical block number).
231 * @note Endianess depends on table.
232 * @note Misaligned. */
233 uint32_t offExtent;
234 /** 0x06: Parent directory number.
235 * @note Endianess depends on table. */
236 uint16_t idParentRec;
237 /** 0x08: Directory identifier (d-characters or d1-characters). */
238 char achDirId[RT_FLEXIBLE_ARRAY];
239 /* There will be a zero padding byte following if the directory identifier length is odd. */
240} ISO9660PATHREC;
241#pragma pack()
242AssertCompileMemberOffset(ISO9660PATHREC, cbExtAttr, 0x01);
243AssertCompileMemberOffset(ISO9660PATHREC, offExtent, 0x02);
244AssertCompileMemberOffset(ISO9660PATHREC, idParentRec, 0x06);
245AssertCompileMemberOffset(ISO9660PATHREC, achDirId, 0x08);
246/** Pointer to an ISO 9660 path table record. */
247typedef ISO9660PATHREC *PISO9660PATHREC;
248/** Pointer to a const ISO 9660 path table record. */
249typedef ISO9660PATHREC const *PCISO9660PATHREC;
250
251
252/**
253 * ISO 9660 extended attribute record.
254 */
255typedef struct ISO9660EXATTRREC
256{
257 /** 0x000: The owener ID. */
258 ISO9660U16 idOwner;
259 /** 0x004: The owener ID. */
260 ISO9660U16 idGroup;
261 /** 0x008: File permissions (ISO9660_PERM_XXX). */
262 ISO9660U16BE fPermissions;
263 /** 0x00a: File creation timestamp. */
264 ISO9660TIMESTAMP BirthTimestamp;
265 /** 0x01b: File modification timestamp. */
266 ISO9660TIMESTAMP ModifyTimestamp;
267 /** 0x02c: File expiration timestamp. */
268 ISO9660TIMESTAMP ExpireTimestamp;
269 /** 0x03d: File effective timestamp. */
270 ISO9660TIMESTAMP EffectiveTimestamp;
271 /** 0x04e: Record format. */
272 uint8_t bRecordFormat;
273 /** 0x04f: Record attributes. */
274 uint8_t fRecordAttrib;
275 /** 0x050: Record length. */
276 ISO9660U16 RecordLength;
277 /** 0x054: System identifier (a-characters or a1-characters). */
278 char achSystemId[0x20];
279 /** 0x074: System specific bytes. */
280 uint8_t abSystemUse[64];
281 /** 0x0b4: Extended attribute record version (ISO9660EXATTRREC_VERSION). */
282 uint8_t bExtRecVersion;
283 /** 0x0b5: Length of escape sequences. */
284 uint8_t cbEscapeSequences;
285 /** 0x0b6: Reserved for the future, MBZ. */
286 uint8_t abReserved183[64];
287 /** 0x0f6: Length of the application use field. */
288 ISO9660U16 cbAppUse;
289 /** 0x0fa: Variable sized application use field. */
290 uint8_t abAppUse[RT_FLEXIBLE_ARRAY];
291 /* This is followed by escape sequences with length given by cbEscapeSequnces. */
292} ISO9660EXATTRREC;
293AssertCompileMemberOffset(ISO9660EXATTRREC, EffectiveTimestamp, 0x03d);
294AssertCompileMemberOffset(ISO9660EXATTRREC, cbAppUse, 0x0f6);
295
296/** The ISO9660EXATTRREC::bExtRecVersion value. */
297#define ISO9660EXATTRREC_VERSION UINT8_C(0x01)
298
299/** @name ISO9660_PERM_XXX - ISO9660EXATTRREC::fPermissions
300 * @{ */
301/** @todo figure out this wird permission stuff... */
302/** @} */
303
304
305/**
306 * ISO 9660 volume descriptor header.
307 */
308typedef struct ISO9660VOLDESCHDR
309{
310 /** Descriptor type ISO9660VOLDESC_TYPE_XXX. */
311 uint8_t bDescType;
312 /** Standard identifier 'CD001' */
313 uint8_t achStdId[5];
314 /** The descriptor version. */
315 uint8_t bDescVersion;
316 /* (This is followed by the descriptor specific data). */
317} ISO9660VOLDESCHDR;
318AssertCompileSize(ISO9660VOLDESCHDR, 7);
319/** Pointer to a volume descriptor header. */
320typedef ISO9660VOLDESCHDR *PISO9660VOLDESCHDR;
321/** Pointer to a const volume descriptor header. */
322typedef ISO9660VOLDESCHDR const *PCISO9660VOLDESCHDR;
323
324/** @name ISO9660VOLDESC_TYPE_XXX - volume descriptor types
325 * @{ */
326/** See ISO9660BOOTRECORD. */
327#define ISO9660VOLDESC_TYPE_BOOT_RECORD UINT8_C(0x00)
328/** See ISO9660PRIMARYVOLDESC. */
329#define ISO9660VOLDESC_TYPE_PRIMARY UINT8_C(0x01)
330/** See ISO9660SUPVOLDESC. */
331#define ISO9660VOLDESC_TYPE_SUPPLEMENTARY UINT8_C(0x02)
332/** See ISO9660VOLPARTDESC. */
333#define ISO9660VOLDESC_TYPE_PARTITION UINT8_C(0x03)
334/** Terminates the volume descriptor set. Has no data (zeros), version is 1. */
335#define ISO9660VOLDESC_TYPE_TERMINATOR UINT8_C(0xff)
336/** @} */
337
338/** The value of ISO9660VOLDESCHDR::achStdId */
339#define ISO9660VOLDESC_STD_ID "CD001"
340#define ISO9660VOLDESC_STD_ID_0 'C'
341#define ISO9660VOLDESC_STD_ID_1 'D'
342#define ISO9660VOLDESC_STD_ID_2 '0'
343#define ISO9660VOLDESC_STD_ID_3 '0'
344#define ISO9660VOLDESC_STD_ID_4 '1'
345
346
347
348/**
349 * ISO 9660 boot record (volume descriptor).
350 */
351typedef struct ISO9660BOOTRECORD
352{
353 /** The volume descriptor header.
354 * Type is ISO9660VOLDESC_TYPE_BOOT_RECORD and version
355 * ISO9660BOOTRECORD_VERSION. */
356 ISO9660VOLDESCHDR Hdr;
357 /** Boot system identifier string (a-characters). */
358 char achBootSystemId[32];
359 /** Boot identifier (a-characters). */
360 char achBootId[32];
361 /** Boot system specific content. */
362 uint8_t abBootSystemSpecific[1977];
363} ISO9660BOOTRECORD;
364AssertCompileSize(ISO9660BOOTRECORD, ISO9660_SECTOR_SIZE);
365/** Pointer to an ISO 9660 boot record. */
366typedef ISO9660BOOTRECORD *PISO9660BOOTRECORD;
367/** Pointer to a const ISO 9660 boot record. */
368typedef ISO9660BOOTRECORD const *PCISO9660BOOTRECORD;
369
370/** The value of ISO9660BOOTRECORD::Hdr.uDescVersion. */
371#define ISO9660BOOTRECORD_VERSION UINT8_C(1)
372
373
374/**
375 * ISO 9660 boot record (volume descriptor), El Torito variant.
376 */
377#pragma pack(1)
378typedef struct ISO9660BOOTRECORDELTORITO
379{
380 /** 0x000: The volume descriptor header.
381 * Type is ISO9660VOLDESC_TYPE_BOOT_RECORD and version
382 * ISO9660BOOTRECORD_VERSION. */
383 ISO9660VOLDESCHDR Hdr;
384 /** 0x007: Boot system identifier string,
385 * zero padded ISO9660BOOTRECORDELTORITO_BOOT_SYSTEM_ID. */
386 char achBootSystemId[32];
387 /** 0x027: Boot identifier - all zeros. */
388 char achBootId[32];
389 /** 0x047: Boot catalog location (block offset), always (?) little endian.
390 * @note Misaligned. */
391 uint32_t offBootCatalog;
392 /** 0x04b: Unused - all zeros. */
393 uint8_t abBootSystemSpecific[1973];
394} ISO9660BOOTRECORDELTORITO;
395#pragma pack()
396AssertCompileSize(ISO9660BOOTRECORDELTORITO, ISO9660_SECTOR_SIZE);
397/** Pointer to an ISO 9660 El Torito boot record. */
398typedef ISO9660BOOTRECORDELTORITO *PISO9660BOOTRECORDELTORITO;
399/** Pointer to a const ISO 9660 El Torito boot record. */
400typedef ISO9660BOOTRECORDELTORITO const *PCISO9660BOOTRECORDELTORITO;
401
402/** The value of ISO9660BOOTRECORDELTORITO::achBootSystemId (zero padded). */
403#define ISO9660BOOTRECORDELTORITO_BOOT_SYSTEM_ID "EL TORITO SPECIFICATION"
404
405
406/**
407 * ISO 9660 primary volume descriptor.
408 */
409typedef struct ISO9660PRIMARYVOLDESC
410{
411 /** 0x000: The volume descriptor header.
412 * Type is ISO9660VOLDESC_TYPE_PRIMARY and version
413 * ISO9660PRIMARYVOLDESC_VERSION. */
414 ISO9660VOLDESCHDR Hdr;
415 /** 0x007: Explicit alignment zero padding. */
416 uint8_t bPadding8;
417 /** 0x008: System identifier (a-characters). */
418 char achSystemId[32];
419 /** 0x028: Volume identifier (d-characters). */
420 char achVolumeId[32];
421 /** 0x048: Unused field, zero filled. */
422 ISO9660U32 Unused73;
423 /** 0x050: Volume space size in logical blocks (cbLogicalBlock). */
424 ISO9660U32 VolumeSpaceSize;
425 /** 0x058: Unused field(s), zero filled. */
426 uint8_t abUnused89[32];
427 /** 0x078: The number of volumes in the volume set. */
428 ISO9660U16 cVolumesInSet;
429 /** 0x07c: Volume sequence number. */
430 ISO9660U16 VolumeSeqNo;
431 /** 0x080: Logical block size in bytes. */
432 ISO9660U16 cbLogicalBlock;
433 /** 0x084: Path table size. */
434 ISO9660U32 cbPathTable;
435 /** 0x08c: Type L(ittle endian) path table location (block offset). */
436 ISO9660U32LE offTypeLPathTable;
437 /** 0x090: Optional type L(ittle endian) path table location (block offset). */
438 ISO9660U32LE offOptionalTypeLPathTable;
439 /** 0x094: Type M (big endian) path table location (block offset). */
440 ISO9660U32BE offTypeMPathTable;
441 /** 0x098: Optional type M (big endian) path table location (block offset). */
442 ISO9660U32BE offOptionalTypeMPathTable;
443 /** 0x09c: Directory entry for the root directory (union). */
444 union
445 {
446 uint8_t ab[34];
447 ISO9660DIRREC DirRec;
448 } RootDir;
449 /** 0x0be: Volume set identifier (d-characters). */
450 char achVolumeSetId[128];
451 /** 0x13e: Publisher identifier (a-characters). Alternatively, it may refere to
452 * a file in the root dir if it starts with 0x5f and restricts itself to 8
453 * d-characters. */
454 char achPublisherId[128];
455 /** 0x1be: Data preparer identifier (a-characters).
456 * Same file reference alternative as previous field. */
457 char achDataPreparerId[128];
458 /** 0x23e: Application identifier (a-characters).
459 * Same file reference alternative as previous field. */
460 char achApplicationId[128];
461 /** 0x2be: Copyright (root) file identifier (d-characters).
462 * All spaces if none. */
463 char achCopyrightFileId[37];
464 /** 0x2e3: Abstract (root) file identifier (d-characters).
465 * All spaces if none. */
466 char achAbstractFileId[37];
467 /** 0x308: Bibliographic file identifier (d-characters).
468 * All spaces if none. */
469 char achBibliographicFileId[37];
470 /** 0x32d: Volume creation date and time. */
471 ISO9660TIMESTAMP BirthTime;
472 /** 0x33e: Volume modification date and time. */
473 ISO9660TIMESTAMP ModifyTime;
474 /** 0x34f: Volume (data) expiration date and time.
475 * If not specified, don't regard data as obsolete. */
476 ISO9660TIMESTAMP ExpireTime;
477 /** 0x360: Volume (data) effective date and time.
478 * If not specified, info can be used immediately. */
479 ISO9660TIMESTAMP EffectiveTime;
480 /** 0x371: File structure version (ISO9660_FILE_STRUCTURE_VERSION). */
481 uint8_t bFileStructureVersion;
482 /** 0x372: Reserve for future, MBZ. */
483 uint8_t bReserved883;
484 /** 0x373: Reserve for future, MBZ. */
485 uint8_t abAppUse[512];
486 /** 0x573: Reserved for future standardization, MBZ. */
487 uint8_t abReserved1396[653];
488} ISO9660PRIMARYVOLDESC;
489AssertCompileSize(ISO9660PRIMARYVOLDESC, ISO9660_SECTOR_SIZE);
490/** Pointer to a ISO 9660 primary volume descriptor. */
491typedef ISO9660PRIMARYVOLDESC *PISO9660PRIMARYVOLDESC;
492/** Pointer to a const ISO 9660 primary volume descriptor. */
493typedef ISO9660PRIMARYVOLDESC const *PCISO9660PRIMARYVOLDESC;
494
495/** The value of ISO9660PRIMARYVOLDESC::Hdr.uDescVersion. */
496#define ISO9660PRIMARYVOLDESC_VERSION UINT8_C(1)
497/** The value of ISO9660PRIMARYVOLDESC::bFileStructureVersion and
498 * ISO9660SUPVOLDESC::bFileStructureVersion. */
499#define ISO9660_FILE_STRUCTURE_VERSION UINT8_C(1)
500
501
502
503/**
504 * ISO 9660 supplementary volume descriptor.
505 *
506 * This is in the large parts identicial to the primary descriptor, except it
507 * have a few more fields where the primary one has reserved spaces.
508 */
509typedef struct ISO9660SUPVOLDESC
510{
511 /** 0x000: The volume descriptor header.
512 * Type is ISO9660VOLDESC_TYPE_SUPPLEMENTARY and version
513 * ISO9660SUPVOLDESC_VERSION. */
514 ISO9660VOLDESCHDR Hdr;
515 /** 0x007: Volume flags (ISO9660SUPVOLDESC_VOL_F_XXX).
516 * @note This is reserved in the primary volume descriptor. */
517 uint8_t fVolumeFlags;
518 /** 0x008: System identifier (a1-characters) of system that can act upon
519 * sectors 0 thru 15.
520 * @note Purpose differs from primary description. */
521 char achSystemId[32];
522 /** 0x028: Volume identifier (d1-characters).
523 * @note Character set differs from primary description. */
524 char achVolumeId[32];
525 /** 0x048: Unused field, zero filled. */
526 ISO9660U32 Unused73;
527 /** 0x050: Volume space size in logical blocks (cbLogicalBlock). */
528 ISO9660U32 VolumeSpaceSize;
529 /** 0x058: Escape sequences.
530 * Complicated stuff, see ISO 2022 and ECMA-35.
531 * @note This is reserved in the primary volume descriptor. */
532 uint8_t abEscapeSequences[32];
533 /** 0x078: The number of volumes in the volume set. */
534 ISO9660U16 cVolumesInSet;
535 /** 0x07c: Volume sequence number. */
536 ISO9660U16 VolumeSeqNo;
537 /** 0x080: Logical block size in bytes. */
538 ISO9660U16 cbLogicalBlock;
539 /** 0x084: Path table size. */
540 ISO9660U32 cbPathTable;
541 /** 0x08c: Type L(ittle endian) path table location (block offset). */
542 ISO9660U32LE offTypeLPathTable;
543 /** 0x090: Optional type L(ittle endian) path table location (block offset). */
544 ISO9660U32LE offOptionalTypeLPathTable;
545 /** 0x094: Type M (big endian) path table location (block offset). */
546 ISO9660U32BE offTypeMPathTable;
547 /** 0x098: Optional type M (big endian) path table location (block offset). */
548 ISO9660U32BE offOptionalTypeMPathTable;
549 /** 0x09c: Directory entry for the root directory (union). */
550 union
551 {
552 uint8_t ab[34];
553 ISO9660DIRREC DirRec;
554 } RootDir;
555 /** 0x0be: Volume set identifier (d1-characters).
556 * @note Character set differs from primary description. */
557 char achVolumeSetId[128];
558 /** 0x13e: Publisher identifier (a1-characters). Alternatively, it may refere
559 * to a file in the root dir if it starts with 0x5f and restricts itself to 8
560 * d1-characters.
561 * @note Character set differs from primary description. */
562 char achPublisherId[128];
563 /** 0x1be: Data preparer identifier (a1-characters).
564 * Same file reference alternative as previous field.
565 * @note Character set differs from primary description. */
566 char achDataPreparerId[128];
567 /** 0x23e: Application identifier (a1-characters).
568 * Same file reference alternative as previous field.
569 * @note Character set differs from primary description. */
570 char achApplicationId[128];
571 /** 0x2be: Copyright (root) file identifier (d1-characters).
572 * All spaces if none.
573 * @note Character set differs from primary description. */
574 char achCopyrightFileId[37];
575 /** 0x2e3: Abstract (root) file identifier (d1-characters).
576 * All spaces if none.
577 * @note Character set differs from primary description. */
578 char achAbstractFileId[37];
579 /** 0x308: Bibliographic file identifier (d1-characters).
580 * All spaces if none.
581 * @note Character set differs from primary description. */
582 char achBibliographicFileId[37];
583 /** 0x32d: Volume creation date and time. */
584 ISO9660TIMESTAMP BirthTime;
585 /** 0x33e: Volume modification date and time. */
586 ISO9660TIMESTAMP ModifyTime;
587 /** 0x34f: Volume (data) expiration date and time.
588 * If not specified, don't regard data as obsolete. */
589 ISO9660TIMESTAMP ExpireTime;
590 /** 0x360: Volume (data) effective date and time.
591 * If not specified, info can be used immediately. */
592 ISO9660TIMESTAMP EffectiveTime;
593 /** 0x371: File structure version (ISO9660_FILE_STRUCTURE_VERSION). */
594 uint8_t bFileStructureVersion;
595 /** 0x372: Reserve for future, MBZ. */
596 uint8_t bReserved883;
597 /** 0x373: Reserve for future, MBZ. */
598 uint8_t abAppUse[512];
599 /** 0x573: Reserved for future standardization, MBZ. */
600 uint8_t abReserved1396[653];
601} ISO9660SUPVOLDESC;
602AssertCompileSize(ISO9660SUPVOLDESC, ISO9660_SECTOR_SIZE);
603/** Pointer to a ISO 9660 supplementary volume descriptor. */
604typedef ISO9660SUPVOLDESC *PISO9660SUPVOLDESC;
605/** Pointer to a const ISO 9660 supplementary volume descriptor. */
606typedef ISO9660SUPVOLDESC const *PCISO9660SUPVOLDESC;
607/** The value of ISO9660SUPVOLDESC::Hdr.uDescVersion. */
608#define ISO9660SUPVOLDESC_VERSION UINT8_C(1)
609
610/** @name ISO9660SUPVOLDESC_VOL_F_XXX - ISO9660SUPVOLDESC::fVolumeFlags
611 * @{ */
612#define ISO9660SUPVOLDESC_VOL_F_ESC_ONLY_REG UINT8_C(0x00)
613#define ISO9660SUPVOLDESC_VOL_F_ESC_NOT_REG UINT8_C(0x01)
614/** @} */
615
616
617
618/**
619 * ISO 9660 volume partition descriptor.
620 */
621typedef struct ISO9660VOLPARTDESC
622{
623 /** 0x000: The volume descriptor header.
624 * Type is ISO9660VOLDESC_TYPE_PARTITION and version
625 * ISO9660VOLPARTDESC_VERSION. */
626 ISO9660VOLDESCHDR Hdr;
627 /** 0x007: Alignment padding. */
628 uint8_t bPadding8;
629 /** 0x008: System identifier (a-characters). */
630 char achSystemId[32];
631 /** 0x028: Volume partition identifier (d-characters). */
632 char achVolumePartitionId[32];
633 /** 0x048: The location of the partition (logical block number). */
634 ISO9660U32 offVolumePartition;
635 /** 0x050: The partition size in logical blocks (cbLogicalBlock). */
636 ISO9660U32 VolumePartitionSize;
637 /** 0x058: System specific data. */
638 uint8_t achSystemUse[1960];
639} ISO9660VOLPARTDESC;
640AssertCompileSize(ISO9660VOLPARTDESC, ISO9660_SECTOR_SIZE);
641/** Pointer to an ISO 9660 volume partition description. */
642typedef ISO9660VOLPARTDESC *PISO9660VOLPARTDESC;
643/** Pointer to a const ISO 9660 volume partition description. */
644typedef ISO9660VOLPARTDESC const *PCISO9660VOLPARTDESC;
645/** The value of ISO9660VOLPARTDESC::Hdr.uDescVersion. */
646#define ISO9660VOLPARTDESC_VERSION UINT8_C(1)
647
648
649
650/** @name Joliet escape sequence identifiers.
651 *
652 * These bytes appears in the supplementary volume descriptor field
653 * abEscapeSequences. The ISO9660SUPVOLDESC_VOL_F_ESC_NOT_REG flags will not
654 * be set.
655 *
656 * @{ */
657#define ISO9660_JOLIET_ESC_SEQ_0 UINT8_C(0x25) /**< First escape sequence byte.*/
658#define ISO9660_JOLIET_ESC_SEQ_1 UINT8_C(0x2f) /**< Second escape sequence byte.*/
659#define ISO9660_JOLIET_ESC_SEQ_2_LEVEL_1 UINT8_C(0x40) /**< Third escape sequence byte: level 1 */
660#define ISO9660_JOLIET_ESC_SEQ_2_LEVEL_2 UINT8_C(0x43) /**< Third escape sequence byte: level 2 */
661#define ISO9660_JOLIET_ESC_SEQ_2_LEVEL_3 UINT8_C(0x45) /**< Third escape sequence byte: level 3 */
662/** @} */
663
664
665/** The size of an El Torito boot catalog entry. */
666#define ISO9660_ELTORITO_ENTRY_SIZE UINT32_C(0x20)
667
668/**
669 * El Torito boot catalog: Validation entry.
670 *
671 * This is the first entry in the boot catalog. It is followed by a
672 * ISO9660ELTORITODEFAULTENTRY, which in turn is followed by a
673 * ISO9660ELTORITOSECTIONHEADER.
674 */
675typedef struct ISO9660ELTORITOVALIDATIONENTRY
676{
677 /** 0x00: The header ID (ISO9660_ELTORITO_HEADER_ID_VALIDATION_ENTRY). */
678 uint8_t bHeaderId;
679 /** 0x01: The platform ID (ISO9660_ELTORITO_PLATFORM_ID_XXX). */
680 uint8_t bPlatformId;
681 /** 0x02: Reserved, MBZ. */
682 uint16_t u16Reserved;
683 /** 0x04: String ID of the developer of the CD/DVD-ROM. */
684 char achId[24];
685 /** 0x1c: The checksum. */
686 uint16_t u16Checksum;
687 /** 0x1e: Key byte 1 (ISO9660_ELTORITO_KEY_BYTE_1). */
688 uint8_t bKey1;
689 /** 0x1f: Key byte 2 (ISO9660_ELTORITO_KEY_BYTE_2). */
690 uint8_t bKey2;
691} ISO9660ELTORITOVALIDATIONENTRY;
692AssertCompileSize(ISO9660ELTORITOVALIDATIONENTRY, ISO9660_ELTORITO_ENTRY_SIZE);
693/** Pointer to an El Torito validation entry. */
694typedef ISO9660ELTORITOVALIDATIONENTRY *PISO9660ELTORITOVALIDATIONENTRY;
695/** Pointer to a const El Torito validation entry. */
696typedef ISO9660ELTORITOVALIDATIONENTRY const *PCISO9660ELTORITOVALIDATIONENTRY;
697
698/** ISO9660ELTORITOVALIDATIONENTRY::bKey1 value. */
699#define ISO9660_ELTORITO_KEY_BYTE_1 UINT8_C(0x55)
700/** ISO9660ELTORITOVALIDATIONENTRY::bKey2 value. */
701#define ISO9660_ELTORITO_KEY_BYTE_2 UINT8_C(0xaa)
702
703
704/** @name ISO9660_ELTORITO_HEADER_ID_XXX - header IDs.
705 * @{ */
706/** Header ID for a ISO9660ELTORITOVALIDATIONENTRY. */
707#define ISO9660_ELTORITO_HEADER_ID_VALIDATION_ENTRY UINT8_C(0x01)
708/** Header ID for a ISO9660ELTORITOSECTIONHEADER. */
709#define ISO9660_ELTORITO_HEADER_ID_SECTION_HEADER UINT8_C(0x90)
710/** Header ID for the final ISO9660ELTORITOSECTIONHEADER. */
711#define ISO9660_ELTORITO_HEADER_ID_FINAL_SECTION_HEADER UINT8_C(0x91)
712/** @} */
713
714
715/** @name ISO9660_ELTORITO_PLATFORM_ID_XXX - El Torito Platform IDs
716 * @{ */
717#define ISO9660_ELTORITO_PLATFORM_ID_X86 UINT8_C(0x00) /**< 80x86 */
718#define ISO9660_ELTORITO_PLATFORM_ID_PPC UINT8_C(0x01) /**< PowerPC */
719#define ISO9660_ELTORITO_PLATFORM_ID_MAC UINT8_C(0x02) /**< Mac */
720#define ISO9660_ELTORITO_PLATFORM_ID_EFI UINT8_C(0xef) /**< UEFI */
721/** @} */
722
723
724/**
725 * El Torito boot catalog: Section header entry.
726 *
727 * A non-final section header entry is followed by
728 * ISO9660ELTORITOSECTIONHEADER::cEntries ISO9660ELTORITOSECTIONTENTRY instances.
729 */
730typedef struct ISO9660ELTORITOSECTIONHEADER
731{
732 /** 0x00: Header ID - ISO9660_ELTORITO_HEADER_ID_SECTION_HEADER or
733 * ISO9660_ELTORITO_HEADER_ID_FINAL_SECTION_HEADER (if final). */
734 uint8_t bHeaderId;
735 /** 0x01: The platform ID (ISO9660_ELTORITO_PLATFORM_ID_XXX). */
736 uint8_t bPlatformId;
737 /** 0x02: Number of entries in this section (i.e. following this header). */
738 uint16_t cEntries;
739 /** 0x04: String ID for the section. */
740 char achSectionId[28];
741} ISO9660ELTORITOSECTIONHEADER;
742AssertCompileSize(ISO9660ELTORITOSECTIONHEADER, ISO9660_ELTORITO_ENTRY_SIZE);
743/** Pointer to an El Torito section header entry. */
744typedef ISO9660ELTORITOSECTIONHEADER *PISO9660ELTORITOSECTIONHEADER;
745/** Pointer to a const El Torito section header entry. */
746typedef ISO9660ELTORITOSECTIONHEADER const *PCISO9660ELTORITOSECTIONHEADER;
747
748
749/**
750 * El Torito boot catalog: Default (initial) entry.
751 *
752 * Followed by ISO9660ELTORITOSECTIONHEADER.
753 *
754 * Differs from ISO9660ELTORITOSECTIONENTRY in that it doesn't have a
755 * selection criteria and no media flags (only type).
756 */
757typedef struct ISO9660ELTORITODEFAULTENTRY
758{
759 /** 0x00: Boot indicator (ISO9660_ELTORITO_BOOT_INDICATOR_XXX). */
760 uint8_t bBootIndicator;
761 /** 0x01: Boot media type. The first four bits are defined by
762 * ISO9660_ELTORITO_BOOT_MEDIA_TYPE_XXX, whereas the top four bits MBZ. */
763 uint8_t bBootMediaType;
764 /** 0x02: Load segment - load address divided by 0x10. */
765 uint16_t uLoadSeg;
766 /** 0x04: System type from image partition table. */
767 uint8_t bSystemType;
768 /** 0x05: Unused, MBZ. */
769 uint8_t bUnused;
770 /** 0x06: Number of emulated 512 byte sectors to load. */
771 uint16_t cEmulatedSectorsToLoad;
772 /** 0x08: Image location in the ISO (block offset), always (?) little endian. */
773 uint32_t offBootImage;
774 /** 0x0c: Reserved, MBZ */
775 uint8_t abReserved[20];
776} ISO9660ELTORITODEFAULTENTRY;
777AssertCompileSize(ISO9660ELTORITODEFAULTENTRY, ISO9660_ELTORITO_ENTRY_SIZE);
778/** Pointer to an El Torito default (initial) entry. */
779typedef ISO9660ELTORITODEFAULTENTRY *PISO9660ELTORITODEFAULTENTRY;
780/** Pointer to a const El Torito default (initial) entry. */
781typedef ISO9660ELTORITODEFAULTENTRY const *PCISO9660ELTORITODEFAULTENTRY;
782
783
784/**
785 * El Torito boot catalg: Section entry.
786 */
787typedef struct ISO9660ELTORITOSECTIONENTRY
788{
789 /** 0x00: Boot indicator (ISO9660_ELTORITO_BOOT_INDICATOR_XXX). */
790 uint8_t bBootIndicator;
791 /** 0x01: Boot media type and flags. The first four bits are defined by
792 * ISO9660_ELTORITO_BOOT_MEDIA_TYPE_XXX and the top four bits by
793 * ISO9660_ELTORITO_BOOT_MEDIA_F_XXX. */
794 uint8_t bBootMediaType;
795 /** 0x02: Load segment - load address divided by 0x10. */
796 uint16_t uLoadSeg;
797 /** 0x04: System type from image partition table. */
798 uint8_t bSystemType;
799 /** 0x05: Unused, MBZ. */
800 uint8_t bUnused;
801 /** 0x06: Number of emulated 512 byte sectors to load. */
802 uint16_t cEmulatedSectorsToLoad;
803 /** 0x08: Image location in the ISO (block offset), always (?) little endian. */
804 uint32_t offBootImage;
805 /** 0x0c: Selection criteria type (ISO9660_ELTORITO_SEL_CRIT_TYPE_XXX). */
806 uint8_t bSelectionCriteriaType;
807 /** 0x0c: Selection criteria specific data. */
808 uint8_t abSelectionCriteria[19];
809} ISO9660ELTORITOSECTIONENTRY;
810AssertCompileSize(ISO9660ELTORITOSECTIONENTRY, ISO9660_ELTORITO_ENTRY_SIZE);
811/** Pointer to an El Torito default (initial) entry. */
812typedef ISO9660ELTORITOSECTIONENTRY *PISO9660ELTORITOSECTIONENTRY;
813/** Pointer to a const El Torito default (initial) entry. */
814typedef ISO9660ELTORITOSECTIONENTRY const *PCISO9660ELTORITOSECTIONENTRY;
815
816
817/** @name ISO9660_ELTORITO_BOOT_INDICATOR_XXX - Boot indicators.
818 * @{ */
819#define ISO9660_ELTORITO_BOOT_INDICATOR_BOOTABLE UINT8_C(0x88)
820#define ISO9660_ELTORITO_BOOT_INDICATOR_NOT_BOOTABLE UINT8_C(0x00)
821/** @} */
822
823/** @name ISO9660_ELTORITO_BOOT_MEDIA_TYPE_XXX - Boot media types.
824 * @{ */
825#define ISO9660_ELTORITO_BOOT_MEDIA_TYPE_NO_EMULATION UINT8_C(0x0)
826#define ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_2_MB UINT8_C(0x1)
827#define ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_44_MB UINT8_C(0x2)
828#define ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_2_88_MB UINT8_C(0x3)
829#define ISO9660_ELTORITO_BOOT_MEDIA_TYPE_HARD_DISK UINT8_C(0x4)
830#define ISO9660_ELTORITO_BOOT_MEDIA_TYPE_MASK UINT8_C(0xf) /**< The media type mask. */
831/** @} */
832
833/** @name ISO9660_ELTORITO_BOOT_MEDIA_F_XXX - Boot media flags.
834 * These only applies to the section entry, not to the default (initial) entry.
835 * @{ */
836#define ISO9660_ELTORITO_BOOT_MEDIA_F_RESERVED UINT8_C(0x10) /**< Reserved bit, MBZ. */
837#define ISO9660_ELTORITO_BOOT_MEDIA_F_CONTINUATION UINT8_C(0x20) /**< Contiunation entry follows. */
838#define ISO9660_ELTORITO_BOOT_MEDIA_F_ATAPI_DRIVER UINT8_C(0x40) /**< Image contains an ATAPI driver. */
839#define ISO9660_ELTORITO_BOOT_MEDIA_F_SCSI_DRIVERS UINT8_C(0x80) /**< Image contains SCSI drivers. */
840#define ISO9660_ELTORITO_BOOT_MEDIA_F_MASK UINT8_C(0xf0) /**< The media/entry flag mask. */
841/** @} */
842
843/** @name ISO9660_ELTORITO_SEL_CRIT_TYPE_XXX - Selection criteria type.
844 * @{ */
845#define ISO9660_ELTORITO_SEL_CRIT_TYPE_NONE UINT8_C(0x00) /**< No selection criteria */
846#define ISO9660_ELTORITO_SEL_CRIT_TYPE_LANG_AND_VERSION UINT8_C(0x01) /**< Language and version (IBM). */
847/** @} */
848
849
850/**
851 * El Torito boot catalog: Section entry extension.
852 *
853 * This is used for carrying additional selection criteria data. It follows
854 * a ISO9660ELTORITOSECTIONENTRY.
855 */
856typedef struct ISO9660ELTORITOSECTIONENTRYEXT
857{
858 /** 0x00: Extension indicator (ISO9660_ELTORITO_SECTION_ENTRY_EXT_ID). */
859 uint8_t bExtensionId;
860 /** 0x01: Selection criteria extension flags (ISO9660_ELTORITO_SECTION_ENTRY_EXT_F_XXX). */
861 uint8_t fFlags;
862 /** 0x02: Selection critiera data. */
863 uint8_t abSelectionCriteria[30];
864} ISO9660ELTORITOSECTIONENTRYEXT;
865AssertCompileSize(ISO9660ELTORITOSECTIONENTRYEXT, ISO9660_ELTORITO_ENTRY_SIZE);
866/** Pointer to an El Torito default (initial) entry. */
867typedef ISO9660ELTORITOSECTIONENTRYEXT *PISO9660ELTORITOSECTIONENTRYEXT;
868/** Pointer to a const El Torito default (initial) entry. */
869typedef ISO9660ELTORITOSECTIONENTRYEXT const *PCISO9660ELTORITOSECTIONENTRYEXT;
870
871/** Value of ISO9660ELTORITOSECTIONENTRYEXT::bExtensionId. */
872#define ISO9660_ELTORITO_SECTION_ENTRY_EXT_ID UINT8_C(0x44)
873
874/** @name ISO9660_ELTORITO_SECTION_ENTRY_EXT_F_XXX - ISO9660ELTORITOSECTIONENTRYEXT::fFlags
875 * @{ */
876#define ISO9660_ELTORITO_SECTION_ENTRY_EXT_F_MORE UINT8_C(0x20) /**< Further extension entries follows. */
877#define ISO9660_ELTORITO_SECTION_ENTRY_EXT_F_UNUSED_MASK UINT8_C(0xef) /**< Mask of all unused bits. */
878/** @} */
879
880
881/**
882 * Boot information table used by isolinux and GRUB2 El Torito boot files.
883 */
884typedef struct ISO9660SYSLINUXINFOTABLE
885{
886 /** 0x00/0x08: Offset of the primary volume descriptor (block offset). */
887 uint32_t offPrimaryVolDesc;
888 /** 0x04/0x0c: Offset of the boot file (block offset). */
889 uint32_t offBootFile;
890 /** 0x08/0x10: Size of the boot file in bytes. */
891 uint32_t cbBootFile;
892 /** 0x0c/0x14: Boot file checksum.
893 * This is the sum of all the 32-bit words in the image, start at the end of
894 * this structure (i.e. offset 64). */
895 uint32_t uChecksum;
896 /** 0x10/0x18: Reserved for future fun. */
897 uint32_t auReserved[10];
898} ISO9660SYSLINUXINFOTABLE;
899AssertCompileSize(ISO9660SYSLINUXINFOTABLE, 56);
900/** Pointer to a syslinux boot information table. */
901typedef ISO9660SYSLINUXINFOTABLE *PISO9660SYSLINUXINFOTABLE;
902/** Pointer to a const syslinux boot information table. */
903typedef ISO9660SYSLINUXINFOTABLE const *PCISO9660SYSLINUXINFOTABLE;
904
905/** The file offset of the isolinux boot info table. */
906#define ISO9660SYSLINUXINFOTABLE_OFFSET 8
907
908
909
910/**
911 * System Use Sharing Protocol Protocol (SUSP) header.
912 */
913typedef struct ISO9660SUSPHDR
914{
915 /** Signature byte 1. */
916 uint8_t bSig1;
917 /** Signature byte 2. */
918 uint8_t bSig2;
919 /** Length of the entry (including the header). */
920 uint8_t cbEntry;
921 /** Entry version number. */
922 uint8_t bVersion;
923} ISO9660SUSPHDR;
924AssertCompileSize(ISO9660SUSPHDR, 4);
925/** Pointer to a SUSP header. */
926typedef ISO9660SUSPHDR *PISO9660SUSPHDR;
927/** Pointer to a const SUSP header. */
928typedef ISO9660SUSPHDR const *PCISO9660SUSPHDR;
929
930/**
931 * SUSP continuation entry (CE).
932 */
933typedef struct ISO9660SUSPCE
934{
935 /** Header (ISO9660SUSPCE_SIG1, ISO9660SUSPCE_SIG2, ISO9660SUSPCE_VER). */
936 ISO9660SUSPHDR Hdr;
937 /** The offset of the continutation data block (block offset). */
938 ISO9660U32 offBlock;
939 /** The byte offset in the block of the contiuation data. */
940 ISO9660U32 offData;
941 /** The size of the continuation data. */
942 ISO9660U32 cbData;
943} ISO9660SUSPCE;
944AssertCompileSize(ISO9660SUSPCE, 28);
945/** Pointer to a SUSP continuation entry. */
946typedef ISO9660SUSPCE *PISO9660SUSPCE;
947/** Pointer to a const SUSP continuation entry. */
948typedef ISO9660SUSPCE const *PCISO9660SUSPCE;
949#define ISO9660SUSPCE_SIG1 'C' /**< SUSP continutation entry signature byte 1. */
950#define ISO9660SUSPCE_SIG2 'E' /**< SUSP continutation entry signature byte 2. */
951#define ISO9660SUSPCE_VER 1 /**< SUSP continutation entry version number. */
952
953/**
954 * SUSP padding entry (PD).
955 */
956typedef struct ISO9660SUSPPD
957{
958 /** Header (ISO9660SUSPPD_SIG1, ISO9660SUSPPD_SIG2, ISO9660SUSPPD_VER). */
959 ISO9660SUSPHDR Hdr;
960 /* Padding follows. */
961} ISO9660SUSPPD;
962AssertCompileSize(ISO9660SUSPPD, 4);
963/** Pointer to a SUSP padding entry. */
964typedef ISO9660SUSPPD *PISO9660SUSPPD;
965/** Pointer to a const SUSP padding entry. */
966typedef ISO9660SUSPPD const *PCISO9660SUSPPD;
967#define ISO9660SUSPPD_SIG1 'P' /**< SUSP padding entry signature byte 1. */
968#define ISO9660SUSPPD_SIG2 'D' /**< SUSP padding entry signature byte 2. */
969#define ISO9660SUSPPD_VER 1 /**< SUSP padding entry version number. */
970
971/**
972 * SUSP system use protocol entry (SP)
973 *
974 * This is only used in the '.' record of the root directory.
975 */
976typedef struct ISO9660SUSPSP
977{
978 /** Header (ISO9660SUSPSP_SIG1, ISO9660SUSPSP_SIG2,
979 * ISO9660SUSPSP_LEN, ISO9660SUSPSP_VER). */
980 ISO9660SUSPHDR Hdr;
981 /** Check byte 1 (ISO9660SUSPSP_CHECK1). */
982 uint8_t bCheck1;
983 /** Check byte 2 (ISO9660SUSPSP_CHECK2). */
984 uint8_t bCheck2;
985 /** Number of bytes to skip within the system use field of each directory
986 * entry (except the '.' entry of the root, since that's where this is). */
987 uint8_t cbSkip;
988} ISO9660SUSPSP;
989AssertCompileSize(ISO9660SUSPSP, 7);
990/** Pointer to a SUSP padding entry. */
991typedef ISO9660SUSPSP *PISO9660SUSPSP;
992/** Pointer to a const SUSP padding entry. */
993typedef ISO9660SUSPSP const *PCISO9660SUSPSP;
994#define ISO9660SUSPSP_SIG1 'S' /**< SUSP system use protocol entry signature byte 1. */
995#define ISO9660SUSPSP_SIG2 'P' /**< SUSP system use protocol entry signature byte 2. */
996#define ISO9660SUSPSP_VER 1 /**< SUSP system use protocol entry version number. */
997#define ISO9660SUSPSP_LEN 7 /**< SUSP system use protocol entry length (fixed). */
998#define ISO9660SUSPSP_CHECK1 UINT8_C(0xbe) /**< SUSP system use protocol entry check byte 1. */
999#define ISO9660SUSPSP_CHECK2 UINT8_C(0xef) /**< SUSP system use protocol entry check byte 2. */
1000
1001/**
1002 * SUSP terminator entry (ST)
1003 *
1004 * Used to terminate system use entries.
1005 */
1006typedef struct ISO9660SUSPST
1007{
1008 /** Header (ISO9660SUSPST_SIG1, ISO9660SUSPST_SIG2,
1009 * ISO9660SUSPST_LEN, ISO9660SUSPST_VER). */
1010 ISO9660SUSPHDR Hdr;
1011} ISO9660SUSPST;
1012AssertCompileSize(ISO9660SUSPST, 4);
1013/** Pointer to a SUSP padding entry. */
1014typedef ISO9660SUSPST *PISO9660SUSPST;
1015/** Pointer to a const SUSP padding entry. */
1016typedef ISO9660SUSPST const *PCISO9660SUSPST;
1017#define ISO9660SUSPST_SIG1 'S' /**< SUSP system use protocol entry signature byte 1. */
1018#define ISO9660SUSPST_SIG2 'T' /**< SUSP system use protocol entry signature byte 2. */
1019#define ISO9660SUSPST_VER 1 /**< SUSP system use protocol entry version number. */
1020#define ISO9660SUSPST_LEN 4 /**< SUSP system use protocol entry length (fixed). */
1021
1022/**
1023 * SUSP extension record entry (ER)
1024 *
1025 * This is only used in the '.' record of the root directory. There can be multiple of these.
1026 */
1027typedef struct ISO9660SUSPER
1028{
1029 /** Header (ISO9660SUSPER_SIG1, ISO9660SUSPER_SIG2, ISO9660SUSPER_VER). */
1030 ISO9660SUSPHDR Hdr;
1031 /** The length of the identifier component. */
1032 uint8_t cchIdentifier;
1033 /** The length of the description component. */
1034 uint8_t cchDescription;
1035 /** The length of the source component. */
1036 uint8_t cchSource;
1037 /** The extension version number. */
1038 uint8_t bVersion;
1039 /** The payload: first @a cchIdentifier chars of identifier string, second
1040 * @a cchDescription chars of description string, thrid @a cchSource chars
1041 * of source string. Variable length. */
1042 char achPayload[RT_FLEXIBLE_ARRAY_IN_NESTED_UNION];
1043} ISO9660SUSPER;
1044AssertCompileMemberOffset(ISO9660SUSPER, achPayload, 8);
1045/** Pointer to a SUSP padding entry. */
1046typedef ISO9660SUSPER *PISO9660SUSPER;
1047/** Pointer to a const SUSP padding entry. */
1048typedef ISO9660SUSPER const *PCISO9660SUSPER;
1049#define ISO9660SUSPER_SIG1 'E' /**< SUSP extension record entry signature byte 1. */
1050#define ISO9660SUSPER_SIG2 'R' /**< SUSP extension record entry signature byte 2. */
1051#define ISO9660SUSPER_VER 1 /**< SUSP extension record entry version number. */
1052
1053/**
1054 * SUSP extension sequence entry (ES)
1055 *
1056 * This is only used in the '.' record of the root directory.
1057 */
1058typedef struct ISO9660SUSPES
1059{
1060 /** Header (ISO9660SUSPES_SIG1, ISO9660SUSPES_SIG2, ISO9660SUSPES_VER). */
1061 ISO9660SUSPHDR Hdr;
1062 /** The ER entry sequence number of the extension comming first. */
1063 uint8_t iFirstExtension;
1064} ISO9660SUSPES;
1065AssertCompileSize(ISO9660SUSPES, 5);
1066/** Pointer to a SUSP padding entry. */
1067typedef ISO9660SUSPES *PISO9660SUSPES;
1068/** Pointer to a const SUSP padding entry. */
1069typedef ISO9660SUSPES const *PCISO9660SUSPES;
1070#define ISO9660SUSPES_SIG1 'E' /**< SUSP extension sequence entry signature byte 1. */
1071#define ISO9660SUSPES_SIG2 'S' /**< SUSP extension sequence entry signature byte 2. */
1072#define ISO9660SUSPES_VER 1 /**< SUSP extension sequence entry version number. */
1073#define ISO9660SUSPES_LEN 5 /**< SUSP extension sequence entry length (fixed). */
1074
1075
1076/** RRIP ER identifier string from Rock Ridge Interchange Protocol v1.10 specs. */
1077#define ISO9660_RRIP_ID "RRIP_1991A"
1078/** RRIP ER recommended description string (from RRIP v1.10 specs). */
1079#define ISO9660_RRIP_DESC "THE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS"
1080/** RRIP ER recommended source string (from RRIP v1.10 specs). */
1081#define ISO9660_RRIP_SRC "PLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION."
1082
1083/** RRIP ER identifier string from RRIP IEEE P1282 v1.12 draft. */
1084#define ISO9660_RRIP_1_12_ID "IEEE_P1282"
1085/** RRIP ER recommended description string (RRIP IEEE P1282 v1.12 draft). */
1086#define ISO9660_RRIP_1_12_DESC "THE IEEE P1282 PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS."
1087/** RRIP ER recommended source string (RRIP IEEE P1282 v1.12 draft). */
1088#define ISO9660_RRIP_1_12_SRC "PLEASE CONTACT THE IEEE STANDARDS DEPARTMENT, PISCATAWAY, NJ, USA FOR THE P1282 SPECIFICATION."
1089
1090/**
1091 * Rock ridge interchange protocol - posix attribute entry (PX).
1092 */
1093typedef struct ISO9660RRIPPX
1094{
1095 /** Header (ISO9660RRIPPX_SIG1, ISO9660RRIPPX_SIG2,
1096 * ISO9660RRIPPX_LEN, ISO9660RRIPPX_VER). */
1097 ISO9660SUSPHDR Hdr;
1098 /** The file mode (RTFS_UNIX_XXX, RTFS_TYPE_XXX). */
1099 ISO9660U32 fMode;
1100 /** Number of hardlinks. */
1101 ISO9660U32 cHardlinks;
1102 /** User ID. */
1103 ISO9660U32 uid;
1104 /** Group ID. */
1105 ISO9660U32 gid;
1106 /** Inode number. */
1107 ISO9660U32 INode;
1108} ISO9660RRIPPX;
1109AssertCompileSize(ISO9660RRIPPX, 44);
1110/** Pointer to a RRIP posix attribute entry. */
1111typedef ISO9660RRIPPX *PISO9660RRIPPX;
1112/** Pointer to a const RRIP posix attribute entry. */
1113typedef ISO9660RRIPPX const *PCISO9660RRIPPX;
1114#define ISO9660RRIPPX_SIG1 'P' /**< RRIP posix attribute entry signature byte 1. */
1115#define ISO9660RRIPPX_SIG2 'X' /**< RRIP posix attribute entry signature byte 2. */
1116#define ISO9660RRIPPX_VER 1 /**< RRIP posix attribute entry version number. */
1117#define ISO9660RRIPPX_LEN 44 /**< RRIP posix attribute entry length (fixed). */
1118
1119
1120/**
1121 * Rock ridge interchange protocol - timestamp entry (TF).
1122 */
1123typedef struct ISO9660RRIPTF
1124{
1125 /** Header (ISO9660RRIPTF_SIG1, ISO9660RRIPTF_SIG2, ISO9660RRIPTF_VER). */
1126 ISO9660SUSPHDR Hdr;
1127 /** Flags, ISO9660RRIPTF_F_XXX. */
1128 uint8_t fFlags;
1129 /** Timestamp payload bytes (variable size and format). */
1130 uint8_t abPayload[RT_FLEXIBLE_ARRAY_IN_NESTED_UNION];
1131} ISO9660RRIPTF;
1132AssertCompileMemberOffset(ISO9660RRIPTF, abPayload, 5);
1133/** Pointer to a RRIP timestamp entry. */
1134typedef ISO9660RRIPTF *PISO9660RRIPTF;
1135/** Pointer to a const RRIP timestamp entry. */
1136typedef ISO9660RRIPTF const *PCISO9660RRIPTF;
1137#define ISO9660RRIPTF_SIG1 'T' /**< RRIP child link entry signature byte 1. */
1138#define ISO9660RRIPTF_SIG2 'F' /**< RRIP child link entry signature byte 2. */
1139#define ISO9660RRIPTF_VER 1 /**< RRIP child link entry version number. */
1140
1141/** @name ISO9660RRIPTF_F_XXX - Timestmap flags.
1142 * @{ */
1143#define ISO9660RRIPTF_F_BIRTH UINT8_C(0x01) /**< Birth (creation) timestamp is recorded. */
1144#define ISO9660RRIPTF_F_MODIFY UINT8_C(0x02) /**< Modification timestamp is recorded. */
1145#define ISO9660RRIPTF_F_ACCESS UINT8_C(0x04) /**< Accessed timestamp is recorded. */
1146#define ISO9660RRIPTF_F_CHANGE UINT8_C(0x08) /**< Attribute change timestamp is recorded. */
1147#define ISO9660RRIPTF_F_BACKUP UINT8_C(0x10) /**< Backup timestamp is recorded. */
1148#define ISO9660RRIPTF_F_EXPIRATION UINT8_C(0x20) /**< Expiration timestamp is recorded. */
1149#define ISO9660RRIPTF_F_EFFECTIVE UINT8_C(0x40) /**< Effective timestamp is recorded. */
1150#define ISO9660RRIPTF_F_LONG_FORM UINT8_C(0x80) /**< If set ISO9660TIMESTAMP is used, otherwise ISO9660RECTIMESTAMP. */
1151/** @} */
1152
1153/**
1154 * Calculates the length of a 'TF' entry given the flags.
1155 *
1156 * @returns Length in bytes.
1157 * @param fFlags The flags (ISO9660RRIPTF_F_XXX).
1158 */
1159DECLINLINE(uint8_t) Iso9660RripTfCalcLength(uint8_t fFlags)
1160{
1161 unsigned cTimestamps = ((fFlags & ISO9660RRIPTF_F_BIRTH) != 0)
1162 + ((fFlags & ISO9660RRIPTF_F_MODIFY) != 0)
1163 + ((fFlags & ISO9660RRIPTF_F_ACCESS) != 0)
1164 + ((fFlags & ISO9660RRIPTF_F_CHANGE) != 0)
1165 + ((fFlags & ISO9660RRIPTF_F_BACKUP) != 0)
1166 + ((fFlags & ISO9660RRIPTF_F_EXPIRATION) != 0)
1167 + ((fFlags & ISO9660RRIPTF_F_EFFECTIVE) != 0);
1168 return (uint8_t)( cTimestamps * (fFlags & ISO9660RRIPTF_F_LONG_FORM ? sizeof(ISO9660TIMESTAMP) : sizeof(ISO9660RECTIMESTAMP))
1169 + RT_OFFSETOF(ISO9660RRIPTF, abPayload));
1170}
1171
1172
1173/**
1174 * Rock ridge interchange protocol - posix device number entry (PN).
1175 *
1176 * Mandatory for block or character devices.
1177 */
1178typedef struct ISO9660RRIPPN
1179{
1180 /** Header (ISO9660RRIPPN_SIG1, ISO9660RRIPPN_SIG2,
1181 * ISO9660RRIPPN_LEN, ISO9660RRIPPN_VER). */
1182 ISO9660SUSPHDR Hdr;
1183 /** The major device number. */
1184 ISO9660U32 Major;
1185 /** The minor device number. */
1186 ISO9660U32 Minor;
1187} ISO9660RRIPPN;
1188AssertCompileSize(ISO9660RRIPPN, 20);
1189/** Pointer to a RRIP posix attribute entry. */
1190typedef ISO9660RRIPPN *PISO9660RRIPPN;
1191/** Pointer to a const RRIP posix attribute entry. */
1192typedef ISO9660RRIPPN const *PCISO9660RRIPPN;
1193#define ISO9660RRIPPN_SIG1 'P' /**< RRIP posix device number entry signature byte 1. */
1194#define ISO9660RRIPPN_SIG2 'N' /**< RRIP posix device number entry signature byte 2. */
1195#define ISO9660RRIPPN_VER 1 /**< RRIP posix device number entry version number. */
1196#define ISO9660RRIPPN_LEN 20 /**< RRIP posix device number entry length (fixed). */
1197
1198/**
1199 * Rock ridge interchange protocol - symlink entry (SL).
1200 *
1201 * Mandatory for symbolic links.
1202 */
1203typedef struct ISO9660RRIPSL
1204{
1205 /** Header (ISO9660RRIPSL_SIG1, ISO9660RRIPSL_SIG2, ISO9660RRIPSL_VER). */
1206 ISO9660SUSPHDR Hdr;
1207 /** Flags (0 or ISO9660RRIP_SL_F_CONTINUE). */
1208 uint8_t fFlags;
1209 /** Variable length of components. First byte in each component is a
1210 * combination of ISO9660RRIP_SL_C_XXX flag values. The second byte the
1211 * length of character data following it. */
1212 uint8_t abComponents[RT_FLEXIBLE_ARRAY_IN_NESTED_UNION];
1213} ISO9660RRIPSL;
1214AssertCompileMemberOffset(ISO9660RRIPSL, abComponents, 5);
1215/** Pointer to a RRIP symbolic link entry. */
1216typedef ISO9660RRIPSL *PISO9660RRIPSL;
1217/** Pointer to a const RRIP symbolic link entry. */
1218typedef ISO9660RRIPSL const *PCISO9660RRIPSL;
1219#define ISO9660RRIPSL_SIG1 'S' /**< RRIP symbolic link entry signature byte 1. */
1220#define ISO9660RRIPSL_SIG2 'L' /**< RRIP symbolic link entry signature byte 2. */
1221#define ISO9660RRIPSL_VER 1 /**< RRIP symbolic link entry version number. */
1222/** ISO9660RRIPSL.fFlags - When set another symlink entry follows this one. */
1223#define ISO9660RRIP_SL_F_CONTINUE UINT8_C(0x01)
1224/** @name ISO9660RRIP_SL_C_XXX - Symlink component flags.
1225 * @note These matches ISO9660RRIP_NM_F_XXX.
1226 * @{ */
1227/** Indicates there are more components. */
1228#define ISO9660RRIP_SL_C_CONTINUE UINT8_C(0x01)
1229/** Refer to '.' (the current dir). */
1230#define ISO9660RRIP_SL_C_CURRENT UINT8_C(0x02)
1231/** Refer to '..' (the parent dir). */
1232#define ISO9660RRIP_SL_C_PARENT UINT8_C(0x04)
1233/** Refer to '/' (the root dir). */
1234#define ISO9660RRIP_SL_C_ROOT UINT8_C(0x08)
1235/** Reserved / historically was mount point reference. */
1236#define ISO9660RRIP_SL_C_MOUNT_POINT UINT8_C(0x10)
1237/** Reserved / historically was uname network node name. */
1238#define ISO9660RRIP_SL_C_UNAME UINT8_C(0x20)
1239/** Reserved mask (considers historically bits reserved). */
1240#define ISO9660RRIP_SL_C_RESERVED_MASK UINT8_C(0xf0)
1241/** @} */
1242
1243
1244/**
1245 * Rock ridge interchange protocol - name entry (NM).
1246 */
1247typedef struct ISO9660RRIPNM
1248{
1249 /** Header (ISO9660RRIPNM_SIG1, ISO9660RRIPNM_SIG2, ISO9660RRIPNM_VER). */
1250 ISO9660SUSPHDR Hdr;
1251 /** Flags (ISO9660RRIP_NM_F_XXX). */
1252 uint8_t fFlags;
1253 /** The name part (if any). */
1254 char achName[RT_FLEXIBLE_ARRAY_IN_NESTED_UNION];
1255} ISO9660RRIPNM;
1256AssertCompileMemberOffset(ISO9660RRIPNM, achName, 5);
1257/** Pointer to a RRIP name entry. */
1258typedef ISO9660RRIPNM *PISO9660RRIPNM;
1259/** Pointer to a const RRIP name entry. */
1260typedef ISO9660RRIPNM const *PCISO9660RRIPNM;
1261#define ISO9660RRIPNM_SIG1 'N' /**< RRIP name entry signature byte 1. */
1262#define ISO9660RRIPNM_SIG2 'M' /**< RRIP name entry signature byte 2. */
1263#define ISO9660RRIPNM_VER 1 /**< RRIP name entry version number. */
1264/** @name ISO9660RRIP_NM_F_XXX - Name flags.
1265 * @note These matches ISO9660RRIP_SL_C_XXX.
1266 * @{ */
1267/** Indicates there are more 'NM' entries. */
1268#define ISO9660RRIP_NM_F_CONTINUE UINT8_C(0x01)
1269/** Refer to '.' (the current dir). */
1270#define ISO9660RRIP_NM_F_CURRENT UINT8_C(0x02)
1271/** Refer to '..' (the parent dir). */
1272#define ISO9660RRIP_NM_F_PARENT UINT8_C(0x04)
1273/** Reserved / historically was uname network node name. */
1274#define ISO9660RRIP_NM_F_UNAME UINT8_C(0x20)
1275/** Reserved mask (considers historically bits reserved). */
1276#define ISO9660RRIP_NM_F_RESERVED_MASK UINT8_C(0xf8)
1277/** @} */
1278
1279
1280/**
1281 * Rock ridge interchange protocol - child link entry (CL).
1282 *
1283 * This is used for relocated directories. Relocated directries are employed
1284 * to bypass the ISO 9660 maximum tree depth of 8.
1285 *
1286 * The size of the directory and everything else is found in the '.' entry in
1287 * the specified location. Only the name (NM or dir rec) and this link record
1288 * should be used.
1289 */
1290typedef struct ISO9660RRIPCL
1291{
1292 /** Header (ISO9660RRIPCL_SIG1, ISO9660RRIPCL_SIG2,
1293 * ISO9660RRIPCL_LEN, ISO9660RRIPCL_VER). */
1294 ISO9660SUSPHDR Hdr;
1295 /** The offset of the directory data (block offset). */
1296 ISO9660U32 offExtend;
1297} ISO9660RRIPCL;
1298AssertCompileSize(ISO9660RRIPCL, 12);
1299/** Pointer to a RRIP child link entry. */
1300typedef ISO9660RRIPCL *PISO9660RRIPCL;
1301/** Pointer to a const RRIP child link entry. */
1302typedef ISO9660RRIPCL const *PCISO9660RRIPCL;
1303#define ISO9660RRIPCL_SIG1 'C' /**< RRIP child link entry signature byte 1. */
1304#define ISO9660RRIPCL_SIG2 'L' /**< RRIP child link entry signature byte 2. */
1305#define ISO9660RRIPCL_VER 1 /**< RRIP child link entry version number. */
1306#define ISO9660RRIPCL_LEN 12 /**< RRIP child link entry length. */
1307
1308
1309/**
1310 * Rock ridge interchange protocol - parent link entry (PL).
1311 *
1312 * This is used in relocated directories. Relocated directries are employed
1313 * to bypass the ISO 9660 maximum tree depth of 8.
1314 *
1315 * The size of the directory and everything else is found in the '.' entry in
1316 * the specified location. Only the name (NM or dir rec) and this link record
1317 * should be used.
1318 */
1319typedef struct ISO9660RRIPPL
1320{
1321 /** Header (ISO9660RRIPPL_SIG1, ISO9660RRIPPL_SIG2,
1322 * ISO9660RRIPPL_LEN, ISO9660RRIPPL_VER). */
1323 ISO9660SUSPHDR Hdr;
1324 /** The offset of the directory data (block offset). */
1325 ISO9660U32 offExtend;
1326} ISO9660RRIPPL;
1327AssertCompileSize(ISO9660RRIPPL, 12);
1328/** Pointer to a RRIP parent link entry. */
1329typedef ISO9660RRIPPL *PISO9660RRIPPL;
1330/** Pointer to a const RRIP parent link entry. */
1331typedef ISO9660RRIPPL const *PCISO9660RRIPPL;
1332#define ISO9660RRIPPL_SIG1 'P' /**< RRIP parent link entry signature byte 1. */
1333#define ISO9660RRIPPL_SIG2 'L' /**< RRIP parent link entry signature byte 2. */
1334#define ISO9660RRIPPL_VER 1 /**< RRIP parent link entry version number. */
1335#define ISO9660RRIPPL_LEN 12 /**< RRIP parent link entry length. */
1336
1337
1338/**
1339 * Rock ridge interchange protocol - relocated entry (RE).
1340 *
1341 * This is used in the directory record for a relocated directory in the
1342 * holding place high up in the directory hierarchy. The system may choose to
1343 * ignore/hide entries with this entry present.
1344 */
1345typedef struct ISO9660RRIPRE
1346{
1347 /** Header (ISO9660RRIPRE_SIG1, ISO9660RRIPRE_SIG2,
1348 * ISO9660RRIPRE_LEN, ISO9660RRIPRE_VER). */
1349 ISO9660SUSPHDR Hdr;
1350} ISO9660RRIPRE;
1351AssertCompileSize(ISO9660RRIPRE, 4);
1352/** Pointer to a RRIP parent link entry. */
1353typedef ISO9660RRIPRE *PISO9660RRIPRE;
1354/** Pointer to a const RRIP parent link entry. */
1355typedef ISO9660RRIPRE const *PCISO9660RRIPRE;
1356#define ISO9660RRIPRE_SIG1 'R' /**< RRIP relocated entry signature byte 1. */
1357#define ISO9660RRIPRE_SIG2 'E' /**< RRIP relocated entry signature byte 2. */
1358#define ISO9660RRIPRE_VER 1 /**< RRIP relocated entry version number. */
1359#define ISO9660RRIPRE_LEN 4 /**< RRIP relocated entry length. */
1360
1361
1362/**
1363 * Rock ridge interchange protocol - sparse file entry (SF).
1364 */
1365#pragma pack(1)
1366typedef struct ISO9660RRIPSF
1367{
1368 /** Header (ISO9660RRIPSF_SIG1, ISO9660RRIPSF_SIG2,
1369 * ISO9660RRIPSF_LEN, ISO9660RRIPSF_VER). */
1370 ISO9660SUSPHDR Hdr;
1371 /** The high 32-bits of the 64-bit sparse file size. */
1372 ISO9660U32 cbSparseHi;
1373 /** The low 32-bits of the 64-bit sparse file size. */
1374 ISO9660U32 cbSparseLo;
1375 /** The table depth. */
1376 uint8_t cDepth;
1377} ISO9660RRIPSF;
1378#pragma pack()
1379AssertCompileSize(ISO9660RRIPSF, 21);
1380/** Pointer to a RRIP symbolic link entry. */
1381typedef ISO9660RRIPSF *PISO9660RRIPSF;
1382/** Pointer to a const RRIP symbolic link entry. */
1383typedef ISO9660RRIPSF const *PCISO9660RRIPSF;
1384#define ISO9660RRIPSF_SIG1 'S' /**< RRIP spare file entry signature byte 1. */
1385#define ISO9660RRIPSF_SIG2 'F' /**< RRIP spare file entry signature byte 2. */
1386#define ISO9660RRIPSF_VER 1 /**< RRIP spare file entry version number. */
1387#define ISO9660RRIPSF_LEN 21 /**< RRIP spare file entry length. */
1388
1389/** @name ISO9660RRIP_SF_TAB_F_XXX - Sparse table format.
1390 * @{ */
1391/** The 24-bit logical block number mask.
1392 * This is somewhat complicated, see docs. MBZ for EMPTY. */
1393#define ISO9660RRIP_SF_TAB_F_BLOCK_MASK UINT32_C(0x00ffffff)
1394/** Reserved bits, MBZ. */
1395#define ISO9660RRIP_SF_TAB_F_RESERVED RT_BIT_32()
1396/** References a sub-table with 256 entries (ISO9660U32). */
1397#define ISO9660RRIP_SF_TAB_F_TABLE RT_BIT_32(30)
1398/** Zero data region. */
1399#define ISO9660RRIP_SF_TAB_F_EMPTY RT_BIT_32(31)
1400/** @} */
1401
1402
1403/**
1404 * SUSP and RRIP union.
1405 */
1406typedef union ISO9660SUSPUNION
1407{
1408 ISO9660SUSPHDR Hdr; /**< SUSP header . */
1409 ISO9660SUSPCE CE; /**< SUSP continuation entry. */
1410 ISO9660SUSPPD PD; /**< SUSP padding entry. */
1411 ISO9660SUSPSP SP; /**< SUSP system use protocol entry. */
1412 ISO9660SUSPST ST; /**< SUSP terminator entry. */
1413 ISO9660SUSPER ER; /**< SUSP extension record entry. */
1414 ISO9660SUSPES ES; /**< SUSP extension sequence entry. */
1415 ISO9660RRIPPX PX; /**< RRIP posix attribute entry. */
1416 ISO9660RRIPTF TF; /**< RRIP timestamp entry. */
1417 ISO9660RRIPPN PN; /**< RRIP posix device number entry. */
1418 ISO9660RRIPSF SF; /**< RRIP sparse file entry. */
1419 ISO9660RRIPSL SL; /**< RRIP symbolic link entry. */
1420 ISO9660RRIPNM NM; /**< RRIP name entry. */
1421 ISO9660RRIPCL CL; /**< RRIP child link entry. */
1422 ISO9660RRIPPL PL; /**< RRIP parent link entry. */
1423 ISO9660RRIPRE RE; /**< RRIP relocated entry. */
1424} ISO9660SUSPUNION;
1425/** Pointer to a SUSP and RRIP union. */
1426typedef ISO9660SUSPUNION *PISO9660SUSPUNION;
1427/** Pointer to a const SUSP and RRIP union. */
1428typedef ISO9660SUSPUNION *PCISO9660SUSPUNION;
1429
1430
1431/** @} */
1432
1433#endif
1434
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette