ecma_167.h

Go to the documentation of this file.
00001  /* 
00002   Copyright (c) 2005, 2006 Rocky Bernstein <rocky@panix.com>
00003   Copyright (c) 2001-2002  Ben Fennema <bfennema@falcon.csc.calpoly.edu>
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018 /*
00019  * Some portions taken from FreeBSD ecma167-udf.h which states:
00020  * Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
00021  * All rights reserved.
00022  *
00023  * Redistribution and use in source and binary forms, with or without
00024  * modification, are permitted provided that the following conditions
00025  * are met:
00026  * 1. Redistributions of source code must retain the above copyright
00027  *    notice, this list of conditions and the following disclaimer.
00028  * 2. Redistributions in binary form must reproduce the above copyright
00029  *    notice, this list of conditions and the following disclaimer in the
00030  *    documentation and/or other materials provided with the distribution.
00031  *
00032  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
00033  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00034  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00035  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00036  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00037  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00038  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00039  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00040  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00041  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00042  * SUCH DAMAGE.
00043  */
00044 
00052 #ifndef _ECMA_167_H
00053 #define _ECMA_167_H 1
00054 
00055 #include <cdio/types.h>
00056 
00061 typedef enum {
00062   VSD_STD_ID_SIZE    =    5, 
00064   UDF_REGID_ID_SIZE  =   23, 
00065   UDF_VOLID_SIZE     =   32,
00066   UDF_FID_SIZE       =   38,
00067   UDF_VOLSET_ID_SIZE =  128
00068 } ecma_167_enum1_t ;
00069 
00074 extern ecma_167_enum1_t debug_ecma_167_enums1;
00075 
00078 typedef enum {
00079   TAGID_PRI_VOL          = 0x0001,
00080   TAGID_ANCHOR           = 0x0002,
00081   TAGID_VOL              = 0x0003,
00082   TAGID_IMP_VOL          = 0x0004,
00083   TAGID_PARTITION        = 0x0005,
00084   TAGID_LOGVOL           = 0x0006,
00085   TAGID_UNALLOC_SPACE    = 0x0007,
00086   TAGID_TERM             = 0x0008,
00087   TAGID_LOGVOL_INTEGRITY = 0x0009,
00088   TAGID_FSD              = 0x0100,
00089   TAGID_FID              = 0x0101,
00090   TAGID_AED              = 0x0102,
00091   TAGID_IE               = 0x0103,
00092   TAGID_TE               = 0x0104,
00093   TAGID_FILE_ENTRY       = 0x0105,
00094   TAGID_EAHD             = 0x0106,
00095   TAGID_USE              = 0x0107,
00096   TAGID_SBD              = 0x0108,
00097   TAGID_PIE              = 0x0109,
00098   TAGID_EFE              = 0x010A,
00099 } tag_id_t ;
00100 
00102 typedef enum {
00103   CHARSPEC_TYPE_CS0 = 0x00,     
00104   CHARSPEC_TYPE_CS1 = 0x01,     
00105   CHARSPEC_TYPE_CS2 = 0x02,     
00106   CHARSPEC_TYPE_CS3 = 0x03,     
00107   CHARSPEC_TYPE_CS4 = 0x04,     
00108   CHARSPEC_TYPE_CS5 = 0x05,     
00109   CHARSPEC_TYPE_CS6 = 0x06,     
00110   CHARSPEC_TYPE_CS7 = 0x07,     
00112   CHARSPEC_TYPE_CS8 = 0x08,     
00113 } udf_charspec_enum_t;
00114   
00115 typedef uint8_t  udf_Uint8_t;  
00116 typedef uint16_t udf_Uint16_t; 
00117 typedef uint32_t udf_Uint32_t; 
00118 typedef uint64_t udf_Uint64_t; 
00119 typedef char     udf_dstring;  
00121 #define UDF_LENGTH_MASK 0x3fffffff
00122 
00123 PRAGMA_BEGIN_PACKED
00124 
00126 struct udf_charspec_s
00127 {
00128   udf_Uint8_t   charset_type;
00129   udf_Uint8_t   charset_info[63];
00130 } GNUC_PACKED;
00131 
00132 typedef struct udf_charspec_s udf_charspec_t;
00133 
00135 struct udf_timestamp_s
00136 {
00137   udf_Uint16_t          type_tz;
00138   udf_Uint16_t          year;
00139   udf_Uint8_t           month;
00140   udf_Uint8_t           day;
00141   udf_Uint8_t           hour;
00142   udf_Uint8_t           minute;
00143   udf_Uint8_t           second;
00144   udf_Uint8_t           centiseconds;
00145   udf_Uint8_t           hundreds_of_microseconds;
00146   udf_Uint8_t           microseconds;
00147 } GNUC_PACKED;
00148 
00149 typedef struct udf_timestamp_s udf_timestamp_t;
00150 
00156 typedef enum { 
00157   TIMESTAMP_TYPE_CUT        =   0x0000,
00158   TIMESTAMP_TYPE_LOCAL      =   0x1000,
00159   TIMESTAMP_TYPE_AGREEMENT  =   0x2000,
00160   TIMESTAMP_TYPE_MASK       =   0xF000,
00161   TIMESTAMP_TIMEZONE_MASK   =   0x0FFF,
00162 } ecma_167_timezone_enum_t ;
00163 
00168 extern ecma_167_timezone_enum_t debug_ecma_167_timezone_enum;
00169 
00170 
00171 #define TIMESTAMP_TYPE_MASK             0xF000
00172 #define TIMESTAMP_TYPE_CUT              0x0000
00173 #define TIMESTAMP_TYPE_LOCAL            0x1000
00174 #define TIMESTAMP_TYPE_AGREEMENT        0x2000
00175 #define TIMESTAMP_TIMEZONE_MASK         0x0FFF
00176 
00178 struct udf_regid_s
00179 {
00180   udf_Uint8_t           flags;
00181   udf_Uint8_t           id[UDF_REGID_ID_SIZE];
00182   udf_Uint8_t           id_suffix[8];
00183 } GNUC_PACKED;
00184 
00185 typedef struct udf_regid_s udf_regid_t;
00186 
00188 #define ENTITYID_FLAGS_DIRTY            0x00
00189 #define ENTITYID_FLAGS_PROTECTED        0x01
00190 
00192 struct vol_struct_desc_s
00193 {
00194   udf_Uint8_t           struct_type;
00195   udf_Uint8_t           std_id[VSD_STD_ID_SIZE];
00196   udf_Uint8_t           struct_version;
00197   udf_Uint8_t           struct_data[2041];
00198 } GNUC_PACKED;
00199 
00201 #define VSD_STD_ID_NSR02                "NSR02" /* (3/9.1) */
00202 
00205 /* The below const definitions are to faciltate debugging of the
00206    values #define'd below. */
00207 extern const char VSD_STD_ID_BEA01[sizeof("BEA01")-1];
00208 extern const char VSD_STD_ID_BOOT2[sizeof("BOOT2")-1];
00209 extern const char VSD_STD_ID_CD001[sizeof("CD001")-1];
00210 extern const char VSD_STD_ID_CDW01[sizeof("CDW02")-1];
00211 extern const char VSD_STD_ID_NSR03[sizeof("NSR03")-1];
00212 extern const char VSD_STD_ID_TEA01[sizeof("TEA01")-1];
00213 
00214 #define VSD_STD_ID_BEA01                "BEA01" 
00215 #define VSD_STD_ID_BOOT2                "BOOT2" 
00216 #define VSD_STD_ID_CD001                "CD001" 
00217 #define VSD_STD_ID_CDW02                "CDW02" 
00218 #define VSD_STD_ID_NSR02                "NSR02" 
00220 #define VSD_STD_ID_NSR03                "NSR03" 
00221 #define VSD_STD_ID_TEA01                "TEA01" 
00224 struct beginning_extended_area_desc_s
00225 {
00226   udf_Uint8_t           struct_type;
00227   udf_Uint8_t           std_id[VSD_STD_ID_SIZE];
00228   udf_Uint8_t           struct_version;
00229   udf_Uint8_t           struct_data[2041];
00230 } GNUC_PACKED;
00231 
00233 struct terminating_extended_area_desc_s
00234 {
00235   udf_Uint8_t           struct_type;
00236   udf_Uint8_t           std_id[VSD_STD_ID_SIZE];
00237   udf_Uint8_t           struct_version;
00238   udf_Uint8_t           struct_data[2041];
00239 } GNUC_PACKED;
00240 
00242 struct boot_desc_s
00243 {
00244   udf_Uint8_t           struct_type;
00245   udf_Uint8_t           std_ident[VSD_STD_ID_SIZE];
00246   udf_Uint8_t           struct_version;
00247   udf_Uint8_t           reserved1;
00248   udf_regid_t           arch_type;
00249   udf_regid_t           boot_ident;
00250   udf_Uint32_t          bool_ext_location;
00251   udf_Uint32_t          bool_ext_length;
00252   udf_Uint64_t          load_address;
00253   udf_Uint64_t          start_address;
00254   udf_timestamp_t       desc_creation_time;
00255   udf_Uint16_t          flags;
00256   udf_Uint8_t           reserved2[32];
00257   udf_Uint8_t           boot_use[1906];
00258 } GNUC_PACKED;
00259 
00261 #define BOOT_FLAGS_ERASE                0x01
00262 
00264 struct udf_extent_ad_s
00265 {
00266   udf_Uint32_t          len;
00267   udf_Uint32_t          loc;
00268 } GNUC_PACKED;
00269 
00270 typedef struct udf_extent_ad_s udf_extent_ad_t;
00271 
00273 struct udf_tag_s
00274 {
00275   udf_Uint16_t          id;
00276   udf_Uint16_t          desc_version;
00277   udf_Uint8_t           cksum;
00278   udf_Uint8_t           reserved;
00279   udf_Uint16_t          i_serial;
00280   udf_Uint16_t          desc_CRC;
00281   udf_Uint16_t          desc_CRC_len;
00282   udf_Uint32_t          loc;
00283 } GNUC_PACKED;
00284 
00285 typedef struct udf_tag_s udf_tag_t;
00286 
00288 struct NSR_desc_s
00289 {
00290   udf_Uint8_t   struct_type;
00291   udf_Uint8_t   std_id[VSD_STD_ID_SIZE];
00292   udf_Uint8_t   struct_version;
00293   udf_Uint8_t   reserved;
00294   udf_Uint8_t   struct_data[2040];
00295 } GNUC_PACKED;
00296 
00298 struct udf_pvd_s
00299 {
00300   udf_tag_t       tag;
00301   udf_Uint32_t    vol_desc_seq_num;
00302   udf_Uint32_t    primary_vol_desc_num;
00303   udf_dstring     vol_ident[UDF_VOLID_SIZE];
00304   udf_Uint16_t    vol_seq_num;
00305   udf_Uint16_t    max_vol_seqnum;
00306   udf_Uint16_t    interchange_lvl;
00307   udf_Uint16_t    max_interchange_lvl;
00308   udf_Uint32_t    charset_list;
00309   udf_Uint32_t    max_charset_list;
00310   udf_dstring     volset_id[UDF_VOLSET_ID_SIZE];
00311   udf_charspec_t  desc_charset;
00312   udf_charspec_t  explanatory_charset;
00313   udf_extent_ad_t vol_abstract;
00314   udf_extent_ad_t vol_copyright;
00315   udf_regid_t     app_ident;
00316   udf_timestamp_t recording_time;
00317   udf_regid_t     imp_ident;
00318   udf_Uint8_t     imp_use[64];
00319   udf_Uint32_t    predecessor_vol_desc_seq_location;
00320   udf_Uint16_t    flags;
00321   udf_Uint8_t     reserved[22];
00322 } GNUC_PACKED;
00323 
00324 typedef struct udf_pvd_s udf_pvd_t;
00325 
00327 #define PVD_FLAGS_VSID_COMMON           0x0001
00328 
00330 struct anchor_vol_desc_ptr_s
00331 {
00332   udf_tag_t       tag;
00333   udf_extent_ad_t main_vol_desc_seq_ext;
00334   udf_extent_ad_t reserve_vol_desc_seq_ext;
00335   udf_Uint8_t     reserved[480];
00336 } GNUC_PACKED;
00337 
00338 typedef struct anchor_vol_desc_ptr_s anchor_vol_desc_ptr_t;
00339 
00341 struct vol_desc_ptr_s
00342 {
00343   udf_tag_t       tag;
00344   udf_Uint32_t    vol_desc_seq_num;
00345   udf_extent_ad_t next_vol_desc_set_ext;
00346   udf_Uint8_t     reserved[484];
00347 } GNUC_PACKED;
00348 
00350 struct imp_use_vol_desc_s
00351 {
00352   udf_tag_t    tag;
00353   udf_Uint32_t vol_desc_seq_num;
00354   udf_regid_t  imp_id;
00355   udf_Uint8_t  imp_use[460];
00356 } GNUC_PACKED;
00357 
00359 struct partition_desc_s
00360 {
00361   udf_tag_t     tag;
00362   udf_Uint32_t  vol_desc_seq_num;
00363   udf_Uint16_t  flags;
00364   udf_Uint16_t  number;             
00365   udf_regid_t   contents;
00366   udf_Uint8_t   contents_use[128];
00367   udf_Uint32_t  access_type;
00368   udf_Uint32_t  start_loc;
00369   udf_Uint32_t  part_len;
00370   udf_regid_t   imp_id;
00371   udf_Uint8_t   imp_use[128];
00372   udf_Uint8_t   reserved[156];
00373 } GNUC_PACKED;
00374 
00375 typedef struct partition_desc_s partition_desc_t;
00376 
00378 #define PD_PARTITION_FLAGS_ALLOC        0x0001
00379 
00381 #define PD_PARTITION_CONTENTS_NSR02     "+NSR02"
00382 
00384 #define PD_PARTITION_CONTENTS_FDC01     "+FDC01"
00385 #define PD_PARTITION_CONTENTS_CD001     "+CD001"
00386 #define PD_PARTITION_CONTENTS_CDW02     "+CDW02"
00387 #define PD_PARTITION_CONTENTS_NSR03     "+NSR03"
00388 
00390 #define PD_ACCESS_TYPE_NONE             0x00000000
00391 #define PD_ACCESS_TYPE_READ_ONLY        0x00000001
00392 #define PD_ACCESS_TYPE_WRITE_ONCE       0x00000002
00393 #define PD_ACCESS_TYPE_REWRITABLE       0x00000003
00394 #define PD_ACCESS_TYPE_OVERWRITABLE     0x00000004
00395 
00397 struct udf_lb_addr_s
00398 {
00399   udf_Uint32_t  lba;
00400   udf_Uint16_t  partitionReferenceNum;
00401 } GNUC_PACKED;
00402 
00403 typedef struct udf_lb_addr_s udf_lb_addr_t;
00404 
00406 struct udf_short_ad_s
00407 {
00408   udf_Uint32_t  len;
00409   udf_Uint32_t  pos;
00410 } GNUC_PACKED;
00411 
00412 typedef struct udf_short_ad_s udf_short_ad_t;
00413 
00415 struct udf_long_ad_s
00416 {
00417   udf_Uint32_t  len;
00418   udf_lb_addr_t loc;
00419   udf_Uint8_t   imp_use[6];
00420 } GNUC_PACKED;
00421 
00422 typedef struct udf_long_ad_s udf_long_ad_t;
00423 
00425 struct logical_vol_desc_s
00426 {
00427   udf_tag_t       tag;
00428   udf_Uint32_t    seq_num;
00429   udf_charspec_t  desc_charset;
00430   udf_dstring     logvol_id[128];
00431   udf_Uint32_t    logical_blocksize;
00432   udf_regid_t     domain_id;
00433   union {
00434     udf_long_ad_t fsd_loc;
00435     udf_Uint8_t   logvol_content_use[16];
00436   } lvd_use;
00437   udf_Uint8_t     logvol_contents_use[16];
00438   udf_Uint32_t    maptable_len;
00439   udf_Uint32_t    i_partition_maps;
00440   udf_regid_t     imp_id;
00441   udf_Uint8_t     imp_use[128];
00442   udf_extent_ad_t integrity_seq_ext;
00443   udf_Uint8_t     partition_maps[0];
00444 } GNUC_PACKED;
00445 
00446 typedef struct logical_vol_desc_s logical_vol_desc_t;
00447 
00449 struct generic_partition_map
00450 {
00451   udf_Uint8_t   partition_map_type;
00452   udf_Uint8_t   partition_map_length;
00453   udf_Uint8_t   partition_mapping[0];
00454 } GNUC_PACKED;
00455 
00457 #define GP_PARTITION_MAP_TYPE_UNDEF     0x00
00458 #define GP_PARTIITON_MAP_TYPE_1         0x01
00459 #define GP_PARTITION_MAP_TYPE_2         0x02
00460 
00462 struct generic_partition_map1
00463 {
00464   udf_Uint8_t   partition_map_type;
00465   udf_Uint8_t   partition_map_length;
00466   udf_Uint16_t  vol_seq_num;
00467   udf_Uint16_t  i_partition;
00468 } GNUC_PACKED;
00469 
00471 struct generic_partition_map2
00472 {
00473   udf_Uint8_t   partition_map_type;
00474   udf_Uint8_t   partition_map_length; 
00475   udf_Uint8_t   partition_id[62];
00476 } GNUC_PACKED;
00477 
00479 struct unalloc_space_desc_s
00480 {
00481   udf_tag_t       tag;
00482   udf_Uint32_t    vol_desc_seq_num;
00483   udf_Uint32_t    i_alloc_descs;
00484   udf_extent_ad_t allocDescs[0];
00485 } GNUC_PACKED;
00486 
00488 struct terminating_desc_s
00489 {
00490   udf_tag_t    tag;
00491   udf_Uint8_t   reserved[496];
00492 } GNUC_PACKED;
00493 
00495 struct logvol_integrity_desc_s
00496 {
00497   udf_tag_t       tag;
00498   udf_timestamp_t recording_time;
00499   udf_Uint32_t    integrity_type;
00500   udf_extent_ad_t next_integrity_ext;
00501   udf_Uint8_t     logvol_contents_use[32];
00502   udf_Uint32_t    i_partitions;
00503   udf_Uint32_t    imp_use_len;
00504   udf_Uint32_t    freespace_table[0];
00505   udf_Uint32_t    size_table[0];
00506   udf_Uint8_t     imp_use[0];
00507 } GNUC_PACKED;
00508 
00510 #define LVID_INTEGRITY_TYPE_OPEN        0x00000000
00511 #define LVID_INTEGRITY_TYPE_CLOSE       0x00000001
00512 
00514 struct udf_ext_ad_s
00515 {
00516   udf_Uint32_t  len;
00517   udf_Uint32_t  recorded_len;
00518   udf_Uint32_t  information_len;
00519   udf_lb_addr_t ext_loc;
00520 } GNUC_PACKED;
00521 
00522 typedef struct udf_ext_ad_s udf_ext_ad_t;
00523 
00529 struct udf_fsd_s
00530 {
00531   udf_tag_t       tag;
00532   udf_timestamp_t recording_time;
00533   udf_Uint16_t    interchange_lvl;
00534   udf_Uint16_t    maxInterchange_lvl;
00535   udf_Uint32_t    charset_list;
00536   udf_Uint32_t    max_charset_list;
00537   udf_Uint32_t    fileset_num;
00538   udf_Uint32_t    udf_fsd_num;
00539   udf_charspec_t  logical_vol_id_charset;
00540   udf_dstring     logical_vol_id[128];
00541   udf_charspec_t  fileset_charset;
00542   udf_dstring     fileSet_id[32];
00543   udf_dstring     copyright_file_id[32];
00544   udf_dstring     abstract_file_id[32];
00545   udf_long_ad_t   root_icb;
00546   udf_regid_t     domain_id;
00547   udf_long_ad_t   next_ext;
00548   udf_long_ad_t   stream_directory_ICB;
00549   udf_Uint8_t     reserved[32];
00550 } GNUC_PACKED;
00551 
00552 typedef struct udf_fsd_s udf_fsd_t;
00553 
00555 struct partition_header_desc_s
00556 {
00557   udf_short_ad_t unalloc_space_table;
00558   udf_short_ad_t unalloc_space_bitmap;
00559   udf_short_ad_t partition_integrity_table;
00560   udf_short_ad_t freed_space_table;
00561   udf_short_ad_t freed_space_bitmap;
00562   udf_Uint8_t    reserved[88];
00563 } GNUC_PACKED;
00564 
00565 typedef struct partition_header_desc_s partition_header_desc_t;
00566 
00568 struct udf_fileid_desc_s
00569 {
00570   udf_tag_t     tag;
00571   udf_Uint16_t  file_version_num;
00572   udf_Uint8_t   file_characteristics;
00573   udf_Uint8_t   i_file_id;
00574   udf_long_ad_t icb;
00575   udf_Uint16_t  i_imp_use;
00576   udf_Uint8_t   imp_use[0];
00577   udf_Uint8_t   file_id[0];
00578   udf_Uint8_t   padding[0];
00579 } GNUC_PACKED;
00580 
00581 typedef struct udf_fileid_desc_s udf_fileid_desc_t;
00582 
00588 typedef enum {
00589   UDF_FILE_HIDDEN       = (1 << 0),
00590   UDF_FILE_DIRECTORY    = (1 << 1),
00591   UDF_FILE_DELETED      = (1 << 2),
00592   UDF_FILE_PARENT       = (1 << 3),
00593   UDF_FILE_METADATA     = (1 << 4)
00594 } file_characteristics_t;
00595 
00597 struct allocExtDesc
00598 {
00599   udf_tag_t    tag;
00600   udf_Uint32_t previous_alloc_ext_loc;
00601   udf_Uint32_t i_alloc_descs;
00602 } GNUC_PACKED;
00603 
00605 struct udf_icbtag_s
00606 {
00607   udf_Uint32_t  prev_num_dirs;
00608   udf_Uint16_t  strat_type;
00609   udf_Uint16_t  strat_param;
00610   udf_Uint16_t  max_num_entries;
00611   udf_Uint8_t   reserved;
00612   udf_Uint8_t   file_type;
00613   udf_lb_addr_t parent_ICB;
00614   udf_Uint16_t  flags;
00615 } GNUC_PACKED;
00616 
00617 typedef struct udf_icbtag_s udf_icbtag_t;
00618 
00619 #define UDF_ICB_TAG_FLAGS_SETUID        0x40
00620 #define UDF_ICB_TAG_FLAGS_SETGID        0x80
00621 #define UDF_ICB_TAG_FLAGS_STICKY        0x100
00622 
00624 #define ICBTAG_STRATEGY_TYPE_UNDEF      0x0000
00625 #define ICBTAG_STRATEGY_TYPE_1          0x0001
00626 #define ICBTAG_STRATEGY_TYPE_2          0x0002
00627 #define ICBTAG_STRATEGY_TYPE_3          0x0003
00628 #define ICBTAG_STRATEGY_TYPE_4          0x0004
00629 
00635 typedef enum {
00636   ICBTAG_FILE_TYPE_UNDEF =      0x00,
00637   ICBTAG_FILE_TYPE_USE =        0x01,
00638   ICBTAG_FILE_TYPE_PIE =        0x02,
00639   ICBTAG_FILE_TYPE_IE =         0x03,
00640   ICBTAG_FILE_TYPE_DIRECTORY =  0x04,
00641   ICBTAG_FILE_TYPE_REGULAR =    0x05,
00642   ICBTAG_FILE_TYPE_BLOCK =      0x06,
00643   ICBTAG_FILE_TYPE_CHAR =       0x07,
00644   ICBTAG_FILE_TYPE_EA =         0x08,
00645   ICBTAG_FILE_TYPE_FIFO =       0x09,
00646   ICBTAG_FILE_TYPE_SOCKET =     0x0A,
00647   ICBTAG_FILE_TYPE_TE =         0x0B,
00648   ICBTAG_FILE_TYPE_SYMLINK =    0x0C,
00649   ICBTAG_FILE_TYPE_STREAMDIR =  0x0D
00650 } icbtag_file_type_enum_t;
00651 
00656 extern icbtag_file_type_enum_t debug_icbtag_file_type_enum;
00657 
00659 #define ICBTAG_FLAG_AD_MASK             0x0007
00660 #define ICBTAG_FLAG_AD_SHORT            0x0000
00661 #define ICBTAG_FLAG_AD_LONG             0x0001
00662 #define ICBTAG_FLAG_AD_EXTENDED         0x0002
00663 #define ICBTAG_FLAG_AD_IN_ICB           0x0003
00664 #define ICBTAG_FLAG_SORTED              0x0008
00665 #define ICBTAG_FLAG_NONRELOCATABLE      0x0010
00666 #define ICBTAG_FLAG_ARCHIVE             0x0020
00667 #define ICBTAG_FLAG_SETUID              0x0040
00668 #define ICBTAG_FLAG_SETGID              0x0080
00669 #define ICBTAG_FLAG_STICKY              0x0100
00670 #define ICBTAG_FLAG_CONTIGUOUS          0x0200
00671 #define ICBTAG_FLAG_SYSTEM              0x0400
00672 #define ICBTAG_FLAG_TRANSFORMED         0x0800
00673 #define ICBTAG_FLAG_MULTIVERSIONS       0x1000
00674 #define ICBTAG_FLAG_STREAM              0x2000
00675 
00677 struct indirect_entry_s
00678 {
00679   udf_tag_t       tag;
00680   udf_icbtag_t    icb_tag;
00681   udf_long_ad_t   indirect_ICB;
00682 } GNUC_PACKED;
00683 
00685 struct terminal_entry_s
00686 {
00687   udf_tag_t       tag;
00688   udf_icbtag_t    icb_tag;
00689 } GNUC_PACKED;
00690 
00692 struct udf_file_entry_s
00693 {
00694   udf_tag_t       tag;                   
00695   udf_icbtag_t    icb_tag;                
00696   udf_Uint32_t    uid;                    
00697   udf_Uint32_t    gid;                    
00698   udf_Uint32_t    permissions;            
00699   udf_Uint16_t    link_count;             
00700   udf_Uint8_t     rec_format;             
00701   udf_Uint8_t     rec_disp_attr;          
00702   udf_Uint32_t    rec_len;                
00703   udf_Uint64_t    info_len;               
00704   udf_Uint64_t    logblks_recorded;       
00705   udf_timestamp_t access_time;            
00708   udf_timestamp_t modification_time;      
00711   udf_timestamp_t attribute_time;
00712   udf_Uint32_t    checkpoint;
00713   udf_long_ad_t   ext_attr_ICB;
00714   udf_regid_t     imp_id;
00715   udf_Uint64_t    unique_iD;
00716   udf_Uint32_t    i_extended_attr;
00717   udf_Uint32_t    i_alloc_descs;
00718   udf_Uint8_t     ext_attr[0];
00719   udf_Uint8_t     alloc_descs[0];
00720 } GNUC_PACKED;
00721 
00722 typedef struct udf_file_entry_s udf_file_entry_t;
00723 
00724 #define UDF_FENTRY_SIZE 176
00725 #define UDF_FENTRY_PERM_USER_MASK       0x07
00726 #define UDF_FENTRY_PERM_GRP_MASK        0xE0
00727 #define UDF_FENTRY_PERM_OWNER_MASK      0x1C00
00728 
00730 #define FE_PERM_O_EXEC                  0x00000001U
00731 #define FE_PERM_O_WRITE                 0x00000002U
00732 #define FE_PERM_O_READ                  0x00000004U
00733 #define FE_PERM_O_CHATTR                0x00000008U
00734 #define FE_PERM_O_DELETE                0x00000010U
00735 #define FE_PERM_G_EXEC                  0x00000020U
00736 #define FE_PERM_G_WRITE                 0x00000040U
00737 #define FE_PERM_G_READ                  0x00000080U
00738 #define FE_PERM_G_CHATTR                0x00000100U
00739 #define FE_PERM_G_DELETE                0x00000200U
00740 #define FE_PERM_U_EXEC                  0x00000400U
00741 #define FE_PERM_U_WRITE                 0x00000800U
00742 #define FE_PERM_U_READ                  0x00001000U
00743 #define FE_PERM_U_CHATTR                0x00002000U
00744 #define FE_PERM_U_DELETE                0x00004000U
00745 
00747 #define FE_RECORD_FMT_UNDEF             0x00
00748 #define FE_RECORD_FMT_FIXED_PAD         0x01
00749 #define FE_RECORD_FMT_FIXED             0x02
00750 #define FE_RECORD_FMT_VARIABLE8         0x03
00751 #define FE_RECORD_FMT_VARIABLE16        0x04
00752 #define FE_RECORD_FMT_VARIABLE16_MSB    0x05
00753 #define FE_RECORD_FMT_VARIABLE32        0x06
00754 #define FE_RECORD_FMT_PRINT             0x07
00755 #define FE_RECORD_FMT_LF                0x08
00756 #define FE_RECORD_FMT_CR                0x09
00757 #define FE_RECORD_FMT_CRLF              0x0A
00758 #define FE_RECORD_FMT_LFCR              0x0B
00759 
00761 #define FE_RECORD_DISPLAY_ATTR_UNDEF    0x00
00762 #define FE_RECORD_DISPLAY_ATTR_1        0x01
00763 #define FE_RECORD_DISPLAY_ATTR_2        0x02
00764 #define FE_RECORD_DISPLAY_ATTR_3        0x03
00765 
00767 struct extended_attr_header_desc_s
00768 {
00769   udf_tag_t       tag;
00770   udf_Uint32_t    imp_attr_location;
00771   udf_Uint32_t    app_attr_location;
00772 } GNUC_PACKED;
00773 
00775 struct generic_format_s
00776 {
00777   udf_Uint32_t  attr_type;
00778   udf_Uint8_t   attr_subtype;
00779   udf_Uint8_t   reserved[3];
00780   udf_Uint32_t  attrLength;
00781   udf_Uint8_t   attrData[0];
00782 } GNUC_PACKED;
00783 
00785 struct charSet_info_s
00786 {
00787   udf_Uint32_t  attr_type;
00788   udf_Uint8_t   attr_subtype;
00789   udf_Uint8_t   reserved[3];
00790   udf_Uint32_t  attrLength;
00791   udf_Uint32_t  escapeSeqLength;
00792   udf_Uint8_t   charSetType;
00793   udf_Uint8_t   escapeSeq[0];
00794 } GNUC_PACKED;
00795 
00796 /* Alternate Permissions (ECMA 167r3 4/14.10.4) */
00797 struct alt_perms_s
00798 {
00799   udf_Uint32_t  attr_type;
00800   udf_Uint8_t   attr_subtype;
00801   udf_Uint8_t   reserved[3];
00802   udf_Uint32_t  attrLength;
00803   udf_Uint16_t  owner_id;
00804   udf_Uint16_t  group_id;
00805   udf_Uint16_t  permission;
00806 } GNUC_PACKED;
00807 
00809 struct filetimes_ext_attr_s
00810 {
00811   udf_Uint32_t  attr_type;
00812   udf_Uint8_t   attr_subtype;
00813   udf_Uint8_t   reserved[3];
00814   udf_Uint32_t  attrLength;
00815   udf_Uint32_t  dataLength;
00816   udf_Uint32_t  fileTimeExistence;
00817   udf_Uint8_t   fileTimes;
00818 } GNUC_PACKED;
00819 
00821 #define FTE_CREATION                    0x00000001
00822 #define FTE_DELETION                    0x00000004
00823 #define FTE_EFFECTIVE                   0x00000008
00824 #define FTE_BACKUP                      0x00000002
00825 
00827 struct infoTimesExtAttr
00828 {
00829   udf_Uint32_t  attr_type;
00830   udf_Uint8_t   attr_subtype;
00831   udf_Uint8_t   reserved[3];
00832   udf_Uint32_t  attrLength;
00833   udf_Uint32_t  dataLength;
00834   udf_Uint32_t  infoTimeExistence;
00835   udf_Uint8_t   infoTimes[0];
00836 } GNUC_PACKED;
00837 
00839 struct deviceSpec
00840 {
00841   udf_Uint32_t  attr_type;
00842   udf_Uint8_t   attr_subtype;
00843   udf_Uint8_t   reserved[3];
00844   udf_Uint32_t  attrLength;
00845   udf_Uint32_t  imp_useLength;
00846   udf_Uint32_t  majorDevice_id;
00847   udf_Uint32_t  minorDevice_id;
00848   udf_Uint8_t   imp_use[0];
00849 } GNUC_PACKED;
00850 
00852 struct impUseExtAttr
00853 {
00854   udf_Uint32_t  attr_type;
00855   udf_Uint8_t   attr_subtype;
00856   udf_Uint8_t   reserved[3];
00857   udf_Uint32_t  attrLength;
00858   udf_Uint32_t  imp_useLength;
00859   udf_regid_t   imp_id;
00860   udf_Uint8_t   imp_use[0];
00861 } GNUC_PACKED;
00862 
00864 struct appUseExtAttr
00865 {
00866   udf_Uint32_t  attr_type;
00867   udf_Uint8_t   attr_subtype;
00868   udf_Uint8_t   reserved[3];
00869   udf_Uint32_t  attrLength;
00870   udf_Uint32_t  appUseLength;
00871   udf_regid_t   app_id;
00872   udf_Uint8_t   appUse[0];
00873 } GNUC_PACKED;
00874 
00875 #define EXTATTR_CHAR_SET                1
00876 #define EXTATTR_ALT_PERMS               3
00877 #define EXTATTR_FILE_TIMES              5
00878 #define EXTATTR_INFO_TIMES              6
00879 #define EXTATTR_DEV_SPEC                12
00880 #define EXTATTR_IMP_USE                 2048
00881 #define EXTATTR_APP_USE                 65536
00882 
00883 
00885 struct unallocSpaceEntry
00886 {
00887   udf_tag_t     tag;
00888   udf_icbtag_t  icb_tag;
00889   udf_Uint32_t  lengthAllocDescs;
00890   udf_Uint8_t   allocDescs[0];
00891 } GNUC_PACKED;
00892 
00894 struct spaceBitmapDesc
00895 {
00896   udf_tag_t     tag;
00897   udf_Uint32_t  i_bits;
00898   udf_Uint32_t  i_bytes;
00899   udf_Uint8_t   bitmap[0];
00900 } GNUC_PACKED;
00901 
00903 struct partitionIntegrityEntry
00904 {
00905   udf_tag_t       tag;
00906   udf_icbtag_t    icb_tag;
00907   udf_timestamp_t recording_time;
00908   udf_Uint8_t     integrityType;
00909   udf_Uint8_t     reserved[175];
00910   udf_regid_t     imp_id;
00911   udf_Uint8_t     imp_use[256];
00912 } GNUC_PACKED;
00913 
00917 #define EXT_RECORDED_ALLOCATED          0x00000000
00918 #define EXT_NOT_RECORDED_ALLOCATED      0x40000000
00919 #define EXT_NOT_RECORDED_NOT_ALLOCATED  0x80000000
00920 #define EXT_NEXT_EXTENT_ALLOCDECS       0xC0000000
00921 
00927 struct logical_vol_header_desc_s 
00928 {
00929   udf_Uint64_t  uniqueID;
00930   udf_Uint8_t   reserved[24];
00931 } GNUC_PACKED;
00932 
00933 typedef struct logical_vol_header_desc_s logical_vol_header_desc_t;
00934 
00936 struct pathComponent
00937 {
00938   udf_Uint8_t   component_type;
00939   udf_Uint8_t   lengthComponent_id;
00940   udf_Uint16_t  componentFileVersionNum;
00941   udf_dstring   component_id[0];
00942 } GNUC_PACKED;
00943 
00945 struct extended_file_entry
00946 {
00947   udf_tag_t       tag;                     
00948   udf_icbtag_t    icb_tag;                 
00949   udf_Uint32_t    uid;                     
00950   udf_Uint32_t    gid;                     
00951   udf_Uint32_t    permissions;             
00952   udf_Uint16_t    link_count;              
00953   udf_Uint8_t     rec_format;              
00954   udf_Uint8_t     rec_display_attr;        
00955   udf_Uint32_t    record_len;              
00956   udf_Uint64_t    info_len;                
00957   udf_Uint64_t    object_size;             
00958   udf_Uint64_t    logblks_recorded;        
00959   udf_timestamp_t access_time;             
00961   udf_timestamp_t modification_time;       
00964   udf_timestamp_t create_time;             
00965   udf_timestamp_t attribute_time;          
00968   udf_Uint32_t    checkpoint;
00969   udf_Uint32_t    reserved;                
00970   udf_long_ad_t   ext_attr_ICB;
00971   udf_long_ad_t   stream_directory_ICB;
00972   udf_regid_t     imp_id;
00973   udf_Uint64_t    unique_ID;
00974   udf_Uint32_t    length_extended_attr;
00975   udf_Uint32_t    length_alloc_descs;
00976   udf_Uint8_t     ext_attr[0];
00977   udf_Uint8_t     alloc_descs[0];
00978 } GNUC_PACKED;
00979 
00980 PRAGMA_END_PACKED
00981 
00987 extern file_characteristics_t debug_file_characteristics;
00988 extern tag_id_t debug_tagid;
00989 
00990 
00991 #endif /* _ECMA_167_H */

Generated on Thu May 3 13:32:57 2007 for libcdio by  doxygen 1.5.1