VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/fsw_iso9660.h@ 80924

Last change on this file since 80924 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.9 KB
Line 
1/* $Id: fsw_iso9660.h 76553 2019-01-01 01:45:53Z vboxsync $ */
2/** @file
3 * fsw_iso9660.h - ISO9660 file system driver header.
4 */
5
6/*
7 * Copyright (C) 2010-2019 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 * This code is based on:
27 *
28 * Copyright (c) 2006 Christoph Pfisterer
29 *
30 * Redistribution and use in source and binary forms, with or without
31 * modification, are permitted provided that the following conditions are
32 * met:
33 *
34 * * Redistributions of source code must retain the above copyright
35 * notice, this list of conditions and the following disclaimer.
36 *
37 * * Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the
40 * distribution.
41 *
42 * * Neither the name of Christoph Pfisterer nor the names of the
43 * contributors may be used to endorse or promote products derived
44 * from this software without specific prior written permission.
45 *
46 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
47 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
48 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
49 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
50 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
51 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
52 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
53 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
54 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
55 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
56 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 */
58
59#ifndef _FSW_ISO9660_H_
60#define _FSW_ISO9660_H_
61
62#define VOLSTRUCTNAME fsw_iso9660_volume
63#define DNODESTRUCTNAME fsw_iso9660_dnode
64#include "fsw_core.h"
65
66
67//! Block size for ISO9660 volumes.
68#define ISO9660_BLOCKSIZE 2048
69#define ISO9660_BLOCKSIZE_BITS 11
70//! Block number where the ISO9660 superblock resides.
71#define ISO9660_SUPERBLOCK_BLOCKNO 16
72
73
74#pragma pack(1)
75
76typedef struct {
77 fsw_u16 lsb;
78 fsw_u16 msb;
79} iso9660_u16;
80
81typedef struct {
82 fsw_u32 lsb;
83 fsw_u32 msb;
84} iso9660_u32;
85
86#define ISOINT(lsbmsbvalue) ((lsbmsbvalue).lsb)
87
88struct iso9660_dirrec {
89 fsw_u8 dirrec_length;
90 fsw_u8 ear_length;
91 iso9660_u32 extent_location;
92 iso9660_u32 data_length;
93 fsw_u8 recording_datetime[7];
94 fsw_u8 file_flags;
95 fsw_u8 file_unit_size;
96 fsw_u8 interleave_gap_size;
97 iso9660_u16 volume_sequence_number;
98 fsw_u8 file_identifier_length;
99 char file_identifier[1];
100};
101//#if sizeof(struct fsw_iso9660_dirrec) != 34
102//#fail Structure fsw_iso9660_dirrec has wrong size
103//#endif
104
105struct iso9660_volume_descriptor {
106 fsw_u8 volume_descriptor_type;
107 char standard_identifier[5];
108 fsw_u8 volume_descriptor_version;
109};
110
111struct iso9660_primary_volume_descriptor {
112 fsw_u8 volume_descriptor_type;
113 char standard_identifier[5];
114 fsw_u8 volume_descriptor_version;
115 fsw_u8 unused1;
116 char system_identifier[32];
117 char volume_identifier[32];
118 fsw_u8 unused2[8];
119 iso9660_u32 volume_space_size;
120 fsw_u8 unused3[4];
121 fsw_u8 escape[3];
122 fsw_u8 unused4[25];
123 iso9660_u16 volume_set_size;
124 iso9660_u16 volume_sequence_number;
125 iso9660_u16 logical_block_size;
126 iso9660_u32 path_table_size;
127 fsw_u32 location_type_l_path_table;
128 fsw_u32 location_optional_type_l_path_table;
129 fsw_u32 location_type_m_path_table;
130 fsw_u32 location_optional_type_m_path_table;
131 struct iso9660_dirrec root_directory;
132 char volume_set_identifier[128];
133 char publisher_identifier[128];
134 char data_preparer_identifier[128];
135 char application_identifier[128];
136 char copyright_file_identifier[37];
137 char abstract_file_identifier[37];
138 char bibliographic_file_identifier[37];
139 char volume_creation_datetime[17];
140 char volume_modification_datetime[17];
141 char volume_expiration_datetime[17];
142 char volume_effective_datetime[17];
143 fsw_u8 file_structure_version;
144 fsw_u8 reserved1;
145 fsw_u8 application_use[512];
146 fsw_u8 reserved2[653];
147};
148//#if sizeof(struct fsw_iso9660_volume_descriptor) != 2048
149//#fail Structure fsw_iso9660_volume_descriptor has wrong size
150//#endif
151
152#pragma pack()
153
154struct iso9660_dirrec_buffer {
155 fsw_u32 ino;
156 struct fsw_string name;
157 struct iso9660_dirrec dirrec;
158 char dirrec_buffer[222];
159};
160
161
162/**
163 * ISO9660: Volume structure with ISO9660-specific data.
164 */
165
166struct fsw_iso9660_volume {
167 struct fsw_volume g; //!< Generic volume structure
168 /*Note: don't move g!*/
169 int fJoliet;
170 /*Joliet specific fields*/
171 int fRockRidge;
172 /*Rock Ridge specific fields*/
173 int rr_susp_skip;
174
175 struct iso9660_primary_volume_descriptor *primary_voldesc; //!< Full Primary Volume Descriptor
176};
177
178/**
179 * ISO9660: Dnode structure with ISO9660-specific data.
180 */
181
182struct fsw_iso9660_dnode {
183 struct fsw_dnode g; //!< Generic dnode structure
184
185 struct iso9660_dirrec dirrec; //!< Fixed part of the directory record (i.e. w/o name)
186};
187
188
189struct fsw_rock_ridge_susp_entry
190{
191 fsw_u8 sig[2];
192 fsw_u8 len;
193 fsw_u8 ver;
194};
195
196struct fsw_rock_ridge_susp_sp
197{
198 struct fsw_rock_ridge_susp_entry e;
199 fsw_u8 magic[2];
200 fsw_u8 skip;
201};
202
203struct fsw_rock_ridge_susp_nm
204{
205 struct fsw_rock_ridge_susp_entry e;
206 fsw_u8 flags;
207 fsw_u8 name[1];
208};
209
210#define RR_NM_CONT (1<<0)
211#define RR_NM_CURR (1<<1)
212#define RR_NM_PARE (1<<2)
213
214union fsw_rock_ridge_susp_ce
215{
216 struct X{
217 struct fsw_rock_ridge_susp_entry e;
218 iso9660_u32 block_loc;
219 iso9660_u32 offset;
220 iso9660_u32 len;
221 } X;
222 fsw_u8 raw[28];
223};
224
225#endif
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