How anirudh-os/rustguard works
Project type and purpose
• This is a Rust-based network firewall tool (a CLI/daemon application).
• Its purpose is to read packet data (from a network interface or injected source), match each packet against a set of rules (in rules.json), and then allow or block traffic.
File structure
• Cargo.toml / Cargo.lock: Rust project manifest and dependency lockfile.
• src/main.rs: the binary entrypoint (initializes logging, loads rules, starts packet capture loop).
• src/firewall/: the core library module
• mod.rs – declares the firewall submodules
• firewall.rs – the “engine” that applies rules to packets
• packet.rs – the data model for captured packets
• rule.rs – the data model for a single firewall rule
• src/rules.json: the external rules store, loaded at startup.
README
• (Empty in this case – infer behavior from code and file names.)