VirtualBox

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

Last change on this file since 66735 was 66735, checked in by vboxsync, 8 years ago

iso9660vfs.cpp: Can find and read files from iso.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 24.3 KB
Line 
1/* $Id: iso9660.h 66735 2017-05-01 23:26:04Z 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
43/** Accessor for ISO9660U16 and ISO9660U32 that retrievs the member value for
44 * the host endianess. */
45#ifdef RT_BIG_ENDIAN
46# define ISO9660_GET_ENDIAN(a_pInt) ((a_pInt)->be)
47#else
48# define ISO9660_GET_ENDIAN(a_pInt) ((a_pInt)->le)
49#endif
50
51
52/**
53 * ISO 9660 16-bit unsigned integer type.
54 */
55typedef struct ISO9660U16
56{
57 /** Little endian. */
58 uint16_t le;
59 /** Big endian. */
60 uint16_t be;
61} ISO9660U16;
62/** Pointer to an ISO 9660 16-bit unsigned integer type. */
63typedef ISO9660U16 *PISO9660U16;
64/** Pointer to a const ISO 9660 16-bit unsigned integer type. */
65typedef ISO9660U16 const *PCISO9660U16;
66
67/** ISO 9660 big endian 16-bit unsigned integer. */
68typedef uint16_t ISO9660U16BE;
69
70
71/**
72 * ISO 9660 32-bit unsigned integer type.
73 */
74typedef struct ISO9660U32
75{
76 /** Little endian. */
77 uint32_t le;
78 /** Big endian. */
79 uint32_t be;
80} ISO9660U32;
81/** Pointer to an ISO 9660 32-bit unsigned integer type. */
82typedef ISO9660U32 *PISO9660U32;
83/** Pointer to a const ISO 9660 32-bit unsigned integer type. */
84typedef ISO9660U32 const *PCISO9660U32;
85
86/** ISO 9660 little endian 32-bit unsigned integer. */
87typedef uint32_t ISO9660U32LE;
88/** ISO 9660 big endian 32-bit unsigned integer. */
89typedef uint32_t ISO9660U32BE;
90
91/**
92 * ISO 9660 timestamp (date & time).
93 */
94typedef struct ISO9660TIMESTAMP
95{
96 /** 0x00: For digit year (0001-9999). */
97 char achYear[4];
98 /** 0x04: Month of the year (01-12). */
99 char achMonth[2];
100 /** 0x06: Day of month (01-31). */
101 char achDay[2];
102 /** 0x08: Hour of day (00-23). */
103 char achHour[2];
104 /** 0x0a: Minute of hour (00-59). */
105 char achMinute[2];
106 /** 0x0c: Second of minute (00-59). */
107 char achSecond[2];
108 /** 0x0e: Hundreth of second (00-99). */
109 char achCentisecond[2];
110 /** 0x10: The UTC (GMT) offset in 15 min units. */
111 int8_t offUtc;
112} ISO9660TIMESTAMP;
113AssertCompileSize(ISO9660TIMESTAMP, 17);
114/** Pointer to an ISO 9660 timestamp. */
115typedef ISO9660TIMESTAMP *PISO9660TIMESTAMP;
116/** Pointer to a const ISO 9660 timestamp. */
117typedef ISO9660TIMESTAMP const *PCISO9660TIMESTAMP;
118
119/**
120 * ISO 9660 record timestamp (date & time).
121 */
122typedef struct ISO9660RECTIMESTAMP
123{
124 /** 0: Years since 1900. */
125 uint8_t bYear;
126 /** 1: Month of year (1-12). */
127 uint8_t bMonth;
128 /** 2: Day of month (1-31). */
129 uint8_t bDay;
130 /** 3: Hour of day (0-23). */
131 uint8_t bHour;
132 /** 4: Minute of hour (0-59). */
133 uint8_t bMinute;
134 /** 5: Second of minute (0-59). */
135 uint8_t bSecond;
136 /** 6: The UTC (GMT) offset in 15 min units. */
137 int8_t offUtc;
138} ISO9660RECTIMESTAMP;
139AssertCompileSize(ISO9660RECTIMESTAMP, 7);
140/** Pointer to an ISO 9660 record timestamp. */
141typedef ISO9660RECTIMESTAMP *PISO9660RECTIMESTAMP;
142/** Pointer to a const ISO 9660 record timestamp. */
143typedef ISO9660RECTIMESTAMP const *PCISO9660RECTIMESTAMP;
144
145
146/**
147 * ISO 9660 directory record.
148 */
149#pragma pack(1)
150typedef struct ISO9660DIRREC
151{
152 /** 0x00: Length of this record in bytes. */
153 uint8_t cbDirRec;
154 /** 0x01: Extended attribute record length in bytes? */
155 uint8_t cbExtAttr;
156 /** 0x02: Location of extent (logical block number).
157 * @note Misaligned. */
158 ISO9660U32 offExtent;
159 /** 0x0a: Size of the data (file section). Does not include EAs.
160 * @note Misaligned. */
161 ISO9660U32 cbData;
162 /** 0x12: Recording time and date. */
163 ISO9660RECTIMESTAMP RecTime;
164 /** 0x19: File flags (ISO9660_FILE_FLAGS_XXX). */
165 uint8_t fFileFlags;
166 /** 0x1a: File unit size for interlaved mode. */
167 uint8_t bFileUnitSize;
168 /** 0x1b: Interlave gap size. */
169 uint8_t bInterleaveGapSize;
170 /** 0x1c: Volume sequence number where the extent resides. */
171 ISO9660U16 VolumeSeqNo;
172 /** 0x20: Length of file identifier field. */
173 uint8_t bFileIdLength;
174 /** 0x21: File identifier (d-characters or d1-characters). */
175 char achFileId[1];
176 /* There are more fields following:
177 * - one byte optional padding so the following field is at an even boundrary.
178 * - system use field until cbDirRec is reached.
179 */
180} ISO9660DIRREC;
181#pragma pack()
182AssertCompileMemberOffset(ISO9660DIRREC, offExtent, 0x02);
183AssertCompileMemberOffset(ISO9660DIRREC, cbData, 0x0a);
184AssertCompileMemberOffset(ISO9660DIRREC, RecTime, 0x12);
185AssertCompileMemberOffset(ISO9660DIRREC, fFileFlags, 0x19);
186AssertCompileMemberOffset(ISO9660DIRREC, bFileIdLength, 0x20);
187AssertCompileMemberOffset(ISO9660DIRREC, achFileId, 0x21);
188/** Pointer to an ISO 9660 directory record. */
189typedef ISO9660DIRREC *PISO9660DIRREC;
190/** Pointer to a const ISO 9660 directory record. */
191typedef ISO9660DIRREC const *PCISO9660DIRREC;
192
193/** @name ISO9660_FILE_FLAGS_XXX
194 * @{ */
195/** Existence - Hide the file from the user. */
196#define ISO9660_FILE_FLAGS_HIDDEN UINT8_C(0x01)
197/** Directory - Indicates a directory as apposed to a regular file (0). */
198#define ISO9660_FILE_FLAGS_DIRECTORY UINT8_C(0x02)
199/** Assocated File - Indicates that the file is an associated file. */
200#define ISO9660_FILE_FLAGS_ASSOCIATED_FILE UINT8_C(0x04)
201/** Record - Indicates specified file content record format (see EAs). */
202#define ISO9660_FILE_FLAGS_RECORD UINT8_C(0x08)
203/** Protection - Indicates owner/group or permission protection in EAs. */
204#define ISO9660_FILE_FLAGS_PROTECTION UINT8_C(0x10)
205/** Reserved bit, MBZ. */
206#define ISO9660_FILE_FLAGS_RESERVED_5 UINT8_C(0x20)
207/** Reserved bit, MBZ. */
208#define ISO9660_FILE_FLAGS_RESERVED_6 UINT8_C(0x40)
209/** Multi-extend - Indicates that this isn't the final record for the file.
210 * @remarks Use for working around 4 GiB file size limitation. */
211#define ISO9660_FILE_FLAGS_MULTI_EXTENT UINT8_C(0x80)
212/** @} */
213
214
215/**
216 * ISO 9660 path table record.
217 */
218#pragma pack(1)
219typedef struct ISO9660PATHREC
220{
221 /** 0x00: Length of this record in bytes. */
222 uint8_t cbDirId;
223 /** 0x01: Extended attribute record length in bytes? */
224 uint8_t cbExtAttr;
225 /** 0x02: Location of extent (logical block number).
226 * @note Endianess depends on table.
227 * @note Misaligned. */
228 uint32_t offExtent;
229 /** 0x06: Parent directory number.
230 * @note Endianess depends on table. */
231 uint16_t idParentRec;
232 /** 0x08: Directory identifier (d-characters or d1-characters). */
233 char achDirId[RT_FLEXIBLE_ARRAY];
234 /* There will be a zero padding byte following if the directory identifier length is odd. */
235} ISO9660PATHREC;
236#pragma pack()
237AssertCompileMemberOffset(ISO9660PATHREC, cbExtAttr, 0x01);
238AssertCompileMemberOffset(ISO9660PATHREC, offExtent, 0x02);
239AssertCompileMemberOffset(ISO9660PATHREC, idParentRec, 0x06);
240AssertCompileMemberOffset(ISO9660PATHREC, achDirId, 0x08);
241
242
243/**
244 * ISO 9660 extended attribute record.
245 */
246typedef struct ISO9660EXATTRREC
247{
248 /** 0x000: The owener ID. */
249 ISO9660U16 idOwner;
250 /** 0x004: The owener ID. */
251 ISO9660U16 idGroup;
252 /** 0x008: File permissions (ISO9660_PERM_XXX). */
253 ISO9660U16BE fPermissions;
254 /** 0x00a: File creation timestamp. */
255 ISO9660TIMESTAMP BirthTimestamp;
256 /** 0x01b: File modification timestamp. */
257 ISO9660TIMESTAMP ModifyTimestamp;
258 /** 0x02c: File expiration timestamp. */
259 ISO9660TIMESTAMP ExpireTimestamp;
260 /** 0x03d: File effective timestamp. */
261 ISO9660TIMESTAMP EffectiveTimestamp;
262 /** 0x04e: Record format. */
263 uint8_t bRecordFormat;
264 /** 0x04f: Record attributes. */
265 uint8_t fRecordAttrib;
266 /** 0x050: Record length. */
267 ISO9660U16 RecordLength;
268 /** 0x054: System identifier (a-characters or a1-characters). */
269 char achSystemId[0x20];
270 /** 0x074: System specific bytes. */
271 uint8_t abSystemUse[64];
272 /** 0x0b4: Extended attribute record version (ISO9660EXATTRREC_VERSION). */
273 uint8_t bExtRecVersion;
274 /** 0x0b5: Length of escape sequences. */
275 uint8_t cbEscapeSequences;
276 /** 0x0b6: Reserved for the future, MBZ. */
277 uint8_t abReserved183[64];
278 /** 0x0f6: Length of the application use field. */
279 ISO9660U16 cbAppUse;
280 /** 0x0fa: Variable sized application use field. */
281 uint8_t abAppUse[RT_FLEXIBLE_ARRAY];
282 /* This is followed by escape sequences with length given by cbEscapeSequnces. */
283} ISO9660EXATTRREC;
284AssertCompileMemberOffset(ISO9660EXATTRREC, EffectiveTimestamp, 0x03d);
285AssertCompileMemberOffset(ISO9660EXATTRREC, cbAppUse, 0x0f6);
286
287/** The ISO9660EXATTRREC::bExtRecVersion value. */
288#define ISO9660EXATTRREC_VERSION UINT8_C(0x01)
289
290/** @name ISO9660_PERM_XXX - ISO9660EXATTRREC::fPermissions
291 * @{ */
292/** @todo figure out this wird permission stuff... */
293/** @} */
294
295
296/**
297 * ISO 9660 volume descriptor header.
298 */
299typedef struct ISO9660VOLDESCHDR
300{
301 /** Descriptor type ISO9660VOLDESC_TYPE_XXX. */
302 uint8_t bDescType;
303 /** Standard identifier 'CD001' */
304 uint8_t achStdId[5];
305 /** The descriptor version. */
306 uint8_t bDescVersion;
307 /* (This is followed by the descriptor specific data). */
308} ISO9660VOLDESCHDR;
309AssertCompileSize(ISO9660VOLDESCHDR, 7);
310/** Pointer to a volume descriptor header. */
311typedef ISO9660VOLDESCHDR *PISO9660VOLDESCHDR;
312/** Pointer to a const volume descriptor header. */
313typedef ISO9660VOLDESCHDR const *PCISO9660VOLDESCHDR;
314
315/** @name ISO9660VOLDESC_TYPE_XXX - volume descriptor types
316 * @{ */
317/** See ISO9660BOOTRECORD. */
318#define ISO9660VOLDESC_TYPE_BOOT_RECORD UINT8_C(0x00)
319/** See ISO9660PRIMARYVOLDESC. */
320#define ISO9660VOLDESC_TYPE_PRIMARY UINT8_C(0x01)
321/** See ISO9660SUPVOLDESC. */
322#define ISO9660VOLDESC_TYPE_SUPPLEMENTARY UINT8_C(0x02)
323/** See ISO9660VOLPARTDESC. */
324#define ISO9660VOLDESC_TYPE_PARTITION UINT8_C(0x03)
325/** Terminates the volume descriptor set. Has no data (zeros), version is 1. */
326#define ISO9660VOLDESC_TYPE_TERMINATOR UINT8_C(0xff)
327/** @} */
328
329/** The value of ISO9660VOLDESCHDR::achStdId */
330#define ISO9660VOLDESC_STD_ID "CD001"
331#define ISO9660VOLDESC_STD_ID_0 'C'
332#define ISO9660VOLDESC_STD_ID_1 'D'
333#define ISO9660VOLDESC_STD_ID_2 '0'
334#define ISO9660VOLDESC_STD_ID_3 '0'
335#define ISO9660VOLDESC_STD_ID_4 '1'
336
337
338
339/**
340 * ISO 9660 boot record (volume descriptor).
341 */
342typedef struct ISO9660BOOTRECORD
343{
344 /** The volume descriptor header.
345 * Type is ISO9660VOLDESC_TYPE_BOOT_RECORD and version
346 * ISO9660BOOTRECORD_VERSION. */
347 ISO9660VOLDESCHDR Hdr;
348 /** Boot system identifier string (a-characters). */
349 char achBootSystemId[32];
350 /** Boot identifier (a-characters). */
351 char achBootId[32];
352 /** Boot system specific content. */
353 uint8_t abBootSystemSpecific[1977];
354} ISO9660BOOTRECORD;
355AssertCompileSize(ISO9660BOOTRECORD, ISO9660_SECTOR_SIZE);
356/** Pointer to a ISO 9660 boot record. */
357typedef ISO9660BOOTRECORD *PISO9660BOOTRECORD;
358/** Pointer to a const ISO 9660 boot record. */
359typedef ISO9660BOOTRECORD const *PCISO9660BOOTRECORD;
360
361/** The value of ISO9660BOOTRECORD::Hdr.uDescVersion. */
362#define ISO9660BOOTRECORD_VERSION UINT8_C(1)
363
364
365
366/**
367 * ISO 9660 primary volume descriptor.
368 */
369typedef struct ISO9660PRIMARYVOLDESC
370{
371 /** 0x000: The volume descriptor header.
372 * Type is ISO9660VOLDESC_TYPE_PRIMARY and version
373 * ISO9660PRIMARYVOLDESC_VERSION. */
374 ISO9660VOLDESCHDR Hdr;
375 /** 0x007: Explicit alignment zero padding. */
376 uint8_t bPadding8;
377 /** 0x008: System identifier (a-characters). */
378 char achSystemId[32];
379 /** 0x028: Volume identifier (d-characters). */
380 char achVolumeId[32];
381 /** 0x048: Unused field, zero filled. */
382 ISO9660U32 Unused73;
383 /** 0x050: Volume space size in logical blocks (cbLogicalBlock). */
384 ISO9660U32 VolumeSpaceSize;
385 /** 0x058: Unused field(s), zero filled. */
386 uint8_t abUnused89[32];
387 /** 0x078: The number of volumes in the volume set. */
388 ISO9660U16 cVolumesInSet;
389 /** 0x07c: Volume sequence number. */
390 ISO9660U16 VolumeSeqNo;
391 /** 0x080: Logical block size in bytes. */
392 ISO9660U16 cbLogicalBlock;
393 /** 0x084: Path table size. */
394 ISO9660U32 cbPathTable;
395 /** 0x08c: Type L(ittle endian) path table location (block offset). */
396 ISO9660U32LE offTypeLPathTable;
397 /** 0x090: Optional type L(ittle endian) path table location (block offset). */
398 ISO9660U32LE offOptionalTypeLPathTable;
399 /** 0x094: Type M (big endian) path table location (block offset). */
400 ISO9660U32BE offTypeMPathTable;
401 /** 0x098: Optional type M (big endian) path table location (block offset). */
402 ISO9660U32BE offOptionalTypeMPathTable;
403 /** 0x09c: Directory entry for the root directory (union). */
404 union
405 {
406 uint8_t ab[34];
407 ISO9660DIRREC DirRec;
408 } RootDir;
409 /** 0x0be: Volume set identifier (d-characters). */
410 char achVolumeSetId[128];
411 /** 0x13e: Publisher identifier (a-characters). Alternatively, it may refere to
412 * a file in the root dir if it starts with 0x5f and restricts itself to 8
413 * d-characters. */
414 char achPublisherId[128];
415 /** 0x1be: Data preparer identifier (a-characters).
416 * Same file reference alternative as previous field. */
417 char achDataPreparerId[128];
418 /** 0x23e: Application identifier (a-characters).
419 * Same file reference alternative as previous field. */
420 char achApplicationId[128];
421 /** 0x2be: Copyright (root) file identifier (d-characters).
422 * All spaces if none. */
423 char achCopyrightFileId[37];
424 /** 0x2e3: Abstract (root) file identifier (d-characters).
425 * All spaces if none. */
426 char achAbstractFileId[37];
427 /** 0x308: Bibliographic file identifier (d-characters).
428 * All spaces if none. */
429 char achBibliographicFileId[37];
430 /** 0x32d: Volume creation date and time. */
431 ISO9660TIMESTAMP BirthTime;
432 /** 0x33e: Volume modification date and time. */
433 ISO9660TIMESTAMP ModifyTime;
434 /** 0x34f: Volume (data) expiration date and time.
435 * If not specified, don't regard data as obsolete. */
436 ISO9660TIMESTAMP ExpireTime;
437 /** 0x360: Volume (data) effective date and time.
438 * If not specified, info can be used immediately. */
439 ISO9660TIMESTAMP EffectiveTime;
440 /** 0x371: File structure version (ISO9660_FILE_STRUCTURE_VERSION). */
441 uint8_t bFileStructureVersion;
442 /** 0x372: Reserve for future, MBZ. */
443 uint8_t bReserved883;
444 /** 0x373: Reserve for future, MBZ. */
445 uint8_t abAppUse[512];
446 /** 0x573: Reserved for future standardization, MBZ. */
447 uint8_t abReserved1396[653];
448} ISO9660PRIMARYVOLDESC;
449AssertCompileSize(ISO9660PRIMARYVOLDESC, ISO9660_SECTOR_SIZE);
450/** Pointer to a ISO 9660 primary volume descriptor. */
451typedef ISO9660PRIMARYVOLDESC *PISO9660PRIMARYVOLDESC;
452/** Pointer to a const ISO 9660 primary volume descriptor. */
453typedef ISO9660PRIMARYVOLDESC const *PCISO9660PRIMARYVOLDESC;
454
455/** The value of ISO9660PRIMARYVOLDESC::Hdr.uDescVersion. */
456#define ISO9660PRIMARYVOLDESC_VERSION UINT8_C(1)
457/** The value of ISO9660PRIMARYVOLDESC::bFileStructureVersion and
458 * ISO9660SUPVOLDESC::bFileStructureVersion. */
459#define ISO9660_FILE_STRUCTURE_VERSION UINT8_C(1)
460
461
462
463/**
464 * ISO 9660 supplementary volume descriptor.
465 *
466 * This is in the large parts identicial to the primary descriptor, except it
467 * have a few more fields where the primary one has reserved spaces.
468 */
469typedef struct ISO9660SUPVOLDESC
470{
471 /** 0x000: The volume descriptor header.
472 * Type is ISO9660VOLDESC_TYPE_SUPPLEMENTARY and version
473 * ISO9660SUPVOLDESC_VERSION. */
474 ISO9660VOLDESCHDR Hdr;
475 /** 0x007: Volume flags (ISO9660SUPVOLDESC_VOL_F_XXX).
476 * @note This is reserved in the primary volume descriptor. */
477 uint8_t fVolumeFlags;
478 /** 0x008: System identifier (a1-characters) of system that can act upon
479 * sectors 0 thru 15.
480 * @note Purpose differs from primary description. */
481 char achSystemId[32];
482 /** 0x028: Volume identifier (d1-characters).
483 * @note Character set differs from primary description. */
484 char achVolumeId[32];
485 /** 0x048: Unused field, zero filled. */
486 ISO9660U32 Unused73;
487 /** 0x050: Volume space size in logical blocks (cbLogicalBlock). */
488 ISO9660U32 VolumeSpaceSize;
489 /** 0x058: Escape sequences.
490 * Complicated stuff, see ISO 2022 and ECMA-35.
491 * @note This is reserved in the primary volume descriptor. */
492 uint8_t abEscapeSequences[32];
493 /** 0x078: The number of volumes in the volume set. */
494 ISO9660U16 cVolumesInSet;
495 /** 0x07c: Volume sequence number. */
496 ISO9660U16 VolumeSeqNo;
497 /** 0x080: Logical block size in bytes. */
498 ISO9660U16 cbLogicalBlock;
499 /** 0x084: Path table size. */
500 ISO9660U32 cbPathTable;
501 /** 0x08c: Type L(ittle endian) path table location (block offset). */
502 ISO9660U32LE offTypeLPathTable;
503 /** 0x090: Optional type L(ittle endian) path table location (block offset). */
504 ISO9660U32LE offOptionalTypeLPathTable;
505 /** 0x094: Type M (big endian) path table location (block offset). */
506 ISO9660U32BE offTypeMPathTable;
507 /** 0x098: Optional type M (big endian) path table location (block offset). */
508 ISO9660U32BE offOptionalTypeMPathTable;
509 /** 0x09c: Directory entry for the root directory (union). */
510 union
511 {
512 uint8_t ab[34];
513 ISO9660DIRREC DirRec;
514 } RootDir;
515 /** 0x0be: Volume set identifier (d1-characters).
516 * @note Character set differs from primary description. */
517 char achVolumeSetId[128];
518 /** 0x13e: Publisher identifier (a1-characters). Alternatively, it may refere
519 * to a file in the root dir if it starts with 0x5f and restricts itself to 8
520 * d1-characters.
521 * @note Character set differs from primary description. */
522 char achPublisherId[128];
523 /** 0x1be: Data preparer identifier (a1-characters).
524 * Same file reference alternative as previous field.
525 * @note Character set differs from primary description. */
526 char achDataPreparerId[128];
527 /** 0x23e: Application identifier (a1-characters).
528 * Same file reference alternative as previous field.
529 * @note Character set differs from primary description. */
530 char achApplicationId[128];
531 /** 0x2be: Copyright (root) file identifier (d1-characters).
532 * All spaces if none.
533 * @note Character set differs from primary description. */
534 char achCopyrightFileId[37];
535 /** 0x2e3: Abstract (root) file identifier (d1-characters).
536 * All spaces if none.
537 * @note Character set differs from primary description. */
538 char achAbstractFileId[37];
539 /** 0x308: Bibliographic file identifier (d1-characters).
540 * All spaces if none.
541 * @note Character set differs from primary description. */
542 char achBibliographicFileId[37];
543 /** 0x32d: Volume creation date and time. */
544 ISO9660TIMESTAMP BirthTime;
545 /** 0x33e: Volume modification date and time. */
546 ISO9660TIMESTAMP ModifyTime;
547 /** 0x34f: Volume (data) expiration date and time.
548 * If not specified, don't regard data as obsolete. */
549 ISO9660TIMESTAMP ExpireTime;
550 /** 0x360: Volume (data) effective date and time.
551 * If not specified, info can be used immediately. */
552 ISO9660TIMESTAMP EffectiveTime;
553 /** 0x371: File structure version (ISO9660_FILE_STRUCTURE_VERSION). */
554 uint8_t bFileStructureVersion;
555 /** 0x372: Reserve for future, MBZ. */
556 uint8_t bReserved883;
557 /** 0x373: Reserve for future, MBZ. */
558 uint8_t abAppUse[512];
559 /** 0x573: Reserved for future standardization, MBZ. */
560 uint8_t abReserved1396[653];
561} ISO9660SUPVOLDESC;
562AssertCompileSize(ISO9660SUPVOLDESC, ISO9660_SECTOR_SIZE);
563/** Pointer to a ISO 9660 supplementary volume descriptor. */
564typedef ISO9660SUPVOLDESC *PISO9660SUPVOLDESC;
565/** Pointer to a const ISO 9660 supplementary volume descriptor. */
566typedef ISO9660SUPVOLDESC const *PCISO9660SUPVOLDESC;
567/** The value of ISO9660SUPVOLDESC::Hdr.uDescVersion. */
568#define ISO9660SUPVOLDESC_VERSION UINT8_C(1)
569
570/** @name ISO9660SUPVOLDESC_VOL_F_XXX - ISO9660SUPVOLDESC::fVolumeFlags
571 * @{ */
572#define ISO9660SUPVOLDESC_VOL_F_ESC_ONLY_REG UINT8_C(0x00)
573#define ISO9660SUPVOLDESC_VOL_F_ESC_NOT_REG UINT8_C(0x01)
574/** @} */
575
576
577
578/**
579 * ISO 9660 volume partition descriptor.
580 */
581typedef struct ISO9660VOLPARTDESC
582{
583 /** 0x000: The volume descriptor header.
584 * Type is ISO9660VOLDESC_TYPE_PARTITION and version
585 * ISO9660VOLPARTDESC_VERSION. */
586 ISO9660VOLDESCHDR Hdr;
587 /** 0x007: Alignment padding. */
588 uint8_t bPadding8;
589 /** 0x008: System identifier (a-characters). */
590 char achSystemId[32];
591 /** 0x028: Volume partition identifier (d-characters). */
592 char achVolumePartitionId[32];
593 /** 0x048: The location of the partition (logical block number). */
594 ISO9660U32 offVolumePartition;
595 /** 0x050: The partition size in logical blocks (cbLogicalBlock). */
596 ISO9660U32 VolumePartitionSize;
597 /** 0x058: System specific data. */
598 uint8_t achSystemUse[1960];
599} ISO9660VOLPARTDESC;
600AssertCompileSize(ISO9660VOLPARTDESC, ISO9660_SECTOR_SIZE);
601/** Pointer to an ISO 9660 volume partition description. */
602typedef ISO9660VOLPARTDESC *PISO9660VOLPARTDESC;
603/** Pointer to a const ISO 9660 volume partition description. */
604typedef ISO9660VOLPARTDESC const *PCISO9660VOLPARTDESC;
605/** The value of ISO9660VOLPARTDESC::Hdr.uDescVersion. */
606#define ISO9660VOLPARTDESC_VERSION UINT8_C(1)
607
608
609
610/** @name Joliet escape sequence identifiers.
611 *
612 * These bytes appears in the supplementary volume descriptor field
613 * abEscapeSequences. The ISO9660SUPVOLDESC_VOL_F_ESC_NOT_REG flags will not
614 * be set.
615 *
616 * @{ */
617#define ISO9660_JOLIET_ESC_SEQ_0 UINT8_C(0x25) /**< First escape sequence byte.*/
618#define ISO9660_JOLIET_ESC_SEQ_1 UINT8_C(0x2f) /**< Second escape sequence byte.*/
619#define ISO9660_JOLIET_ESC_SEQ_2_LEVEL_1 UINT8_C(0x40) /**< Third escape sequence byte: level 1 */
620#define ISO9660_JOLIET_ESC_SEQ_2_LEVEL_2 UINT8_C(0x43) /**< Third escape sequence byte: level 2 */
621#define ISO9660_JOLIET_ESC_SEQ_2_LEVEL_3 UINT8_C(0x45) /**< Third escape sequence byte: level 3 */
622/** @} */
623
624
625/** @} */
626
627#endif
628
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