1 /* $Id: fsw_iso9660.h 29125 2010-05-06 09:43:05Z vboxsync $ */
3 * fsw_iso9660.h - ISO9660 file system driver header.
7 * Copyright (c) 2006 Christoph Pfisterer
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are
13 * * Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the
21 * * Neither the name of Christoph Pfisterer nor the names of the
22 * contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 #ifndef _FSW_ISO9660_H_
39 #define _FSW_ISO9660_H_
41 #define VOLSTRUCTNAME fsw_iso9660_volume
42 #define DNODESTRUCTNAME fsw_iso9660_dnode
46 //! Block size for ISO9660 volumes.
47 #define ISO9660_BLOCKSIZE 2048
48 #define ISO9660_BLOCKSIZE_BITS 11
49 //! Block number where the ISO9660 superblock resides.
50 #define ISO9660_SUPERBLOCK_BLOCKNO 16
51 //Slice - we already have shifted blockIO by 16
52 //but we should use ParentBlockIo
53 //#define ISO9660_SUPERBLOCK_BLOCKNO 0
67 #define ISOINT(lsbmsbvalue) ((lsbmsbvalue).lsb)
69 struct iso9660_dirrec
{
72 iso9660_u32 extent_location
;
73 iso9660_u32 data_length
;
74 fsw_u8 recording_datetime
[7];
76 fsw_u8 file_unit_size
;
77 fsw_u8 interleave_gap_size
;
78 iso9660_u16 volume_sequence_number
;
79 fsw_u8 file_identifier_length
;
80 char file_identifier
[1];
82 //#if sizeof(struct fsw_iso9660_dirrec) != 34
83 //#fail Structure fsw_iso9660_dirrec has wrong size
86 struct iso9660_volume_descriptor
{
87 fsw_u8 volume_descriptor_type
;
88 char standard_identifier
[5];
89 fsw_u8 volume_descriptor_version
;
92 struct iso9660_primary_volume_descriptor
{
93 fsw_u8 volume_descriptor_type
;
94 char standard_identifier
[5];
95 fsw_u8 volume_descriptor_version
;
97 char system_identifier
[32];
98 char volume_identifier
[32];
100 iso9660_u32 volume_space_size
;
104 iso9660_u16 volume_set_size
;
105 iso9660_u16 volume_sequence_number
;
106 iso9660_u16 logical_block_size
;
107 iso9660_u32 path_table_size
;
108 fsw_u32 location_type_l_path_table
;
109 fsw_u32 location_optional_type_l_path_table
;
110 fsw_u32 location_type_m_path_table
;
111 fsw_u32 location_optional_type_m_path_table
;
112 struct iso9660_dirrec root_directory
;
113 char volume_set_identifier
[128];
114 char publisher_identifier
[128];
115 char data_preparer_identifier
[128];
116 char application_identifier
[128];
117 char copyright_file_identifier
[37];
118 char abstract_file_identifier
[37];
119 char bibliographic_file_identifier
[37];
120 char volume_creation_datetime
[17];
121 char volume_modification_datetime
[17];
122 char volume_expiration_datetime
[17];
123 char volume_effective_datetime
[17];
124 fsw_u8 file_structure_version
;
126 fsw_u8 application_use
[512];
127 fsw_u8 reserved2
[653];
129 //#if sizeof(struct fsw_iso9660_volume_descriptor) != 2048
130 //#fail Structure fsw_iso9660_volume_descriptor has wrong size
135 struct iso9660_dirrec_buffer
{
137 struct fsw_string name
;
138 struct iso9660_dirrec dirrec
;
139 char dirrec_buffer
[222];
144 * ISO9660: Volume structure with ISO9660-specific data.
147 struct fsw_iso9660_volume
{
148 struct fsw_volume g
; //!< Generic volume structure
149 /*Note: don't move g!*/
151 /*Joliet specific fields*/
153 /*Rock Ridge specific fields*/
156 struct iso9660_primary_volume_descriptor
*primary_voldesc
; //!< Full Primary Volume Descriptor
160 * ISO9660: Dnode structure with ISO9660-specific data.
163 struct fsw_iso9660_dnode
{
164 struct fsw_dnode g
; //!< Generic dnode structure
166 struct iso9660_dirrec dirrec
; //!< Fixed part of the directory record (i.e. w/o name)
170 struct fsw_rock_ridge_susp_entry
177 struct fsw_rock_ridge_susp_sp
179 struct fsw_rock_ridge_susp_entry e
;
184 struct fsw_rock_ridge_susp_nm
186 struct fsw_rock_ridge_susp_entry e
;
191 #define RR_NM_CONT (1<<0)
192 #define RR_NM_CURR (1<<1)
193 #define RR_NM_PARE (1<<2)
195 union fsw_rock_ridge_susp_ce
198 struct fsw_rock_ridge_susp_entry e
;
199 iso9660_u32 block_loc
;