5 * The isofs filesystem constants/structures
8 /* This part borrowed from the bsd386 isofs */
9 #define ISODCL(from, to) (to - from + 1)
11 struct iso_volume_descriptor {
12 char type[ISODCL(1,1)]; /* 711 */
14 char version[ISODCL(7,7)];
15 char data[ISODCL(8,2048)];
18 #define ISO_SECTOR_BITS (11)
19 #define ISO_SECTOR_SIZE (1<<ISO_SECTOR_BITS)
21 #define ISO_REGULAR 1 /* regular file */
22 #define ISO_DIRECTORY 2 /* directory */
23 #define ISO_OTHER 0 /* other file (with Rock Ridge) */
25 #define RR_FLAG_PX 0x01 /* have POSIX file attributes */
26 #define RR_FLAG_NM 0x08 /* have alternate file name */
28 /* POSIX file attributes for Rock Ridge extensions */
29 #define POSIX_S_IFMT 0xF000
30 #define POSIX_S_IFREG 0x8000
31 #define POSIX_S_IFDIR 0x4000
33 /* volume descriptor types */
34 #define ISO_VD_PRIMARY 1
35 #define ISO_VD_SUPPLEMENTARY 2
36 #define ISO_VD_END 255
38 #define ISO_STANDARD_ID "CD001"
40 struct iso_primary_descriptor {
41 char type [ISODCL ( 1, 1)]; /* 711 */
42 char id [ISODCL ( 2, 6)];
43 char version [ISODCL ( 7, 7)]; /* 711 */
44 char unused1 [ISODCL ( 8, 8)];
45 char system_id [ISODCL ( 9, 40)]; /* achars */
46 char volume_id [ISODCL ( 41, 72)]; /* dchars */
47 char unused2 [ISODCL ( 73, 80)];
48 char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
49 char unused3 [ISODCL ( 89, 120)];
50 char volume_set_size [ISODCL (121, 124)]; /* 723 */
51 char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
52 char logical_block_size [ISODCL (129, 132)]; /* 723 */
53 char path_table_size [ISODCL (133, 140)]; /* 733 */
54 char type_l_path_table [ISODCL (141, 144)]; /* 731 */
55 char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
56 char type_m_path_table [ISODCL (149, 152)]; /* 732 */
57 char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
58 char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
59 char volume_set_id [ISODCL (191, 318)]; /* dchars */
60 char publisher_id [ISODCL (319, 446)]; /* achars */
61 char preparer_id [ISODCL (447, 574)]; /* achars */
62 char application_id [ISODCL (575, 702)]; /* achars */
63 char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
64 char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
65 char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
66 char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
67 char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
68 char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
69 char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
70 char file_structure_version [ISODCL (882, 882)]; /* 711 */
71 char unused4 [ISODCL (883, 883)];
72 char application_data [ISODCL (884, 1395)];
73 char unused5 [ISODCL (1396, 2048)];
76 /* Almost the same as the primary descriptor but two fields are specified */
77 struct iso_supplementary_descriptor {
78 char type [ISODCL ( 1, 1)]; /* 711 */
79 char id [ISODCL ( 2, 6)];
80 char version [ISODCL ( 7, 7)]; /* 711 */
81 char flags [ISODCL ( 8, 8)]; /* 853 */
82 char system_id [ISODCL ( 9, 40)]; /* achars */
83 char volume_id [ISODCL ( 41, 72)]; /* dchars */
84 char unused2 [ISODCL ( 73, 80)];
85 char volume_space_size [ISODCL ( 81, 88)]; /* 733 */
86 char escape [ISODCL ( 89, 120)]; /* 856 */
87 char volume_set_size [ISODCL (121, 124)]; /* 723 */
88 char volume_sequence_number [ISODCL (125, 128)]; /* 723 */
89 char logical_block_size [ISODCL (129, 132)]; /* 723 */
90 char path_table_size [ISODCL (133, 140)]; /* 733 */
91 char type_l_path_table [ISODCL (141, 144)]; /* 731 */
92 char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */
93 char type_m_path_table [ISODCL (149, 152)]; /* 732 */
94 char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */
95 char root_directory_record [ISODCL (157, 190)]; /* 9.1 */
96 char volume_set_id [ISODCL (191, 318)]; /* dchars */
97 char publisher_id [ISODCL (319, 446)]; /* achars */
98 char preparer_id [ISODCL (447, 574)]; /* achars */
99 char application_id [ISODCL (575, 702)]; /* achars */
100 char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */
101 char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */
102 char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */
103 char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */
104 char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */
105 char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */
106 char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */
107 char file_structure_version [ISODCL (882, 882)]; /* 711 */
108 char unused4 [ISODCL (883, 883)];
109 char application_data [ISODCL (884, 1395)];
110 char unused5 [ISODCL (1396, 2048)];
114 #define HS_STANDARD_ID "CDROM"
116 struct hs_volume_descriptor {
117 char foo [ISODCL ( 1, 8)]; /* 733 */
118 char type [ISODCL ( 9, 9)]; /* 711 */
119 char id [ISODCL ( 10, 14)];
120 char version [ISODCL ( 15, 15)]; /* 711 */
121 char data[ISODCL(16,2048)];
125 struct hs_primary_descriptor {
126 char foo [ISODCL ( 1, 8)]; /* 733 */
127 char type [ISODCL ( 9, 9)]; /* 711 */
128 char id [ISODCL ( 10, 14)];
129 char version [ISODCL ( 15, 15)]; /* 711 */
130 char unused1 [ISODCL ( 16, 16)]; /* 711 */
131 char system_id [ISODCL ( 17, 48)]; /* achars */
132 char volume_id [ISODCL ( 49, 80)]; /* dchars */
133 char unused2 [ISODCL ( 81, 88)]; /* 733 */
134 char volume_space_size [ISODCL ( 89, 96)]; /* 733 */
135 char unused3 [ISODCL ( 97, 128)]; /* 733 */
136 char volume_set_size [ISODCL (129, 132)]; /* 723 */
137 char volume_sequence_number [ISODCL (133, 136)]; /* 723 */
138 char logical_block_size [ISODCL (137, 140)]; /* 723 */
139 char path_table_size [ISODCL (141, 148)]; /* 733 */
140 char type_l_path_table [ISODCL (149, 152)]; /* 731 */
141 char unused4 [ISODCL (153, 180)]; /* 733 */
142 char root_directory_record [ISODCL (181, 214)]; /* 9.1 */
145 /* We use this to help us look up the parent inode numbers. */
147 struct iso_path_table{
148 unsigned char name_len[2]; /* 721 */
149 char extent[4]; /* 731 */
150 char parent[2]; /* 721 */
152 } __attribute__((packed));
154 /* high sierra is identical to iso, except that the date is only 6 bytes, and
155 there is an extra reserved byte after the flags */
157 struct iso_directory_record {
158 char length [ISODCL (1, 1)]; /* 711 */
159 char ext_attr_length [ISODCL (2, 2)]; /* 711 */
160 char extent [ISODCL (3, 10)]; /* 733 */
161 char size [ISODCL (11, 18)]; /* 733 */
162 char date [ISODCL (19, 25)]; /* 7 by 711 */
163 char flags [ISODCL (26, 26)];
164 char file_unit_size [ISODCL (27, 27)]; /* 711 */
165 char interleave [ISODCL (28, 28)]; /* 711 */
166 char volume_sequence_number [ISODCL (29, 32)]; /* 723 */
167 unsigned char name_len [ISODCL (33, 33)]; /* 711 */
169 } __attribute__((packed));
172 unsigned char magic[2];
174 } __attribute__((packed));
183 unsigned char len_id;
184 unsigned char len_des;
185 unsigned char len_src;
186 unsigned char ext_ver;
188 } __attribute__((packed));
192 } __attribute__((packed));
211 } __attribute__((packed));
215 struct SL_component link;
216 } __attribute__((packed));
221 } __attribute__((packed));
233 } __attribute__((packed));
237 struct stamp times[0]; /* Variable number of these beasts */
238 } __attribute__((packed));
240 /* Linux-specific extension for transparent decompression */
250 unsigned char version;
267 typedef union RR_ptr {
268 struct rock_ridge *rr;
273 #include <arch/byteorder.h>
275 static inline int isonum_711(char *p)
277 unsigned char x = *(unsigned char *)p;
280 static inline int isonum_712(char *p)
284 static inline int isonum_721(char *p)
286 return le16_to_cpu(*(unsigned short *)p);
288 static inline int isonum_722(char *p)
290 return be16_to_cpu(*(unsigned short *)p);
292 static inline int isonum_723(char *p)
294 /* Ignore bigendian datum due to broken mastering programs */
295 return le16_to_cpu(*(unsigned short *)p);
297 static inline int isonum_731(char *p)
299 return le32_to_cpu(*(unsigned int *)p);
301 static inline int isonum_732(char *p)
303 return be32_to_cpu(*(unsigned int *)p);
305 static inline int isonum_733(char *p)
307 /* Ignore bigendian datum due to broken mastering programs */
308 return le32_to_cpu(*(unsigned int *)p);
310 #endif /* _ISO9660_H */