nfq-updated

Crates.ionfq-updated
lib.rsnfq-updated
version0.2.6
created_at2025-12-28 10:43:33.651961+00
updated_at2025-12-28 10:43:33.651961+00
descriptionRust library for dealing with NetFilter queue
homepagehttps://github.com/nbdd0121/nfq-rs
repositoryhttps://github.com/dilluti0n/nfq-rs.git
max_upload_size
id2008586
size51,051
Hee (dilluti0n)

documentation

README

nfq - NetFilter queue for Rust

nfq is Rust library for performing userspace handling of packets queued by the kernel packet packet filter chains.

License

In contrast to libnetfilter_queue which is licensed under GPL 2.0, which will require all binaries using that library to be bound by GPL, nfq is dual-licensed under MIT/Apache-2.0. nfq achieves this by communicates with kernel via NETLINK sockets directly.

Example

Here is an example which accepts all packets.

use nfq::{Queue, Verdict};

fn main() -> std::io::Result<()> {
   let mut queue = Queue::open()?; 
   queue.bind(0)?;
   loop {
       let mut msg = queue.recv()?;
       msg.set_verdict(Verdict::Accept);
       queue.verdict(msg)?;
   }
   Ok(())
}
Commit count: 0

cargo fmt