nfqueue-rs
nfqueue-rs copied to clipboard
Netfilter NFQUEUE high-level bindings (rust)
This fixes #19 I've tested the examples, and both seem to work on my machine with the updated `pnet` : 
The current pnet version does not seem be able to get compiled, supposedly due to some mismatch with their tags: ``` warning: `nfqueue` (lib) generated 6 warnings Compiling pnet_macros v0.33.0...
fixing what appears as being a typo in the ffi bindings along with a method name to enable compilation.
See [this email](https://www.spinics.net/lists/netfilter/msg58081.html) and the [nf-queue.c](http://git.netfilter.org/libnetfilter_queue/tree/examples/nf-queue.c) example.
Program: ```rust use nfqueue::{Queue, Verdict, Message}; fn callback(msg: &Message, d:&mut ()) { println!(" -> msg: {}", msg); msg.set_verdict(nfqueue::Verdict::Accept); } fn main() -> Result { let mut q = Queue::new(()); q.open();...
The current API has some drawbacks around the setting of verdict: * It is possible to set the verdict multiple times on the same message. * On the other hand,...
The `run_loop` mode has two disadvantages. • It is not possible to multiplex more than one queue on the same thread. • There doesn't seem to be a clean way...
I am facing an issue while trying to increase the queue length in the Rust bindings for libnetfilter_queue. The existing API in lib.rs uses set_queuelen, but this is deprecated and...
Hi! This PR fixes #15 The problem is that `nfq_get_payload` takes a pointer of pointer in parameters in order to return a pointer of the received packet. The original code...