diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-05-06 14:56:01 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-05-06 14:56:01 +0200 |
commit | c59649b8e034dce0267c3ee7bbaf5ba265743889 (patch) | |
tree | f1a0eb777de810066e05cd66c1358906d6786bdf | |
parent | 93724f6b9bac1df223b537f8025fbdbda39bec88 (diff) |
add 6in4 match helper
-rw-r--r-- | src/rule_methods.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rule_methods.rs b/src/rule_methods.rs index 213d679..eaf963d 100644 --- a/src/rule_methods.rs +++ b/src/rule_methods.rs @@ -128,6 +128,12 @@ impl Rule { self.add_expr(Cmp::new(CmpOp::Eq, [libc::IPPROTO_IGMP as u8])); self } + /// Matches 6in4 packets. + pub fn ip6in4(mut self) -> Self { + self.add_expr(Meta::new(MetaType::NfProto)); + self.add_expr(Cmp::new(CmpOp::Eq, [41])); + self + } /// Matches packets from source `port` and `protocol`. pub fn sport(self, port: u16, protocol: Protocol) -> Self { self.match_port(port, protocol, false) |