^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * ecma_167.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * This file is based on ECMA-167 3rd edition (June 1997)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * https://www.ecma.ch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (c) 2001-2002 Ben Fennema
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright (c) 2017-2019 Pali Rohár <pali@kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * Redistribution and use in source and binary forms, with or without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * modification, are permitted provided that the following conditions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * are met:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * 1. Redistributions of source code must retain the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * notice, this list of conditions, and the following disclaimer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * without modification.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * 2. The name of the author may not be used to endorse or promote products
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * derived from this software without specific prior written permission.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * Alternatively, this software may be distributed under the terms of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * GNU Public License ("GPL").
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * SUCH DAMAGE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * @file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * ECMA-167r3 defines and structure definitions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #ifndef _ECMA_167_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #define _ECMA_167_H 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) /* Character sets and coding - d-characters (ECMA 167r3 1/7.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) typedef uint8_t dchars;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) /* Character set specification (ECMA 167r3 1/7.2.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct charspec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) uint8_t charSetType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) uint8_t charSetInfo[63];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) /* Character Set Type (ECMA 167r3 1/7.2.1.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define CHARSPEC_TYPE_CS0 0x00 /* (1/7.2.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define CHARSPEC_TYPE_CS1 0x01 /* (1/7.2.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define CHARSPEC_TYPE_CS2 0x02 /* (1/7.2.4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define CHARSPEC_TYPE_CS3 0x03 /* (1/7.2.5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define CHARSPEC_TYPE_CS4 0x04 /* (1/7.2.6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define CHARSPEC_TYPE_CS5 0x05 /* (1/7.2.7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define CHARSPEC_TYPE_CS6 0x06 /* (1/7.2.8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #define CHARSPEC_TYPE_CS7 0x07 /* (1/7.2.9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define CHARSPEC_TYPE_CS8 0x08 /* (1/7.2.10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) /* Fixed-length character fields - d-string (EMCA 167r3 1/7.2.12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) typedef uint8_t dstring;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) /* Timestamp (ECMA 167r3 1/7.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) struct timestamp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) __le16 typeAndTimezone;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) __le16 year;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) uint8_t month;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) uint8_t day;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) uint8_t hour;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) uint8_t minute;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) uint8_t second;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) uint8_t centiseconds;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) uint8_t hundredsOfMicroseconds;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) uint8_t microseconds;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) /* Type and Time Zone (ECMA 167r3 1/7.3.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) #define TIMESTAMP_TYPE_MASK 0xF000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) #define TIMESTAMP_TYPE_CUT 0x0000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) #define TIMESTAMP_TYPE_LOCAL 0x1000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) #define TIMESTAMP_TYPE_AGREEMENT 0x2000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #define TIMESTAMP_TIMEZONE_MASK 0x0FFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) /* Entity identifier (ECMA 167r3 1/7.4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) struct regid {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) uint8_t flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) uint8_t ident[23];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) uint8_t identSuffix[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) /* Flags (ECMA 167r3 1/7.4.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) #define ENTITYID_FLAGS_DIRTY 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) #define ENTITYID_FLAGS_PROTECTED 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) /* Volume Structure Descriptor (ECMA 167r3 2/9.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define VSD_STD_ID_LEN 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) struct volStructDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) uint8_t structType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) uint8_t stdIdent[VSD_STD_ID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) uint8_t structVersion;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) uint8_t structData[2041];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) /* Standard Identifier (EMCA 167r2 2/9.1.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #define VSD_STD_ID_NSR02 "NSR02" /* (3/9.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) /* Standard Identifier (ECMA 167r3 2/9.1.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) #define VSD_STD_ID_BEA01 "BEA01" /* (2/9.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) #define VSD_STD_ID_BOOT2 "BOOT2" /* (2/9.4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #define VSD_STD_ID_CD001 "CD001" /* (ECMA-119) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) #define VSD_STD_ID_CDW02 "CDW02" /* (ECMA-168) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) #define VSD_STD_ID_NSR03 "NSR03" /* (3/9.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) #define VSD_STD_ID_TEA01 "TEA01" /* (2/9.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) /* Beginning Extended Area Descriptor (ECMA 167r3 2/9.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) struct beginningExtendedAreaDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) uint8_t structType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) uint8_t stdIdent[VSD_STD_ID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) uint8_t structVersion;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) uint8_t structData[2041];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) /* Terminating Extended Area Descriptor (ECMA 167r3 2/9.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) struct terminatingExtendedAreaDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) uint8_t structType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) uint8_t stdIdent[VSD_STD_ID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) uint8_t structVersion;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) uint8_t structData[2041];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) /* Boot Descriptor (ECMA 167r3 2/9.4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) struct bootDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) uint8_t structType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) uint8_t stdIdent[VSD_STD_ID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) uint8_t structVersion;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) uint8_t reserved1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) struct regid archType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) struct regid bootIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) __le32 bootExtLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) __le32 bootExtLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) __le64 loadAddress;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) __le64 startAddress;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) struct timestamp descCreationDateAndTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) __le16 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) uint8_t reserved2[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) uint8_t bootUse[1906];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) /* Flags (ECMA 167r3 2/9.4.12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) #define BOOT_FLAGS_ERASE 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) /* Extent Descriptor (ECMA 167r3 3/7.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) struct extent_ad {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) __le32 extLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) __le32 extLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) struct kernel_extent_ad {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) uint32_t extLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) uint32_t extLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) /* Descriptor Tag (ECMA 167r3 3/7.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) struct tag {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) __le16 tagIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) __le16 descVersion;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) uint8_t tagChecksum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) uint8_t reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) __le16 tagSerialNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) __le16 descCRC;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) __le16 descCRCLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) __le32 tagLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) /* Tag Identifier (ECMA 167r3 3/7.2.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) #define TAG_IDENT_PVD 0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) #define TAG_IDENT_AVDP 0x0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) #define TAG_IDENT_VDP 0x0003
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) #define TAG_IDENT_IUVD 0x0004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) #define TAG_IDENT_PD 0x0005
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #define TAG_IDENT_LVD 0x0006
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) #define TAG_IDENT_USD 0x0007
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) #define TAG_IDENT_TD 0x0008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #define TAG_IDENT_LVID 0x0009
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) /* NSR Descriptor (ECMA 167r3 3/9.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) struct NSRDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) uint8_t structType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) uint8_t stdIdent[VSD_STD_ID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) uint8_t structVersion;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) uint8_t reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) uint8_t structData[2040];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) /* Generic Descriptor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) struct genericDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) __le32 volDescSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) uint8_t reserved[492];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) /* Primary Volume Descriptor (ECMA 167r3 3/10.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) struct primaryVolDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) __le32 volDescSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) __le32 primaryVolDescNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) dstring volIdent[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) __le16 volSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) __le16 maxVolSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) __le16 interchangeLvl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) __le16 maxInterchangeLvl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) __le32 charSetList;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) __le32 maxCharSetList;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) dstring volSetIdent[128];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) struct charspec descCharSet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) struct charspec explanatoryCharSet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) struct extent_ad volAbstract;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) struct extent_ad volCopyright;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) struct regid appIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) struct timestamp recordingDateAndTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) struct regid impIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) uint8_t impUse[64];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) __le32 predecessorVolDescSeqLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) __le16 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) uint8_t reserved[22];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) /* Flags (ECMA 167r3 3/10.1.21) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) #define PVD_FLAGS_VSID_COMMON 0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) /* Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) struct anchorVolDescPtr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) struct extent_ad mainVolDescSeqExt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) struct extent_ad reserveVolDescSeqExt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) uint8_t reserved[480];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) /* Volume Descriptor Pointer (ECMA 167r3 3/10.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) struct volDescPtr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) __le32 volDescSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) struct extent_ad nextVolDescSeqExt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) uint8_t reserved[484];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) /* Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) struct impUseVolDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) __le32 volDescSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) struct regid impIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) uint8_t impUse[460];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) /* Partition Descriptor (ECMA 167r3 3/10.5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) struct partitionDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) __le32 volDescSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) __le16 partitionFlags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) __le16 partitionNumber;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) struct regid partitionContents;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) uint8_t partitionContentsUse[128];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) __le32 accessType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) __le32 partitionStartingLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) __le32 partitionLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) struct regid impIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) uint8_t impUse[128];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) uint8_t reserved[156];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) /* Partition Flags (ECMA 167r3 3/10.5.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) #define PD_PARTITION_FLAGS_ALLOC 0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) /* Partition Contents (ECMA 167r2 3/10.5.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) #define PD_PARTITION_CONTENTS_NSR02 "+NSR02"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) /* Partition Contents (ECMA 167r3 3/10.5.5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) #define PD_PARTITION_CONTENTS_FDC01 "+FDC01"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) #define PD_PARTITION_CONTENTS_CD001 "+CD001"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) #define PD_PARTITION_CONTENTS_CDW02 "+CDW02"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) #define PD_PARTITION_CONTENTS_NSR03 "+NSR03"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) /* Access Type (ECMA 167r3 3/10.5.7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) #define PD_ACCESS_TYPE_NONE 0x00000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) #define PD_ACCESS_TYPE_READ_ONLY 0x00000001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) #define PD_ACCESS_TYPE_WRITE_ONCE 0x00000002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) #define PD_ACCESS_TYPE_REWRITABLE 0x00000003
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) #define PD_ACCESS_TYPE_OVERWRITABLE 0x00000004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) /* Logical Volume Descriptor (ECMA 167r3 3/10.6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) struct logicalVolDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) __le32 volDescSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) struct charspec descCharSet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) dstring logicalVolIdent[128];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) __le32 logicalBlockSize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) struct regid domainIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) uint8_t logicalVolContentsUse[16];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) __le32 mapTableLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) __le32 numPartitionMaps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) struct regid impIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) uint8_t impUse[128];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) struct extent_ad integritySeqExt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) uint8_t partitionMaps[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) /* Generic Partition Map (ECMA 167r3 3/10.7.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) struct genericPartitionMap {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) uint8_t partitionMapType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) uint8_t partitionMapLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) uint8_t partitionMapping[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) /* Partition Map Type (ECMA 167r3 3/10.7.1.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) #define GP_PARTITION_MAP_TYPE_UNDEF 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) #define GP_PARTITION_MAP_TYPE_1 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) #define GP_PARTITION_MAP_TYPE_2 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) /* Type 1 Partition Map (ECMA 167r3 3/10.7.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) struct genericPartitionMap1 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) uint8_t partitionMapType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) uint8_t partitionMapLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) __le16 volSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) __le16 partitionNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) /* Type 2 Partition Map (ECMA 167r3 3/10.7.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) struct genericPartitionMap2 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) uint8_t partitionMapType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) uint8_t partitionMapLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) uint8_t partitionIdent[62];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) /* Unallocated Space Descriptor (ECMA 167r3 3/10.8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) struct unallocSpaceDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) __le32 volDescSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) __le32 numAllocDescs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) struct extent_ad allocDescs[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) /* Terminating Descriptor (ECMA 167r3 3/10.9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) struct terminatingDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) uint8_t reserved[496];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) /* Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) struct logicalVolIntegrityDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) struct timestamp recordingDateAndTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) __le32 integrityType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) struct extent_ad nextIntegrityExt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) uint8_t logicalVolContentsUse[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) __le32 numOfPartitions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) __le32 lengthOfImpUse;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) __le32 freeSpaceTable[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) __le32 sizeTable[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) uint8_t impUse[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) /* Integrity Type (ECMA 167r3 3/10.10.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) #define LVID_INTEGRITY_TYPE_OPEN 0x00000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) #define LVID_INTEGRITY_TYPE_CLOSE 0x00000001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) /* Recorded Address (ECMA 167r3 4/7.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) struct lb_addr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) __le32 logicalBlockNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) __le16 partitionReferenceNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) /* ... and its in-core analog */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) struct kernel_lb_addr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) uint32_t logicalBlockNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) uint16_t partitionReferenceNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) struct short_ad {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) __le32 extLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) __le32 extPosition;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) struct long_ad {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) __le32 extLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) struct lb_addr extLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) uint8_t impUse[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) struct kernel_long_ad {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) uint32_t extLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) struct kernel_lb_addr extLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) uint8_t impUse[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) /* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) struct ext_ad {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) __le32 extLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) __le32 recordedLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) __le32 informationLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) struct lb_addr extLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) struct kernel_ext_ad {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) uint32_t extLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) uint32_t recordedLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) uint32_t informationLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) struct kernel_lb_addr extLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) /* Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) /* Tag Identifier (ECMA 167r3 4/7.2.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) #define TAG_IDENT_FSD 0x0100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) #define TAG_IDENT_FID 0x0101
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) #define TAG_IDENT_AED 0x0102
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) #define TAG_IDENT_IE 0x0103
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) #define TAG_IDENT_TE 0x0104
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) #define TAG_IDENT_FE 0x0105
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) #define TAG_IDENT_EAHD 0x0106
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) #define TAG_IDENT_USE 0x0107
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) #define TAG_IDENT_SBD 0x0108
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) #define TAG_IDENT_PIE 0x0109
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) #define TAG_IDENT_EFE 0x010A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) /* File Set Descriptor (ECMA 167r3 4/14.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) struct fileSetDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) struct timestamp recordingDateAndTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) __le16 interchangeLvl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) __le16 maxInterchangeLvl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) __le32 charSetList;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) __le32 maxCharSetList;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) __le32 fileSetNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) __le32 fileSetDescNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) struct charspec logicalVolIdentCharSet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) dstring logicalVolIdent[128];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) struct charspec fileSetCharSet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) dstring fileSetIdent[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) dstring copyrightFileIdent[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) dstring abstractFileIdent[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) struct long_ad rootDirectoryICB;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) struct regid domainIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) struct long_ad nextExt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) struct long_ad streamDirectoryICB;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) uint8_t reserved[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) /* Partition Header Descriptor (ECMA 167r3 4/14.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) struct partitionHeaderDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) struct short_ad unallocSpaceTable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) struct short_ad unallocSpaceBitmap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) struct short_ad partitionIntegrityTable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) struct short_ad freedSpaceTable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) struct short_ad freedSpaceBitmap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) uint8_t reserved[88];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) /* File Identifier Descriptor (ECMA 167r3 4/14.4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) struct fileIdentDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) __le16 fileVersionNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) uint8_t fileCharacteristics;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) uint8_t lengthFileIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) struct long_ad icb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) __le16 lengthOfImpUse;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) uint8_t impUse[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) uint8_t fileIdent[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) uint8_t padding[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) /* File Characteristics (ECMA 167r3 4/14.4.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) #define FID_FILE_CHAR_HIDDEN 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) #define FID_FILE_CHAR_DIRECTORY 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) #define FID_FILE_CHAR_DELETED 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) #define FID_FILE_CHAR_PARENT 0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) #define FID_FILE_CHAR_METADATA 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) /* Allocation Ext Descriptor (ECMA 167r3 4/14.5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) struct allocExtDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) __le32 previousAllocExtLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) __le32 lengthAllocDescs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) /* ICB Tag (ECMA 167r3 4/14.6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) struct icbtag {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) __le32 priorRecordedNumDirectEntries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) __le16 strategyType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) __le16 strategyParameter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) __le16 numEntries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) uint8_t reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) uint8_t fileType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) struct lb_addr parentICBLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) __le16 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) /* Strategy Type (ECMA 167r3 4/14.6.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) #define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) #define ICBTAG_STRATEGY_TYPE_1 0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) #define ICBTAG_STRATEGY_TYPE_2 0x0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) #define ICBTAG_STRATEGY_TYPE_3 0x0003
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) #define ICBTAG_STRATEGY_TYPE_4 0x0004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) /* File Type (ECMA 167r3 4/14.6.6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) #define ICBTAG_FILE_TYPE_UNDEF 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) #define ICBTAG_FILE_TYPE_USE 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) #define ICBTAG_FILE_TYPE_PIE 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) #define ICBTAG_FILE_TYPE_IE 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) #define ICBTAG_FILE_TYPE_DIRECTORY 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) #define ICBTAG_FILE_TYPE_REGULAR 0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) #define ICBTAG_FILE_TYPE_BLOCK 0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) #define ICBTAG_FILE_TYPE_CHAR 0x07
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) #define ICBTAG_FILE_TYPE_EA 0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) #define ICBTAG_FILE_TYPE_FIFO 0x09
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) #define ICBTAG_FILE_TYPE_SOCKET 0x0A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) #define ICBTAG_FILE_TYPE_TE 0x0B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) #define ICBTAG_FILE_TYPE_SYMLINK 0x0C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) #define ICBTAG_FILE_TYPE_STREAMDIR 0x0D
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) /* Flags (ECMA 167r3 4/14.6.8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) #define ICBTAG_FLAG_AD_MASK 0x0007
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) #define ICBTAG_FLAG_AD_SHORT 0x0000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) #define ICBTAG_FLAG_AD_LONG 0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) #define ICBTAG_FLAG_AD_EXTENDED 0x0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) #define ICBTAG_FLAG_AD_IN_ICB 0x0003
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) #define ICBTAG_FLAG_SORTED 0x0008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) #define ICBTAG_FLAG_NONRELOCATABLE 0x0010
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) #define ICBTAG_FLAG_ARCHIVE 0x0020
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) #define ICBTAG_FLAG_SETUID 0x0040
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) #define ICBTAG_FLAG_SETGID 0x0080
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) #define ICBTAG_FLAG_STICKY 0x0100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) #define ICBTAG_FLAG_CONTIGUOUS 0x0200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) #define ICBTAG_FLAG_SYSTEM 0x0400
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) #define ICBTAG_FLAG_TRANSFORMED 0x0800
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) #define ICBTAG_FLAG_MULTIVERSIONS 0x1000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) #define ICBTAG_FLAG_STREAM 0x2000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) /* Indirect Entry (ECMA 167r3 4/14.7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) struct indirectEntry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) struct icbtag icbTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) struct long_ad indirectICB;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) /* Terminal Entry (ECMA 167r3 4/14.8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) struct terminalEntry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) struct icbtag icbTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) /* File Entry (ECMA 167r3 4/14.9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) struct fileEntry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) struct icbtag icbTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) __le32 uid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) __le32 gid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) __le32 permissions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) __le16 fileLinkCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) uint8_t recordFormat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) uint8_t recordDisplayAttr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) __le32 recordLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) __le64 informationLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) __le64 logicalBlocksRecorded;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) struct timestamp accessTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) struct timestamp modificationTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) struct timestamp attrTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) __le32 checkpoint;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) struct long_ad extendedAttrICB;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) struct regid impIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) __le64 uniqueID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) __le32 lengthExtendedAttr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) __le32 lengthAllocDescs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) uint8_t extendedAttr[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) uint8_t allocDescs[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) /* Permissions (ECMA 167r3 4/14.9.5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) #define FE_PERM_O_EXEC 0x00000001U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) #define FE_PERM_O_WRITE 0x00000002U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) #define FE_PERM_O_READ 0x00000004U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) #define FE_PERM_O_CHATTR 0x00000008U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) #define FE_PERM_O_DELETE 0x00000010U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) #define FE_PERM_G_EXEC 0x00000020U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) #define FE_PERM_G_WRITE 0x00000040U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) #define FE_PERM_G_READ 0x00000080U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) #define FE_PERM_G_CHATTR 0x00000100U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) #define FE_PERM_G_DELETE 0x00000200U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) #define FE_PERM_U_EXEC 0x00000400U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) #define FE_PERM_U_WRITE 0x00000800U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) #define FE_PERM_U_READ 0x00001000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) #define FE_PERM_U_CHATTR 0x00002000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) #define FE_PERM_U_DELETE 0x00004000U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) /* Record Format (ECMA 167r3 4/14.9.7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) #define FE_RECORD_FMT_UNDEF 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) #define FE_RECORD_FMT_FIXED_PAD 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) #define FE_RECORD_FMT_FIXED 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) #define FE_RECORD_FMT_VARIABLE8 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) #define FE_RECORD_FMT_VARIABLE16 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) #define FE_RECORD_FMT_VARIABLE16_MSB 0x05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) #define FE_RECORD_FMT_VARIABLE32 0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) #define FE_RECORD_FMT_PRINT 0x07
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) #define FE_RECORD_FMT_LF 0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) #define FE_RECORD_FMT_CR 0x09
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) #define FE_RECORD_FMT_CRLF 0x0A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) #define FE_RECORD_FMT_LFCR 0x0B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) /* Record Display Attributes (ECMA 167r3 4/14.9.8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) #define FE_RECORD_DISPLAY_ATTR_UNDEF 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) #define FE_RECORD_DISPLAY_ATTR_1 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) #define FE_RECORD_DISPLAY_ATTR_2 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) #define FE_RECORD_DISPLAY_ATTR_3 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) /* Extended Attribute Header Descriptor (ECMA 167r3 4/14.10.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) struct extendedAttrHeaderDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) __le32 impAttrLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) __le32 appAttrLocation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) /* Generic Format (ECMA 167r3 4/14.10.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) struct genericFormat {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) __le32 attrType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) uint8_t attrSubtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) uint8_t reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) __le32 attrLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) uint8_t attrData[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) /* Character Set Information (ECMA 167r3 4/14.10.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) struct charSetInfo {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) __le32 attrType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) uint8_t attrSubtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) uint8_t reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) __le32 attrLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) __le32 escapeSeqLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) uint8_t charSetType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) uint8_t escapeSeq[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) /* Alternate Permissions (ECMA 167r3 4/14.10.4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) struct altPerms {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) __le32 attrType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) uint8_t attrSubtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) uint8_t reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) __le32 attrLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) __le16 ownerIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) __le16 groupIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) __le16 permission;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) /* File Times Extended Attribute (ECMA 167r3 4/14.10.5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) struct fileTimesExtAttr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) __le32 attrType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) uint8_t attrSubtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) uint8_t reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) __le32 attrLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) __le32 dataLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) __le32 fileTimeExistence;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) uint8_t fileTimes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) /* FileTimeExistence (ECMA 167r3 4/14.10.5.6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) #define FTE_CREATION 0x00000001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) #define FTE_DELETION 0x00000004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) #define FTE_EFFECTIVE 0x00000008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) #define FTE_BACKUP 0x00000002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) /* Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) struct infoTimesExtAttr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) __le32 attrType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) uint8_t attrSubtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) uint8_t reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682) __le32 attrLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) __le32 dataLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) __le32 infoTimeExistence;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) uint8_t infoTimes[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) /* Device Specification (ECMA 167r3 4/14.10.7) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) struct deviceSpec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) __le32 attrType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) uint8_t attrSubtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) uint8_t reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693) __le32 attrLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) __le32 impUseLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) __le32 majorDeviceIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) __le32 minorDeviceIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) uint8_t impUse[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700) /* Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) struct impUseExtAttr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) __le32 attrType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) uint8_t attrSubtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) uint8_t reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) __le32 attrLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) __le32 impUseLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) struct regid impIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) uint8_t impUse[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) /* Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) struct appUseExtAttr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) __le32 attrType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714) uint8_t attrSubtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715) uint8_t reserved[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) __le32 attrLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) __le32 appUseLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718) struct regid appIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) uint8_t appUse[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) #define EXTATTR_CHAR_SET 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) #define EXTATTR_ALT_PERMS 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) #define EXTATTR_FILE_TIMES 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) #define EXTATTR_INFO_TIMES 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726) #define EXTATTR_DEV_SPEC 12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) #define EXTATTR_IMP_USE 2048
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) #define EXTATTR_APP_USE 65536
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729) #define EXTATTR_SUBTYPE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) /* Unallocated Space Entry (ECMA 167r3 4/14.11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732) struct unallocSpaceEntry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734) struct icbtag icbTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) __le32 lengthAllocDescs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) uint8_t allocDescs[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) /* Space Bitmap Descriptor (ECMA 167r3 4/14.12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) struct spaceBitmapDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) __le32 numOfBits;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) __le32 numOfBytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) uint8_t bitmap[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) /* Partition Integrity Entry (ECMA 167r3 4/14.13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748) struct partitionIntegrityEntry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) struct icbtag icbTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) struct timestamp recordingDateAndTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) uint8_t integrityType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753) uint8_t reserved[175];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) struct regid impIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) uint8_t impUse[256];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) /* Extent Length (ECMA 167r3 4/14.14.1.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) #define EXT_LENGTH_MASK 0x3FFFFFFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762) #define EXT_TYPE_MASK 0xC0000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) #define EXT_RECORDED_ALLOCATED 0x00000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764) #define EXT_NOT_RECORDED_ALLOCATED 0x40000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) #define EXT_NOT_RECORDED_NOT_ALLOCATED 0x80000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766) #define EXT_NEXT_EXTENT_ALLOCDESCS 0xC0000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) /* Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) /* Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) struct logicalVolHeaderDesc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774) __le64 uniqueID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775) uint8_t reserved[24];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) /* Path Component (ECMA 167r3 4/14.16.1) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) struct pathComponent {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) uint8_t componentType;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781) uint8_t lengthComponentIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782) __le16 componentFileVersionNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) dchars componentIdent[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) /* File Entry (ECMA 167r3 4/14.17) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787) struct extendedFileEntry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788) struct tag descTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) struct icbtag icbTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790) __le32 uid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791) __le32 gid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792) __le32 permissions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793) __le16 fileLinkCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794) uint8_t recordFormat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) uint8_t recordDisplayAttr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796) __le32 recordLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) __le64 informationLength;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) __le64 objectSize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799) __le64 logicalBlocksRecorded;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) struct timestamp accessTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801) struct timestamp modificationTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802) struct timestamp createTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) struct timestamp attrTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) __le32 checkpoint;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) __le32 reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806) struct long_ad extendedAttrICB;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807) struct long_ad streamDirectoryICB;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808) struct regid impIdent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809) __le64 uniqueID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810) __le32 lengthExtendedAttr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811) __le32 lengthAllocDescs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812) uint8_t extendedAttr[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813) uint8_t allocDescs[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816) #endif /* _ECMA_167_H */