1
2#ifndef _ISOFS_FS_H
3#define _ISOFS_FS_H
4
5#include <linux/types.h>
6#include <linux/magic.h>
7
8
9
10
11
12
13#define ISODCL(from, to) (to - from + 1)
14
15struct iso_volume_descriptor {
16 __u8 type[ISODCL(1,1)];
17 char id[ISODCL(2,6)];
18 __u8 version[ISODCL(7,7)];
19 __u8 data[ISODCL(8,2048)];
20};
21
22
23#define ISO_VD_PRIMARY 1
24#define ISO_VD_SUPPLEMENTARY 2
25#define ISO_VD_END 255
26
27#define ISO_STANDARD_ID "CD001"
28
29struct iso_primary_descriptor {
30 __u8 type [ISODCL ( 1, 1)];
31 char id [ISODCL ( 2, 6)];
32 __u8 version [ISODCL ( 7, 7)];
33 __u8 unused1 [ISODCL ( 8, 8)];
34 char system_id [ISODCL ( 9, 40)];
35 char volume_id [ISODCL ( 41, 72)];
36 __u8 unused2 [ISODCL ( 73, 80)];
37 __u8 volume_space_size [ISODCL ( 81, 88)];
38 __u8 unused3 [ISODCL ( 89, 120)];
39 __u8 volume_set_size [ISODCL (121, 124)];
40 __u8 volume_sequence_number [ISODCL (125, 128)];
41 __u8 logical_block_size [ISODCL (129, 132)];
42 __u8 path_table_size [ISODCL (133, 140)];
43 __u8 type_l_path_table [ISODCL (141, 144)];
44 __u8 opt_type_l_path_table [ISODCL (145, 148)];
45 __u8 type_m_path_table [ISODCL (149, 152)];
46 __u8 opt_type_m_path_table [ISODCL (153, 156)];
47 __u8 root_directory_record [ISODCL (157, 190)];
48 char volume_set_id [ISODCL (191, 318)];
49 char publisher_id [ISODCL (319, 446)];
50 char preparer_id [ISODCL (447, 574)];
51 char application_id [ISODCL (575, 702)];
52 char copyright_file_id [ISODCL (703, 739)];
53 char abstract_file_id [ISODCL (740, 776)];
54 char bibliographic_file_id [ISODCL (777, 813)];
55 __u8 creation_date [ISODCL (814, 830)];
56 __u8 modification_date [ISODCL (831, 847)];
57 __u8 expiration_date [ISODCL (848, 864)];
58 __u8 effective_date [ISODCL (865, 881)];
59 __u8 file_structure_version [ISODCL (882, 882)];
60 __u8 unused4 [ISODCL (883, 883)];
61 __u8 application_data [ISODCL (884, 1395)];
62 __u8 unused5 [ISODCL (1396, 2048)];
63};
64
65
66struct iso_supplementary_descriptor {
67 __u8 type [ISODCL ( 1, 1)];
68 char id [ISODCL ( 2, 6)];
69 __u8 version [ISODCL ( 7, 7)];
70 __u8 flags [ISODCL ( 8, 8)];
71 char system_id [ISODCL ( 9, 40)];
72 char volume_id [ISODCL ( 41, 72)];
73 __u8 unused2 [ISODCL ( 73, 80)];
74 __u8 volume_space_size [ISODCL ( 81, 88)];
75 __u8 escape [ISODCL ( 89, 120)];
76 __u8 volume_set_size [ISODCL (121, 124)];
77 __u8 volume_sequence_number [ISODCL (125, 128)];
78 __u8 logical_block_size [ISODCL (129, 132)];
79 __u8 path_table_size [ISODCL (133, 140)];
80 __u8 type_l_path_table [ISODCL (141, 144)];
81 __u8 opt_type_l_path_table [ISODCL (145, 148)];
82 __u8 type_m_path_table [ISODCL (149, 152)];
83 __u8 opt_type_m_path_table [ISODCL (153, 156)];
84 __u8 root_directory_record [ISODCL (157, 190)];
85 char volume_set_id [ISODCL (191, 318)];
86 char publisher_id [ISODCL (319, 446)];
87 char preparer_id [ISODCL (447, 574)];
88 char application_id [ISODCL (575, 702)];
89 char copyright_file_id [ISODCL (703, 739)];
90 char abstract_file_id [ISODCL (740, 776)];
91 char bibliographic_file_id [ISODCL (777, 813)];
92 __u8 creation_date [ISODCL (814, 830)];
93 __u8 modification_date [ISODCL (831, 847)];
94 __u8 expiration_date [ISODCL (848, 864)];
95 __u8 effective_date [ISODCL (865, 881)];
96 __u8 file_structure_version [ISODCL (882, 882)];
97 __u8 unused4 [ISODCL (883, 883)];
98 __u8 application_data [ISODCL (884, 1395)];
99 __u8 unused5 [ISODCL (1396, 2048)];
100};
101
102
103#define HS_STANDARD_ID "CDROM"
104
105struct hs_volume_descriptor {
106 __u8 foo [ISODCL ( 1, 8)];
107 __u8 type [ISODCL ( 9, 9)];
108 char id [ISODCL ( 10, 14)];
109 __u8 version [ISODCL ( 15, 15)];
110 __u8 data[ISODCL(16,2048)];
111};
112
113
114struct hs_primary_descriptor {
115 __u8 foo [ISODCL ( 1, 8)];
116 __u8 type [ISODCL ( 9, 9)];
117 __u8 id [ISODCL ( 10, 14)];
118 __u8 version [ISODCL ( 15, 15)];
119 __u8 unused1 [ISODCL ( 16, 16)];
120 char system_id [ISODCL ( 17, 48)];
121 char volume_id [ISODCL ( 49, 80)];
122 __u8 unused2 [ISODCL ( 81, 88)];
123 __u8 volume_space_size [ISODCL ( 89, 96)];
124 __u8 unused3 [ISODCL ( 97, 128)];
125 __u8 volume_set_size [ISODCL (129, 132)];
126 __u8 volume_sequence_number [ISODCL (133, 136)];
127 __u8 logical_block_size [ISODCL (137, 140)];
128 __u8 path_table_size [ISODCL (141, 148)];
129 __u8 type_l_path_table [ISODCL (149, 152)];
130 __u8 unused4 [ISODCL (153, 180)];
131 __u8 root_directory_record [ISODCL (181, 214)];
132};
133
134
135
136struct iso_path_table{
137 __u8 name_len[2];
138 __u8 extent[4];
139 __u8 parent[2];
140 char name[0];
141} __attribute__((packed));
142
143
144
145
146struct iso_directory_record {
147 __u8 length [ISODCL (1, 1)];
148 __u8 ext_attr_length [ISODCL (2, 2)];
149 __u8 extent [ISODCL (3, 10)];
150 __u8 size [ISODCL (11, 18)];
151 __u8 date [ISODCL (19, 25)];
152 __u8 flags [ISODCL (26, 26)];
153 __u8 file_unit_size [ISODCL (27, 27)];
154 __u8 interleave [ISODCL (28, 28)];
155 __u8 volume_sequence_number [ISODCL (29, 32)];
156 __u8 name_len [ISODCL (33, 33)];
157 char name [0];
158} __attribute__((packed));
159
160#define ISOFS_BLOCK_BITS 11
161#define ISOFS_BLOCK_SIZE 2048
162
163#define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize)
164#define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits)
165
166#endif
167