diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-03-30 15:06:35 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-03-30 15:06:35 +0200 |
commit | 674db7775393f9ae800c936f920977d0fa5ef4b7 (patch) | |
tree | 3ddc935c6509e4c079a8524dbc6c3dbbe7f5cf98 | |
parent | 2193d38b6bf190abe10112a9ee3c49213134095f (diff) |
add icmpv6 matching support
-rw-r--r-- | src/rule_methods.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rule_methods.rs b/src/rule_methods.rs index 96df04f..ded8594 100644 --- a/src/rule_methods.rs +++ b/src/rule_methods.rs @@ -110,11 +110,16 @@ impl Rule { impl Rule { /// Matches ICMP packets. pub fn icmp(mut self) -> Self { - // quid of icmpv6? self.add_expr(Meta::new(MetaType::L4Proto)); self.add_expr(Cmp::new(CmpOp::Eq, [libc::IPPROTO_ICMP as u8])); self } + /// Matches ICMPv6 packets. + pub fn icmpv6(mut self) -> Self { + self.add_expr(Meta::new(MetaType::L4Proto)); + self.add_expr(Cmp::new(CmpOp::Eq, [libc::IPPROTO_ICMPV6 as u8])); + self + } /// Matches IGMP packets. pub fn igmp(mut self) -> Self { self.add_expr(Meta::new(MetaType::L4Proto)); |