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