diff options
author | Kristof Provost <kp@FreeBSD.org> | 2022-09-24 12:47:17 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2022-10-31 17:14:09 +0000 |
commit | 444a77ca85c78d02c19622a83a2798d0c5c2117b (patch) | |
tree | 136547d6c163f44d3dc044f9e86ac87d58704e00 /lib/libpfctl | |
parent | 728ca8506dff0f27e32a5994b68e9eea5c345e04 (diff) | |
download | src-444a77ca85c78d02c19622a83a2798d0c5c2117b.tar.gz src-444a77ca85c78d02c19622a83a2798d0c5c2117b.zip |
pf: expose syncookie active/inactive status
When syncookies are in adaptive mode they may be active or inactive.
Expose this status to users.
Suggested by: Guido van Rooij
Sponsored by: Rubicon Communications, LLC ("Netgate")
Diffstat (limited to 'lib/libpfctl')
-rw-r--r-- | lib/libpfctl/libpfctl.c | 1 | ||||
-rw-r--r-- | lib/libpfctl/libpfctl.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 5b93fd1043d6..451567402470 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -224,6 +224,7 @@ pfctl_get_status(int dev) status->hostid = ntohl(nvlist_get_number(nvl, "hostid")); status->states = nvlist_get_number(nvl, "states"); status->src_nodes = nvlist_get_number(nvl, "src_nodes"); + status->syncookies_active = nvlist_get_bool(nvl, "syncookies_active"); strlcpy(status->ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index faccabd227a3..933a3927ac26 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -57,6 +57,7 @@ struct pfctl_status { uint64_t src_nodes; char ifname[IFNAMSIZ]; uint8_t pf_chksum[PF_MD5_DIGEST_LENGTH]; + bool syncookies_active; struct pfctl_status_counters counters; struct pfctl_status_counters lcounters; |