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-matching / Cargo.toml
1.5 kB 30 lines
1[package] 2name = "leveva-matching" 3version = "0.0.0" 4edition = "2021" 5publish = false 6description = "IRC glob matching and `nick!user@host` hostmasks — the RFC 1459 case-folded `*`/`?`/`#` matcher (descendant of `common/match.c`), with CIDR-aware host-component matching." 7 8# Extracted from `leveva` (the IRC daemon) as a self-contained leaf library: the 9# whole module reaches into only two other workspace leaves — `leveva-casemap` (the 10# RFC 1459 case fold) and `leveva-cidr` (the `addr/prefix` host path) — plus `nom` 11# for the mask tokenizer. It is the safe successor of the C `ircd`'s `match()` / 12# `collapse()` / `parseNUH`. ~13 consumer modules (bans, K/D/X-lines, RESV, WEBIRC, 13# allow-host auth, OPER, hunt/map/mask) depend on *it*. `leveva` re-exports it as 14# `leveva::matching`. 15[lib] 16path = "src/lib.rs" 17 18[dependencies] 19leveva-casemap = { path = "../leveva-casemap" } 20leveva-cidr = { path = "../leveva-cidr" } 21nom = "7" 22 23[dev-dependencies] 24# Property/fuzz tests: the no-panic, `*`-matches-anything, case-insensitivity, 25# compile/matches-agreement, collapse-preservation/idempotence, HostMask round-trip, 26# and CIDR-fallback invariants are fed arbitrary strings and glob masks. Stable-toolchain 27# fuzz tier — the project has no nightly/cargo-fuzz, so proptest is the runnable fuzzer. 28# There is no byte-faithful C oracle (leveva's matcher deliberately diverges from 29# match.c's ASCII-only fold), so these invariants are the gate, not a supplement. 30proptest = "1"