Proof of concept mechanical port of ircnet/ircd to Rust as part of a bit about C being insecure for network services
0

Configure Feed

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

ircd.rs / leveva-cidr / Cargo.toml
972 B 22 lines
1[package] 2name = "leveva-cidr" 3version = "0.0.0" 4edition = "2021" 5publish = false 6description = "Pure CIDR network-mask helpers: parse `addr/prefix`, test network membership, and compute the masked network base — IPv4 and IPv6, no v4-mapped normalization." 7 8# Extracted from `leveva` (the IRC daemon) as a self-contained leaf library: every 9# function is pure and depends only on `std::net`, with zero IRC-specific coupling, 10# while `matching` (host masks), `connlimit` (per-CIDR accounting), and the 11# `websocket` proxy-trust list all depend on *it*. It is the safe successor of the C 12# `ircd`'s `match_ipmask`. `leveva` re-exports it as `leveva::cidr`. 13[lib] 14path = "src/lib.rs" 15 16[dependencies] 17 18[dev-dependencies] 19# Property/fuzz tests: the parse/contains/network_base/cidr_match invariants are fed 20# arbitrary IP addresses and prefix lengths. Stable-toolchain fuzz tier — the project 21# has no nightly/cargo-fuzz, so proptest is the runnable fuzzer. 22proptest = "1"