From nobody Wed Nov 01 09:06:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SL1MQ1zJvz503jT; Wed, 1 Nov 2023 09:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SL1MQ1R54z3KSp; Wed, 1 Nov 2023 09:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698829570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bjr44JNysVqradx9Sj8guBn8byheGBKi0kTrmBRqmYw=; b=cYHVDcUtbNHAgFwP+oddFvXPaSXycjXtNfo4k43h2owPrDIUk95Z/u28Ik8YCjU3I8I8mV UODWumSIt9Ao6JUHmLaD3Bq5q1svNiu9gFcvk/q28aldAIABMYOlgx5YUY/dVpTRbB/xBx 0FHGMp8LMXrrIthwy1ehEkfl0KqRyV9h9xojo9Eke7T7tnoOX2yldFq3ani890KY3ZhYIg HBK9S5Iv4qEvEJsQnFuxJUj7NkVfDz4i5Z+k7fSYigh7ySIbKrlydYcfJ2CgQKyCkP7+ct U4PbtyZ0nfp48DA3+0m68HEgCls9RfuVcUcGy7TH78qdBi5yVOS128/uJv/nNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698829570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bjr44JNysVqradx9Sj8guBn8byheGBKi0kTrmBRqmYw=; b=GgVoZGGlW+s8jQWVXIg2YYMTt+t+RZYiTTsPjF16atiUSnNSMDlq2JJG6ACf6JqW2+WUYP zwprGZFYt+tAOlc7mVhaeVfd7VGrgaMtx5vNVRpzD9YSx66gtyNQuiDuEy1weHamrMfcam hILI6mOSQ+4m/zrbdgl7LaTkiMsPnq0+fjQQckdPj5K2lpB2ChrZAzk7z3Z7IuDsQQZIF5 3uU25fq/TlnoN5D8b95hrEBejzTE6NOCRahNuZrxHfdhtN+DCHHFLwvBOwfrO7oHm/xG7T x4+YmW/q9O5z3CY+FIJIYwwuXvt1MTSuZzW3BpQpeybX9/vmr00FTF1bdHjA4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698829570; a=rsa-sha256; cv=none; b=lZhbPuy+XUok9xy2MROdUM58Ic5biB/5FXm2IWSsbzIqXF+3awJ5g2EjKg142RHdc7yicX fKTr7RVr1fFj2KlYeeInJKHpPXizSnTBVZoNZNnBm5rk1UewJ7Vajc2wOo2XpQY36MDqIL JjIf73Veg5yEbvqlp/X3EnbgNQ8quciYpwNx+en94BKajdLcmjYNIdi5QivfeawpJ3M5AB DH41bX58rYCqFkB+A22YAKvSostrCdQaq6A9WbmZmsiOwabbAGDV0CrJwP1G3woCTVCHGP hHQUk1CiXwcvjZHElnPvWtJKX94MzaeQtOazQrd4o0wXunhve180IFpiR3a0lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SL1MQ0P5CzgRg; Wed, 1 Nov 2023 09:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A1969UQ065382; Wed, 1 Nov 2023 09:06:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A1969xU065370; Wed, 1 Nov 2023 09:06:09 GMT (envelope-from git) Date: Wed, 1 Nov 2023 09:06:09 GMT Message-Id: <202311010906.3A1969xU065370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 931c22cb9825 - stable/13 - pf: update pf(4) man page to list DIOCGETSTATESV2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 931c22cb9825a9ee9112c7dec7527f9e102ee659 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=931c22cb9825a9ee9112c7dec7527f9e102ee659 commit 931c22cb9825a9ee9112c7dec7527f9e102ee659 Author: Kristof Provost AuthorDate: 2023-10-23 15:11:15 +0000 Commit: Kristof Provost CommitDate: 2023-10-31 08:12:45 +0000 pf: update pf(4) man page to list DIOCGETSTATESV2 The nvlist based state retrieval ioctl has been replaced by an old-style ioctl for performance reasons. Document that one. Reported by: Michael Gmelin MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D42331 (cherry picked from commit 6869f90bf5bbb2f5ae5400e3a435b3680991321d) --- share/man/man4/pf.4 | 103 +++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 54 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 4f0ff50d3db5..b757376e0183 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 12, 2023 +.Dd October 20, 2023 .Dt PF 4 .Os .Sh NAME @@ -419,65 +419,60 @@ Set the debug level. enum { PF_DEBUG_NONE, PF_DEBUG_URGENT, PF_DEBUG_MISC, PF_DEBUG_NOISY }; .Ed -.It Dv DIOCGETSTATESNV Fa "struct pfioc_nv *nv" +.It Dv DIOCGETSTATESV2 Fa "struct pfioc_states_v2 *ps" Get state table entries. .Bd -literal -nvlist pf_state_key { - nvlist pf_addr addr[2]; - number port[2]; - number af; - number proto; -}; - -nvlist pf_state_scrub { - bool timestamp; - number ttl; - number ts_mod; -}; - -nvlist pf_state_peer { - nvlist pf_state_scrub scrub; - number seqlo; - number seqhi; - number seqdiff; - number max_win; - number mss; - number state; - number wscale; -}; - -nvlist pf_state { - number id; - string ifname; - nvlist pf_state_key stack_key; - nvlist pf_state_key wire_key; - nvlist pf_state_peer src; - nvlist pf_state_peer dst; - nvlist pf_addr rt_addr; - number rule; - number anchor; - number nat_rule; - number expire; - number packets[2]; - number bytes[2]; - number creatorid; - number direction; - number log; - number state_flags; - number timeout; - number sync_flags; +struct pfioc_states_v2 { + int ps_len; + uint64_t ps_req_version; + union { + void *ps_buf; + struct pf_state_export *ps_states; + }; }; -nvlist pf_states { - number count; - nvlist pf_state states[]; +struct pf_state_export { + uint64_t version; + uint64_t id; + char ifname[IFNAMSIZ]; + char orig_ifname[IFNAMSIZ]; + struct pf_state_key_export key[2]; + struct pf_state_peer_export src; + struct pf_state_peer_export dst; + struct pf_addr rt_addr; + uint32_t rule; + uint32_t anchor; + uint32_t nat_rule; + uint32_t creation; + uint32_t expire; + uint32_t spare0; + uint64_t packets[2]; + uint64_t bytes[2]; + uint32_t creatorid; + uint32_t spare1; + sa_family_t af; + uint8_t proto; + uint8_t direction; + uint8_t log; + uint8_t state_flags_compat; + uint8_t timeout; + uint8_t sync_flags; + uint8_t updates; + uint16_t state_flags; + uint16_t qid; + uint16_t pqid; + uint16_t dnpipe; + uint16_t dnrpipe; + int32_t rtableid; + uint8_t min_ttl; + uint8_t set_tos; + uint16_t max_mss; + uint8_t set_prio[2]; + uint8_t rt; + char rt_ifname[IFNAMSIZ]; + uint8_t spare[72]; }; .Ed -.Pp -If -.Va pfioc_nv.size -is insufficiently large, as many states as possible that can fit into this -size will be copied into the supplied buffer. .It Dv DIOCCHANGERULE Fa "struct pfioc_rule *pcr" Add or remove the .Va rule