Skip to content

Commit 41bc9a1

Browse files
authored
Merge pull request raspberrypi#730 from wedsonaf/netfilter
rust: add `net::filter` module
2 parents df9024b + 57a0853 commit 41bc9a1

File tree

4 files changed

+461
-1
lines changed

4 files changed

+461
-1
lines changed

rust/helpers.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,12 @@ void rust_helper_put_net(struct net *net)
558558
}
559559
EXPORT_SYMBOL_GPL(rust_helper_put_net);
560560

561+
unsigned int rust_helper_NF_QUEUE_NR(unsigned int n)
562+
{
563+
return NF_QUEUE_NR(n);
564+
}
565+
EXPORT_SYMBOL_GPL(rust_helper_NF_QUEUE_NR);
566+
561567
/*
562568
* We use `bindgen`'s `--size_t-is-usize` option to bind the C `size_t` type
563569
* as the Rust `usize` type, so we can use it in contexts where Rust

rust/kernel/bindings_helper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#include <linux/uio.h>
3333
#include <uapi/linux/android/binder.h>
3434
#include <linux/netfilter.h>
35+
#include <linux/netfilter_ipv4.h>
36+
#include <linux/netfilter_ipv6.h>
37+
#include <linux/netfilter_arp.h>
3538

3639
/* `bindgen` gets confused at certain things. */
3740
const gfp_t BINDINGS_GFP_KERNEL = GFP_KERNEL;

0 commit comments

Comments
 (0)