1 /* 2 * The volume superblock functions 3 * 4 * Copyright (C) 2018-2021, Joachim Metz <joachim.metz@gmail.com> 5 * 6 * Refer to AUTHORS for acknowledgements. 7 * 8 * This program is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU Lesser General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License 19 * along with this program. If not, see <https://www.gnu.org/licenses/>. 20 */ 21 22 #if !defined( _LIBFSAPFS_VOLUME_SUPERBLOCK_H ) 23 #define _LIBFSAPFS_VOLUME_SUPERBLOCK_H 24 25 #include <common.h> 26 #include <types.h> 27 28 #include "libfsapfs_libbfio.h" 29 #include "libfsapfs_libcerror.h" 30 31 #if defined( __cplusplus ) 32 extern "C" { 33 #endif 34 35 typedef struct libfsapfs_volume_superblock libfsapfs_volume_superblock_t; 36 37 struct libfsapfs_volume_superblock 38 { 39 /* The compatible features flags 40 */ 41 uint64_t compatible_features_flags; 42 43 /* The read-only compatible features flags 44 */ 45 uint64_t read_only_compatible_features_flags; 46 47 /* The incompatible features flags 48 */ 49 uint64_t incompatible_features_flags; 50 51 /* The object map block number 52 */ 53 uint64_t object_map_block_number; 54 55 /* The file system root object identifier 56 */ 57 uint64_t file_system_root_object_identifier; 58 59 /* The extent-reference tree block number 60 */ 61 uint64_t extent_reference_tree_block_number; 62 63 /* The snapshot metadata tree block number 64 */ 65 uint64_t snapshot_metadata_tree_block_number; 66 67 /* The next file system object identifier 68 */ 69 uint64_t next_file_system_object_identifier; 70 71 /* The volume identifier 72 */ 73 uint8_t volume_identifier[ 16 ]; 74 75 /* The volume flags 76 */ 77 uint64_t volume_flags; 78 79 /* The volume name 80 */ 81 uint8_t volume_name[ 256 ]; 82 }; 83 84 int libfsapfs_volume_superblock_initialize( 85 libfsapfs_volume_superblock_t **volume_superblock, 86 libcerror_error_t **error ); 87 88 int libfsapfs_volume_superblock_free( 89 libfsapfs_volume_superblock_t **volume_superblock, 90 libcerror_error_t **error ); 91 92 int libfsapfs_volume_superblock_read_file_io_handle( 93 libfsapfs_volume_superblock_t *volume_superblock, 94 libbfio_handle_t *file_io_handle, 95 off64_t file_offset, 96 libcerror_error_t **error ); 97 98 int libfsapfs_volume_superblock_read_data( 99 libfsapfs_volume_superblock_t *volume_superblock, 100 const uint8_t *data, 101 size_t data_size, 102 libcerror_error_t **error ); 103 104 int libfsapfs_volume_superblock_get_volume_identifier( 105 libfsapfs_volume_superblock_t *volume_superblock, 106 uint8_t *uuid_data, 107 size_t uuid_data_size, 108 libcerror_error_t **error ); 109 110 int libfsapfs_volume_superblock_get_utf8_volume_name_size( 111 libfsapfs_volume_superblock_t *volume_superblock, 112 size_t *utf8_string_size, 113 libcerror_error_t **error ); 114 115 int libfsapfs_volume_superblock_get_utf8_volume_name( 116 libfsapfs_volume_superblock_t *volume_superblock, 117 uint8_t *utf8_string, 118 size_t utf8_string_size, 119 libcerror_error_t **error ); 120 121 int libfsapfs_volume_superblock_get_utf16_volume_name_size( 122 libfsapfs_volume_superblock_t *volume_superblock, 123 size_t *utf16_string_size, 124 libcerror_error_t **error ); 125 126 int libfsapfs_volume_superblock_get_utf16_volume_name( 127 libfsapfs_volume_superblock_t *volume_superblock, 128 uint16_t *utf16_string, 129 size_t utf16_string_size, 130 libcerror_error_t **error ); 131 132 #if defined( __cplusplus ) 133 } 134 #endif 135 136 #endif /* !defined( _LIBFSAPFS_VOLUME_SUPERBLOCK_H ) */ 137 138