Skip to main content

kernel_blocks

Function kernel_blocks 

Source
pub fn kernel_blocks(plan: &FirewallPlan) -> Option<BTreeMap<String, u64>>
Expand description

What the kernel logged the firewall dropping toward the plan’s ports in the last BLOCK_WINDOW_SECONDS, per port; None when the log cannot be read from this process (no journalctl, or no membership of the groups that may read it), which is an absence, not a verdict. An empty plan asks nothing.

use majordomus_cli::mesh::firewall::{kernel_blocks, plan};

assert!(kernel_blocks(&plan(None, &[], None)).is_none());