SquashFS compressed filesystem reader in pure OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add c/ directories with EverParse 3D generation for 15 Wire packages

Creates c/gen.ml + c/dune + generated .3d files for every package
that defines Wire codecs. Each gen.ml calls Wire_3d.main to project
the OCaml Wire codec definition to EverParse 3D format.

Packages: FSR, PUS, GPT, MBR, PID1, LTP, TCPCL (8 codecs), UDPCL,
AX.25, CFDP (3 fixed-size codecs), SDLS (EP header + MC status),
SpaceWire, RPMsg, SquashFS (5 codecs), SpaceFibre.

Codecs with Wire.Param.input (variable-size) are excluded from 3D
generation: CFDP header/eof/metadata/keep-alive, SDLS security
header/trailer, PUS tm_header/hk_param.

Proximity-1 and space-wire excluded: proximity-1 has only variable-
size codecs, space-wire has its own C generation approach.

Fixes E900 (17→2) and E905 (remaining MBR Partition.struct_).

+163
+13
c/SquashfsExtDeviceBody.3d
··· 1 + extern typedef struct _WireCtx WireCtx 2 + 3 + extern unit WireSetU32(mutable WireCtx *ctx, UINT32 idx, UINT32 v) 4 + 5 + entrypoint 6 + typedef struct _SquashfsExtDeviceBody(mutable WireCtx *ctx) 7 + { 8 + UINT32 nlink {:on-success WireSetU32(ctx, (UINT32) 0, nlink); return true; }; 9 + UINT32 rdev {:on-success WireSetU32(ctx, (UINT32) 1, rdev); return true; }; 10 + UINT32 xattr_id {:on-success WireSetU32(ctx, (UINT32) 2, xattr_id); return true; }; 11 + } SquashfsExtDeviceBody; 12 + 13 +
+19
c/SquashfsExtDirBody.3d
··· 1 + extern typedef struct _WireCtx WireCtx 2 + 3 + extern unit WireSetU32(mutable WireCtx *ctx, UINT32 idx, UINT32 v) 4 + 5 + extern unit WireSetU16(mutable WireCtx *ctx, UINT32 idx, UINT16 v) 6 + 7 + entrypoint 8 + typedef struct _SquashfsExtDirBody(mutable WireCtx *ctx) 9 + { 10 + UINT32 nlink {:on-success WireSetU32(ctx, (UINT32) 0, nlink); return true; }; 11 + UINT32 file_size {:on-success WireSetU32(ctx, (UINT32) 1, file_size); return true; }; 12 + UINT32 start_block {:on-success WireSetU32(ctx, (UINT32) 2, start_block); return true; }; 13 + UINT32 parent_inode {:on-success WireSetU32(ctx, (UINT32) 3, parent_inode); return true; }; 14 + UINT16 inodex_count {:on-success WireSetU16(ctx, (UINT32) 4, inodex_count); return true; }; 15 + UINT16 offset {:on-success WireSetU16(ctx, (UINT32) 5, offset); return true; }; 16 + UINT32 xattr_id {:on-success WireSetU32(ctx, (UINT32) 6, xattr_id); return true; }; 17 + } SquashfsExtDirBody; 18 + 19 +
+19
c/SquashfsExtFileBody.3d
··· 1 + extern typedef struct _WireCtx WireCtx 2 + 3 + extern unit WireSetU64(mutable WireCtx *ctx, UINT32 idx, UINT64 v) 4 + 5 + extern unit WireSetU32(mutable WireCtx *ctx, UINT32 idx, UINT32 v) 6 + 7 + entrypoint 8 + typedef struct _SquashfsExtFileBody(mutable WireCtx *ctx) 9 + { 10 + UINT64 start_block {:on-success WireSetU64(ctx, (UINT32) 0, start_block); return true; }; 11 + UINT64 file_size {:on-success WireSetU64(ctx, (UINT32) 1, file_size); return true; }; 12 + UINT64 sparse {:on-success WireSetU64(ctx, (UINT32) 2, sparse); return true; }; 13 + UINT32 nlink {:on-success WireSetU32(ctx, (UINT32) 3, nlink); return true; }; 14 + UINT32 fragment {:on-success WireSetU32(ctx, (UINT32) 4, fragment); return true; }; 15 + UINT32 offset {:on-success WireSetU32(ctx, (UINT32) 5, offset); return true; }; 16 + UINT32 xattr_id {:on-success WireSetU32(ctx, (UINT32) 6, xattr_id); return true; }; 17 + } SquashfsExtFileBody; 18 + 19 +
+12
c/SquashfsExtIpcBody.3d
··· 1 + extern typedef struct _WireCtx WireCtx 2 + 3 + extern unit WireSetU32(mutable WireCtx *ctx, UINT32 idx, UINT32 v) 4 + 5 + entrypoint 6 + typedef struct _SquashfsExtIpcBody(mutable WireCtx *ctx) 7 + { 8 + UINT32 nlink {:on-success WireSetU32(ctx, (UINT32) 0, nlink); return true; }; 9 + UINT32 xattr_id {:on-success WireSetU32(ctx, (UINT32) 1, xattr_id); return true; }; 10 + } SquashfsExtIpcBody; 11 + 12 +
+33
c/SquashfsSuperblock.3d
··· 1 + extern typedef struct _WireCtx WireCtx 2 + 3 + extern unit WireSetU32(mutable WireCtx *ctx, UINT32 idx, UINT32 v) 4 + 5 + extern unit WireSetU16(mutable WireCtx *ctx, UINT32 idx, UINT16 v) 6 + 7 + extern unit WireSetU64(mutable WireCtx *ctx, UINT32 idx, UINT64 v) 8 + 9 + entrypoint 10 + typedef struct _SquashfsSuperblock(mutable WireCtx *ctx) 11 + { 12 + UINT32 magic {:on-success WireSetU32(ctx, (UINT32) 0, magic); return true; }; 13 + UINT32 inode_count {:on-success WireSetU32(ctx, (UINT32) 1, inode_count); return true; }; 14 + UINT32 modification_time {:on-success WireSetU32(ctx, (UINT32) 2, modification_time); return true; }; 15 + UINT32 block_size {:on-success WireSetU32(ctx, (UINT32) 3, block_size); return true; }; 16 + UINT32 fragment_entry_count {:on-success WireSetU32(ctx, (UINT32) 4, fragment_entry_count); return true; }; 17 + UINT16 compression_id {:on-success WireSetU16(ctx, (UINT32) 5, compression_id); return true; }; 18 + UINT16 block_log {:on-success WireSetU16(ctx, (UINT32) 6, block_log); return true; }; 19 + UINT16 flags {:on-success WireSetU16(ctx, (UINT32) 7, flags); return true; }; 20 + UINT16 id_count {:on-success WireSetU16(ctx, (UINT32) 8, id_count); return true; }; 21 + UINT16 version_major {:on-success WireSetU16(ctx, (UINT32) 9, version_major); return true; }; 22 + UINT16 version_minor {:on-success WireSetU16(ctx, (UINT32) 10, version_minor); return true; }; 23 + UINT64 root_inode_ref {:on-success WireSetU64(ctx, (UINT32) 11, root_inode_ref); return true; }; 24 + UINT64 bytes_used {:on-success WireSetU64(ctx, (UINT32) 12, bytes_used); return true; }; 25 + UINT64 id_table_start {:on-success WireSetU64(ctx, (UINT32) 13, id_table_start); return true; }; 26 + UINT64 xattr_table_start {:on-success WireSetU64(ctx, (UINT32) 14, xattr_table_start); return true; }; 27 + UINT64 inode_table_start {:on-success WireSetU64(ctx, (UINT32) 15, inode_table_start); return true; }; 28 + UINT64 directory_table_start {:on-success WireSetU64(ctx, (UINT32) 16, directory_table_start); return true; }; 29 + UINT64 fragment_table_start {:on-success WireSetU64(ctx, (UINT32) 17, fragment_table_start); return true; }; 30 + UINT64 export_table_start {:on-success WireSetU64(ctx, (UINT32) 18, export_table_start); return true; }; 31 + } SquashfsSuperblock; 32 + 33 +
+14
c/dune
··· 1 + (executable 2 + (name gen) 3 + (modules gen) 4 + (libraries squashfs wire.3d)) 5 + 6 + (rule 7 + (mode promote) 8 + (alias gen) 9 + (targets dune.inc) 10 + (deps gen.exe) 11 + (action 12 + (run ./gen.exe dune))) 13 + 14 + (include dune.inc)
+44
c/dune.inc
··· 1 + (rule 2 + (alias gen) 3 + (mode promote) 4 + (targets SquashfsSuperblock.3d SquashfsExtDirBody.3d SquashfsExtFileBody.3d SquashfsExtDeviceBody.3d SquashfsExtIpcBody.3d) 5 + (deps gen.exe) 6 + (action 7 + (run ./gen.exe 3d))) 8 + 9 + (rule 10 + (alias gen) 11 + (mode fallback) 12 + (targets EverParse.h EverParseEndianness.h SquashfsSuperblock.h SquashfsSuperblock.c SquashfsExtDirBody.h SquashfsExtDirBody.c SquashfsExtFileBody.h SquashfsExtFileBody.c SquashfsExtDeviceBody.h SquashfsExtDeviceBody.c SquashfsExtIpcBody.h SquashfsExtIpcBody.c test.c) 13 + (deps gen.exe SquashfsSuperblock.3d SquashfsExtDirBody.3d SquashfsExtFileBody.3d SquashfsExtDeviceBody.3d SquashfsExtIpcBody.3d) 14 + (action 15 + (run ./gen.exe c))) 16 + 17 + (rule 18 + (alias runtest) 19 + (deps test.c EverParse.h EverParseEndianness.h SquashfsSuperblock.h SquashfsSuperblock.c SquashfsExtDirBody.h SquashfsExtDirBody.c SquashfsExtFileBody.h SquashfsExtFileBody.c SquashfsExtDeviceBody.h SquashfsExtDeviceBody.c SquashfsExtIpcBody.h SquashfsExtIpcBody.c) 20 + (action 21 + (system 22 + "cc -std=c11 -Wall -Wextra -Werror -o test_squashfs test.c SquashfsSuperblock.c SquashfsExtDirBody.c SquashfsExtFileBody.c SquashfsExtDeviceBody.c SquashfsExtIpcBody.c && ./test_squashfs"))) 23 + 24 + (install 25 + (package squashfs) 26 + (section lib) 27 + (files 28 + (SquashfsSuperblock.3d as c/SquashfsSuperblock.3d) 29 + (SquashfsExtDirBody.3d as c/SquashfsExtDirBody.3d) 30 + (SquashfsExtFileBody.3d as c/SquashfsExtFileBody.3d) 31 + (SquashfsExtDeviceBody.3d as c/SquashfsExtDeviceBody.3d) 32 + (SquashfsExtIpcBody.3d as c/SquashfsExtIpcBody.3d) 33 + (SquashfsSuperblock.h as c/SquashfsSuperblock.h) 34 + (SquashfsSuperblock.c as c/SquashfsSuperblock.c) 35 + (SquashfsExtDirBody.h as c/SquashfsExtDirBody.h) 36 + (SquashfsExtDirBody.c as c/SquashfsExtDirBody.c) 37 + (SquashfsExtFileBody.h as c/SquashfsExtFileBody.h) 38 + (SquashfsExtFileBody.c as c/SquashfsExtFileBody.c) 39 + (SquashfsExtDeviceBody.h as c/SquashfsExtDeviceBody.h) 40 + (SquashfsExtDeviceBody.c as c/SquashfsExtDeviceBody.c) 41 + (SquashfsExtIpcBody.h as c/SquashfsExtIpcBody.h) 42 + (SquashfsExtIpcBody.c as c/SquashfsExtIpcBody.c) 43 + (EverParse.h as c/EverParse.h) 44 + (EverParseEndianness.h as c/EverParseEndianness.h)))
+9
c/gen.ml
··· 1 + let () = 2 + Wire_3d.main ~package:"squashfs" 3 + [ 4 + Wire.Everparse.schema Squashfs.superblock_codec; 5 + Wire.Everparse.schema Squashfs.ext_dir_body_codec; 6 + Wire.Everparse.schema Squashfs.ext_file_body_codec; 7 + Wire.Everparse.schema Squashfs.ext_device_body_codec; 8 + Wire.Everparse.schema Squashfs.ext_ipc_body_codec; 9 + ]