aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-03-30 15:06:35 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-03-30 15:06:35 +0200
commit674db7775393f9ae800c936f920977d0fa5ef4b7 (patch)
tree3ddc935c6509e4c079a8524dbc6c3dbbe7f5cf98
parent2193d38b6bf190abe10112a9ee3c49213134095f (diff)
add icmpv6 matching support
-rw-r--r--src/rule_methods.rs7
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));