⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module rules

Module rules 

Source
Expand description

Firewall rule matching and evaluation

Provides rule definitions with match criteria (source/dest IP with CIDR, port ranges, protocol, TCP flags, connection state) and actions (Accept, Drop, Reject, Log, Jump, Masquerade, SNAT, DNAT). CIDR matching uses bitmask comparison for efficient subnet checks.

Structs§

CidrAddress
IPv4 address with CIDR prefix length for subnet matching
FirewallRule
A single firewall rule with match criteria, action, and counters
MatchCriteria
Criteria for matching packets against a firewall rule
PacketMetadata
Extracted packet metadata used for rule evaluation
PortRange
A range of ports for matching (inclusive on both ends)
RuleEngine
Manages all firewall rules and provides lookup by ID
TcpFlags
TCP flag bitmask for matching

Enums§

Protocol
IP protocol for rule matching
RuleAction
Action to take when a rule matches