aboutsummaryrefslogtreecommitdiff
path: root/src/rule_methods.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rule_methods.rs')
-rw-r--r--src/rule_methods.rs11
1 files changed, 11 insertions, 0 deletions
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));