udf_volume.h revision 8d490e6b8d12c7098723faa9f485a616e2e88054
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FS_UDF_VOLUME_H
#define _SYS_FS_UDF_VOLUME_H
#include <sys/isa_defs.h>
#ifdef __cplusplus
extern "C" {
#endif
#define UDF_102 0x66
#define UDF_150 0x96
#define UDF_200 0xC8
/* fid_idlen include compression id */
/*
* #define ID_LEN(fid) \
* (((SWAP_16((fid)->fid_iulen) + (fid)->fid_idlen - 2) + 3) & ~3)
*/
#define UDF_DOMAIN_NAME "*OSTA UDF Compliant\0\0\0\0"
#define UDF_LV_INFO "*UDF LV Info\0\0\0\0\0\0\0\0\0\0\0\0"
#define UDF_FREEEASPACE "*UDF FreeEASpace\0\0\0\0\0\0\0\0"
#define UDF_FREEAEASPACE "*UDF FreeAppEASpace\0\0\0\0"
#define UDF_CGMS_INFO "*UDF DVD CGMS Info\0\0\0\0"
#define UDF_OS2_EA "*UDF OS/2 EA\0\0\0\0\0\0\0\0\0\0\0"
#define UDF_OS2_EA_LEN "*UDF OS/2 EALength\0\0\0\0\0\0"
#define UDF_MAC_VOLINFO "*UDF Mac VolumeInfo\0\0\0\0"
#define UDF_MAC_UNIQID "*UDF Mac UniqueIDTable\0"
#define UDF_MAC_RESFRK "*UDF Mac ResourceFork\0\0"
#define UDF_VIRT_PART "*UDF Virtual Partition\0"
#define UDF_SPAR_PART "*UDF Sparable Partition"
#define UDF_VAT "*UDF Virtual Alloc Tbl\0"
#define UDF_SPAR_TBL "*UDF Sparing Table\0\0\0\0\0"
#if defined(_BIG_ENDIAN)
(((a) & 0xff00) << 8) | \
(((a) & 0xff0000) >> 8) | \
(((a) & 0xff000000) >> 24))
(((a) & 0xff00ULL) << 40) | \
(((a) & 0xff0000ULL) << 24) | \
(((a) & 0xff000000ULL) << 8) | \
(((a) & 0xff00000000ULL) >> 8) | \
(((a) & 0xff0000000000ULL) >> 24) | \
(((a) & 0xff000000000000ULL) >> 40) | \
(((a) & 0xff00000000000000ULL) >> 56))
#else
#define SWAP_16(a) (a)
#define SWAP_32(a) (a)
#define SWAP_64(a) (a)
#endif /* _BIG_ENDIAN */
#define BCD2HEX_16(a) (((a) & 0xf) + \
#define ANCHOR_VOL_DESC_LOC (256)
#define ANCHOR_VOL_DESC_LEN 0x200
/* Basic data structures */
typedef char dstring_t;
/*
* recorded at the start of the descriptor
* used to distinguish between different
* descriptors
*/
struct tag {
};
/*
* descriptor tag id values
*/
#define UD_PRI_VOL_DESC 0x0001
#define UD_ANCH_VOL_DESC 0x0002
#define UD_VOL_DESC_PTR 0x0003
#define UD_IMPL_USE_DESC 0x0004
#define UD_PART_DESC 0x0005
#define UD_LOG_VOL_DESC 0x0006
#define UD_UNALL_SPA_DESC 0x0007
#define UD_TERM_DESC 0x0008
#define UD_LOG_VOL_INT 0x0009
#define UD_FILE_SET_DESC 0x0100
#define UD_FILE_ID_DESC 0x0101
#define UD_ALLOC_EXT_DESC 0x0102
#define UD_INDIRECT_ENT 0x0103
#define UD_TERMINAL_ENT 0x0104
#define UD_FILE_ENTRY 0x0105
#define UD_EXT_ATTR_HDR 0x0106
#define UD_UNALL_SPA_ENT 0x0107
#define UD_SPA_BMAP_DESC 0x0108
#define UD_PART_INT_DESC 0x0109
#define UD_EXT_FILE_ENT 0x010A
/*
* Character set's allowed in descriptor fields
* shall be specified
*/
struct charspec {
};
typedef struct charspec charspec_t;
#define CS_TYPE0 0x00
#define CS_TYPE1 0x01
#define CS_TYPE2 0x02
#define CS_TYPE3 0x03
#define CS_TYPE4 0x04
#define CS_TYPE5 0x05
#define CS_TYPE6 0x06
#define CS_TYPE7 0x07
#define CS_TYPE8 0x08
/*
* Entity Identification
*/
struct regid {
};
#define EI_FLAG_DIRTY 0x00
#define EI_FLAG_PROT 0x01
struct lb_addr {
/* uint32_t lba_number; 00 Logical Block Number */
/* uint8_t lba_prn[2]; 04 Partition Reference Number */
char lba_aaa[6];
};
#define lba_number(x)(((x)->lba_aaa[0]) | \
/*
* Extend Descriptor
*/
struct extent_ad {
};
typedef struct extent_ad extent_ad_t;
/*
* Short Allocation Descriptor
*/
struct short_ad {
};
typedef struct short_ad short_ad_t;
/*
* Long Allocation Descriptor
*/
struct long_ad {
/* lb_addr_t lad_ext_loc; 04 Extent Location */
};
/*
* Format to record date and time
* If zero date & time is not specified
*/
struct tstamp {
};
/*
* ts_tzone
*/
#define TMODE 0xF000
#define TSIGN 0x0800
#define TOFFSET 0x07FF
/*
* Format of the ICB tag which specifies
* most of the infomation of the file
*/
struct icb_tag {
/* lb_addr_t itag_lb_addr; 0C parent ICB Location */
};
/*
* Different strategy types for the file
* For DVD_ROM we use onlt type4
*/
#define STRAT_TYPE1 0x0001
#define STRAT_TYPE2 0x0002
#define STRAT_TYPE3 0x0003
#define STRAT_TYPE4 0x0004
#define STRAT_TYPE4096 0x1000
/*
* File types
*/
#define FTYPE_UNALL_SPACE 0x01
#define FTYPE_PART_INTEG 0x02
#define FTYPE_INDIRECT 0x03
#define FTYPE_DIRECTORY 0x04
#define FTYPE_FILE 0x05
#define FTYPE_BLOCK_DEV 0x06
#define FTYPE_CHAR_DEV 0x07
#define FTYPE_EAR 0x08
#define FTYPE_FIFO 0x09
#define FTYPE_C_ISSOCK 0x0A
#define FTYPE_T_ENTRY 0x0B
#define FTYPE_SYMLINK 0x0C
/*
* Flags
*/
#define ICB_FLAG_SHORT_AD 0x0000
#define ICB_FLAG_LONG_AD 0x0001
#define ICB_FLAG_EXT_AD 0x0002
#define ICB_FLAG_ONE_AD 0x0003
#define ICB_FLAG_SORTED 0x0008
#define ICB_FLAG_NON_RELOC 0x0010
#define ICB_FLAG_ARCHIVE 0x0020
#define ICB_FLAG_SETUID 0x0040
#define ICB_FLAG_SETGID 0x0080
#define ICB_FLAG_STICKY 0x0100
#define ICB_FLAG_CONTIG 0x0200
#define ICB_FLAG_SYSTEM 0x0400
#define ICB_FLAG_TRNSFRMED 0x0800
#define ICB_FLAG_MVERS 0x1000
/* Volume recognition descriptors */
/*
* Primary volume descriptor identifis the
* volume and certain attributes of the volume
*/
struct pri_vol_desc {
};
/*
* Anchor Volume Descriptor Pointer specifies
* the extent of Main & Reserve volume descriptor
*/
struct anch_vol_desc_ptr {
};
typedef struct anch_vol_desc_ptr anch_vol_desc_ptr_t;
/*
* Volume Descriptor Pointer
*/
struct vol_desc_ptr {
};
typedef struct vol_desc_ptr vol_desc_ptr_t;
/*
* Implementation Use Volume Descriptor
* This is taken from udf1.02/1.50 documents
* the fields after iuvd_ii are defined only
* for the udf domain
*/
struct iuvd_desc {
};
typedef struct iuvd_desc iuvd_desc_t;
/*
* Partition Descriptor
* specifies the size and location of the partition
*/
struct part_desc {
};
typedef struct part_desc part_desc_t;
/*
* pd_acc_type
*/
#define PART_ACC_RO 0x01
#define PART_ACC_WO 0x02
#define PART_ACC_RW 0x03
#define PART_ACC_OW 0x04
/*
* Partition Header Descriptor
* Overloads pd_pc_use
*/
struct phdr_desc {
};
typedef struct phdr_desc phdr_desc_t;
/*
* Logical Volume Descriptor
*/
struct log_vol_desc {
};
typedef struct log_vol_desc log_vol_desc_t;
/*
* Unallocated Space Descriptor
* Contains information about the space
* that does not belong to any of the
* partition
*/
struct unall_spc_desc {
};
typedef struct unall_spc_desc unall_spc_desc_t;
/*
* Terminating Descriptor
* this will be the last in a Volume Descriptor Sequence
*/
struct term_desc {
};
typedef struct term_desc term_desc_t;
/*
* Logical Volume Header Descriptor
* This will be overlaid on lvid_lvcu
* and will contain the maximum value of
* unique id on the media
*/
struct log_vol_hdr_desc {
};
typedef struct log_vol_hdr_desc log_vol_hdr_desc_t;
/*
* Logical Volume Integrity Sequence
* This will contain the integrity of the
* file system
*/
struct log_vol_int_desc {
/* uint8_t lvid_lvcu[32]; */
/* Size Table */
/* Implementation Use */
};
typedef struct log_vol_int_desc log_vol_int_desc_t;
#define LOG_VOL_OPEN_INT 0x00
#define LOG_VOL_CLOSE_INT 0x01
/*
* Logical Volume integrity Implementation Use
* This is defined in udf spec
*/
struct lvid_iu {
};
/*
* File Set Descriptor
* This will point to the root directory.
*/
struct file_set_desc {
};
typedef struct file_set_desc file_set_desc_t;
/*
* File Identifier Descriptor
* Directory entries
*/
struct file_id {
};
#define FID_EXIST 0x01
#define FID_DIR 0x02
#define FID_DELETED 0x04
#define FID_PARENT 0x08
/*
* Allocation Extent Descriptor
*/
struct alloc_ext_desc {
};
typedef struct alloc_ext_desc alloc_ext_desc_t;
/*
* Indirect Entry
* used to specify the address of another ICB
*/
struct indirect_entry {
};
typedef struct indirect_entry indirect_entry_t;
/*
* Terminal Entry
*/
struct term_entry {
};
typedef struct term_entry term_entry_t;
/*
* File entry describes the
* file attributes and location it is recorded on the media
*/
struct file_entry {
};
typedef struct file_entry file_entry_t;
/*
* Extended Attribute Header
*/
struct ext_attr_hdr {
};
typedef struct ext_attr_hdr ext_attr_hdr_t;
/*
* Unallocated Space Entry
*/
struct unall_space_ent {
};
typedef struct unall_space_ent unall_space_ent_t;
/*
* Space Bitmap Descriptor
*/
struct space_bmap_desc {
};
typedef struct space_bmap_desc space_bmap_desc_t;
/*
* Partition Integrity entry
*/
struct part_int_desc {
};
typedef struct part_int_desc part_int_desc_t;
#define PART_OPEN_INT 0x00
#define PART_CLOSE_INT 0x01
#define PART_STABLE_INT 0x02
struct attr_hdr {
};
/*
* We will support and use the
* following Extended Attributes
* we will ignore others while reading
* and will preserve then when updating
* the EAR's
* In all the EA's we allocate the last member
* as 4 bytes. This is a sort of hack
* since the structure has to be
* properly alined to 4 bytes.
*/
struct dev_spec_ear {
};
struct ftimes_ear {
};
/* ft_exit */
#define FT_EXIST 0x0
#define FT_DELETE 0x2
#define FT_FEDT 0x3
#define FT_BACKUP 0x5
struct iu_ea {
};
/*
* CGMS & FREE_SPACE will be
* over laid on iu_iu field
*/
struct copy_mgt_info {
};
#define COPY_PROTECTED 0x80
struct FREE_SPACE {
};
struct nsr_desc {
};
/*
* Partition Map
*/
struct pmap_hdr {
};
#define MAP_TYPE1 1
#define MAP_TYPE2 2
#define MAP_TYPE1_LEN 6
#define MAP_TYPE2_LEN 64
struct pmap_typ1 {
};
/*
* Only two types of type2 maps
* are supported they are
* *UDF Virtual Partition
* *UDF Sparable Partition
* For vpm fields till map2_pn
* are valid and the entire structure is
* valid for spm
*/
struct pmap_typ2 {
};
struct stbl_entry {
};
typedef struct stbl_entry stbl_entry_t;
struct stbl {
};
struct path_comp {
};
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FS_UDF_VOLUME_H */