2 releases
Uses new Rust 2024
0.0.1 | Mar 12, 2025 |
---|---|
0.0.0 | Mar 12, 2025 |
#22 in #ipv4-addr
5KB
51 lines
A library to streamline IP filtering. Supports creating, serializing, and deserializing [Ipv4Range] and [Ipv6Range] for optimized filtering.
ipfilter
Example
use core::net::Ipv4Addr;
use std::fs::File;
fn main() {
let file = File::open("whitelist.bin").unwrap();
let whitelist = ipfilter::v4::read_from(&mut &file).unwrap();
assert!(whitelist.contains(&Ipv4Addr::LOCALHOST));
}
Dependencies
~0.5–1.1MB
~24K SLoC