Craton Shield

Core Examples

Runnable examples demonstrating Craton Shield core functionality.

Examples

ExampleLanguageDescriptionHow to Run
basic_ids.rsRustCAN monitor setup with detection rules, frame processing, and alert routing through the IDS enginecargo run --example basic_ids
encrypted_storage.rsRustTransparent AES-GCM encrypted storage with tamper detection and nonce managementcargo run --example encrypted_storage --features "mock-hsm"
eth_monitoring.rsRustEthernet monitor for SOME/IP allowlisting, ARP anomaly detection, and VLAN filteringcargo run --example eth_monitoring
ffi_example.cCFull lifecycle of the C FFI interface: init, CAN/ETH submission, tick loop, health query, shutdownSee build instructions in file header
firewall_policy.rsRustNetwork firewall rule configuration and XACML-lite policy engine for access control decisionscargo run --example firewall_policy
s32g3_integration.rsRustNXP S32G3 gateway integration pattern with stub HAL implementations and integration checklistcargo run --example s32g3_integration

Prerequisites

  • Rust 1.82+ (stable)
  • For encrypted_storage: the mock-hsm feature flag (never use in production)
  • For ffi_example.c: build the vs-ffi shared library first, then compile and link with a C compiler (see file header for detailed instructions)

Notes

  • All Rust examples run on the host (x86_64 or aarch64) and do not require embedded hardware.
  • The s32g3_integration example uses stub HAL implementations. Replace them with real S32G3 peripheral drivers for production use.
  • See integration-examples.md for additional third-party middleware integration patterns (AUTOSAR, SOME/IP, UDS, OTA).

License

Apache-2.0. See LICENSE.