aboutsummaryrefslogtreecommitdiff
path: root/lib/libpfctl/libpfctl.h
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2025-06-03 07:15:21 +0000
committerKristof Provost <kp@FreeBSD.org>2025-06-25 17:56:23 +0000
commitff11f1c8c76c053b442f1f1df97272939fbf5afc (patch)
tree5f673835826467ca5b7752fe23e50a7a88fb6dac /lib/libpfctl/libpfctl.h
parent53a341d0e445269590dcb32f8c8320c3459a21c4 (diff)
pf: add a generic packet rate matching filter
allows things like pass in proto icmp max-pkt-rate 100/10 all packets matching the rule in the direction the state was created are taken into consideration (typically: requests, but not replies). Just like with the other max-*, the rule stops matching if the maximum is reached, so in typical scenarios the default block rule would kick in then. with input from Holger Mikolon ok mikeb Obtained from: OpenBSD, henning <henning@openbsd.org>, 5a4ae9a9cb Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50798
Diffstat (limited to 'lib/libpfctl/libpfctl.h')
-rw-r--r--lib/libpfctl/libpfctl.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h
index 4d481f436674..7de7a08e90bf 100644
--- a/lib/libpfctl/libpfctl.h
+++ b/lib/libpfctl/libpfctl.h
@@ -159,6 +159,13 @@ struct pfctl_rules_info {
uint32_t ticket;
};
+struct pfctl_threshold {
+ uint32_t limit;
+ uint32_t seconds;
+ uint32_t count;
+ uint32_t last;
+};
+
struct pfctl_rule {
struct pf_rule_addr src;
struct pf_rule_addr dst;
@@ -181,6 +188,7 @@ struct pfctl_rule {
struct pfctl_pool rdr;
};
struct pfctl_pool route;
+ struct pfctl_threshold pktrate;
uint64_t evaluations;
uint64_t packets[2];
@@ -396,13 +404,6 @@ struct pfctl_syncookies {
uint32_t halfopen_states;
};
-struct pfctl_threshold {
- uint32_t limit;
- uint32_t seconds;
- uint32_t count;
- uint32_t last;
-};
-
struct pfctl_src_node {
struct pf_addr addr;
struct pf_addr raddr;