aboutsummaryrefslogtreecommitdiff
path: root/lib/libpfctl
diff options
context:
space:
mode:
authorKurosawa Takahiro <takahiro.kurosawa@gmail.com>2021-04-12 14:03:40 +0000
committerKristof Provost <kp@FreeBSD.org>2021-04-12 16:30:29 +0000
commit600bd6ce0639c84b763516477250df5964e8edf6 (patch)
tree508a62dadceca9325a963af3c82a41e3df6f32b0 /lib/libpfctl
parentb856b51d149811d68ab9e72daa609f00e13c2ec3 (diff)
downloadsrc-600bd6ce0639c84b763516477250df5964e8edf6.tar.gz
src-600bd6ce0639c84b763516477250df5964e8edf6.zip
pfctl, libpfctl: introduce pfctl_pool
Introduce pfctl_pool to be able to extend the pool part of the pf rule without breaking the ABI. Reviewed by: kp MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D29721
Diffstat (limited to 'lib/libpfctl')
-rw-r--r--lib/libpfctl/libpfctl.c4
-rw-r--r--lib/libpfctl/libpfctl.h12
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index 2a7b64f1cbc8..a487e5a20018 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -198,7 +198,7 @@ pf_nvrule_addr_to_rule_addr(const nvlist_t *nvl, struct pf_rule_addr *addr)
static void
pfctl_nv_add_pool(nvlist_t *nvparent, const char *name,
- const struct pf_pool *pool)
+ const struct pfctl_pool *pool)
{
u_int64_t ports[2];
nvlist_t *nvl = nvlist_create(0);
@@ -216,7 +216,7 @@ pfctl_nv_add_pool(nvlist_t *nvparent, const char *name,
}
static void
-pf_nvpool_to_pool(const nvlist_t *nvl, struct pf_pool *pool)
+pf_nvpool_to_pool(const nvlist_t *nvl, struct pfctl_pool *pool)
{
size_t len;
const void *data;
diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h
index 95f6d4e3c77f..bc27c18cfbb6 100644
--- a/lib/libpfctl/libpfctl.h
+++ b/lib/libpfctl/libpfctl.h
@@ -38,6 +38,16 @@
struct pfctl_anchor;
+struct pfctl_pool {
+ struct pf_palist list;
+ struct pf_pooladdr *cur;
+ struct pf_poolhashkey key;
+ struct pf_addr counter;
+ int tblidx;
+ u_int16_t proxy_port[2];
+ u_int8_t opts;
+};
+
struct pfctl_rule {
struct pf_rule_addr src;
struct pf_rule_addr dst;
@@ -52,7 +62,7 @@ struct pfctl_rule {
char overload_tblname[PF_TABLE_NAME_SIZE];
TAILQ_ENTRY(pfctl_rule) entries;
- struct pf_pool rpool;
+ struct pfctl_pool rpool;
u_int64_t evaluations;
u_int64_t packets[2];