diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-01 23:54:48 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-03 21:45:46 +0200 |
commit | affbcaf1deab75cf83e95512ff539d73474909e2 (patch) | |
tree | 60a0f173b0fb8b5c5c86c4d097790cb99f1da762 /include | |
parent | 31d327c3780aecdb78304263f676ff89a8ea93d1 (diff) |
Add function to read generic inode from meta data reader
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r-- | include/meta_reader.h | 5 | ||||
-rw-r--r-- | include/squashfs.h | 33 |
2 files changed, 31 insertions, 7 deletions
diff --git a/include/meta_reader.h b/include/meta_reader.h index 4c03996..d7ab732 100644 --- a/include/meta_reader.h +++ b/include/meta_reader.h @@ -23,4 +23,9 @@ int meta_reader_seek(meta_reader_t *m, uint64_t block_start, int meta_reader_read(meta_reader_t *m, void *data, size_t size); +sqfs_inode_generic_t *meta_reader_read_inode(meta_reader_t *ir, + sqfs_super_t *super, + uint64_t block_start, + size_t offset); + #endif /* META_READER_H */ diff --git a/include/squashfs.h b/include/squashfs.h index a690aad..eaa5a6e 100644 --- a/include/squashfs.h +++ b/include/squashfs.h @@ -57,26 +57,38 @@ typedef struct { typedef struct { uint32_t nlink; + uint32_t devno; + uint32_t xattr_idx; +} sqfs_inode_dev_ext_t; + +typedef struct { + uint32_t nlink; } sqfs_inode_ipc_t; typedef struct { uint32_t nlink; - uint32_t devno; uint32_t xattr_idx; -} sqfs_inode_dev_ext_t; +} sqfs_inode_ipc_ext_t; typedef struct { uint32_t nlink; uint32_t target_size; - uint8_t target[]; + /*uint8_t target[];*/ } sqfs_inode_slink_t; typedef struct { + uint32_t nlink; + uint32_t target_size; + /*uint8_t target[];*/ + uint32_t xattr_idx; +} sqfs_inode_slink_ext_t; + +typedef struct { uint32_t blocks_start; uint32_t fragment_index; uint32_t fragment_offset; uint32_t file_size; - uint32_t block_sizes[]; + /*uint32_t block_sizes[];*/ } sqfs_inode_file_t; typedef struct { @@ -87,7 +99,7 @@ typedef struct { uint32_t fragment_idx; uint32_t fragment_offset; uint32_t xattr_idx; - uint32_t block_sizes[]; + /*uint32_t block_sizes[];*/ } sqfs_inode_file_ext_t; typedef struct { @@ -108,18 +120,25 @@ typedef struct { uint32_t xattr_idx; } sqfs_inode_dir_ext_t; -typedef union { - sqfs_inode_t inode; +typedef struct { + sqfs_inode_t base; + char *slink_target; + uint32_t *block_sizes; union { sqfs_inode_dev_t dev; sqfs_inode_dev_ext_t dev_ext; + sqfs_inode_ipc_t ipc; + sqfs_inode_ipc_ext_t ipc_ext; sqfs_inode_slink_t slink; + sqfs_inode_slink_ext_t slink_ext; sqfs_inode_file_t file; sqfs_inode_file_ext_t file_ext; sqfs_inode_dir_t dir; sqfs_inode_dir_ext_t dir_ext; } data; + + uint8_t extra[]; } sqfs_inode_generic_t; typedef struct { |