aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml2
-rw-r--r--src/rule_methods.rs11
2 files changed, 12 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 6ef765a..c6caf47 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "rustables"
-version = "0.13.0"
+version = "0.14.0"
authors = ["lafleur@boum.org", "Simon Thoby", "Mullvad VPN", "HimbeerserverDE"]
license = "GPL-3.0-or-later"
description = "Safe abstraction for libnftnl. Provides low-level userspace access to the in-kernel nf_tables subsystem"
diff --git a/src/rule_methods.rs b/src/rule_methods.rs
index 3ebd33e..ff46dc3 100644
--- a/src/rule_methods.rs
+++ b/src/rule_methods.rs
@@ -128,6 +128,17 @@ impl Rule {
self.add_expr(Cmp::new(CmpOp::Eq, [libc::IPPROTO_IGMP as u8]));
self
}
+ /// Matches 4in6 packets.
+ pub fn ip4in6(mut self) -> Self {
+ self.add_expr(Meta::new(MetaType::NfProto));
+ self.add_expr(Cmp::new(CmpOp::Eq, [libc::NFPROTO_IPV6 as u8]));
+ self.add_expr(
+ HighLevelPayload::Network(NetworkHeaderField::IPv6(IPv6HeaderField::NextHeader))
+ .build(),
+ );
+ self.add_expr(Cmp::new(CmpOp::Eq, [0 as u8]));
+ self
+ }
/// Matches 6in4 packets.
pub fn ip6in4(mut self) -> Self {
self.add_expr(Meta::new(MetaType::NfProto));