From nobody Tue Oct 24 09:34:04 2023 X-Original-To: dev-commits-src-main@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 4SF6MK1gksz4xnKp; Tue, 24 Oct 2023 09:34:05 +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 4SF6MK124Sz3cTg; Tue, 24 Oct 2023 09:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698140045; 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=zDf5vGX56UB4mLaAVhFK/vtKfU6eLbI2ztpyumgUk5s=; b=i60ujQqN33VtSi2OAiK4BWLfFDF2+QF+0JbumLaqWxxgDTwEzQItnnT0O/fO7WXgizCyRu DyPiHV1iZSYBha1jws0zL6sPN2vOuUh/0fPKo8zugCJhWTiLAKjvb/13RB/wTAU/oLxt8L Qlo7jyUd9HxCMZdNuMTXcYxx2veQp0Vqh/sGTgX7W5Yk+ufLRUp75NzA0Z7ZJyF499UMeD 18IkO1gkJH6VswlWDVs0vAcic56dKYtoVWFcvIIOzPhJyKh4n3ZZftzUdGo0GInIZ/GI8e 1xraDQnAM/3RLZTxjvM2u7TxlSu0WKNq6nNpyC+OwJvIrLrvuZTEOTyZ/iT2UQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698140045; a=rsa-sha256; cv=none; b=tMLY0dHdjRSB0E36Ms/fw8XlmTo98hY6RgfmzyugRon26rf1BDqmNAuaWJPQvVf1naRPh1 wCw2DJz+7XmC88hEuTeYnj3OptPPLmO3DzVzqKbw/4sx18PPzXqX40vP3k5abuyz04zRtD 7YAiYeS2FIoVtMioQK7GaXSaW+8d15RmxJDjQ7Sl84qL4220kD8hk7kHKnNUPIssKk3AhZ m4qKMHu4MyPT0oBIJrrHA6OyYElM6p6KN3herEL4aCUu/pzBG40tyttcPFJ4DOOmvMGhHR R8hfreMFc31MKFlZKjv/Ull9j7abBsv2k/JdQWXOe/80+Tb+GnIGRmsAkQrq2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698140045; 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=zDf5vGX56UB4mLaAVhFK/vtKfU6eLbI2ztpyumgUk5s=; b=D6R5UDJhQu0FxeY/41rkZrY6DliP5qJ07WkBoU9RgGeJk9Iwlo6kJ0RNP9Q8xVcW7pwTdS vH5HLYOiJfsHscSHBVPd3DfDbwmWJLrkZpY5xaIVEFPjcRRlzf40c57xTybc2yRpktvBu6 if2tmMorZy0aKp2nwPhV5O7vemp5aTJ34km9nK1paSVbCsHrxqiGUZxgsoH4XJL9UVTaLx QYphgC7bTIITgqJrTheeT29G2dyaOyhavdnR38yv4Q/h4igPt6o/c+bMZkRD5+3W/q3TV1 SlG51uxRbd+vxQ8HTbU5Fdy5CtleQjB2EMWJTthCay+nTdPH3Rc9+5q3jzEmjw== 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 4SF6MK03Pxz3J3; Tue, 24 Oct 2023 09:34:05 +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 39O9Y457086297; Tue, 24 Oct 2023 09:34:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39O9Y4ei086294; Tue, 24 Oct 2023 09:34:04 GMT (envelope-from git) Date: Tue, 24 Oct 2023 09:34:04 GMT Message-Id: <202310240934.39O9Y4ei086294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6869f90bf5bb - main - pf: update pf(4) man page to list DIOCGETSTATESV2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 6869f90bf5bbb2f5ae5400e3a435b3680991321d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6869f90bf5bbb2f5ae5400e3a435b3680991321d commit 6869f90bf5bbb2f5ae5400e3a435b3680991321d Author: Kristof Provost AuthorDate: 2023-10-23 15:11:15 +0000 Commit: Kristof Provost CommitDate: 2023-10-24 07:51:00 +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 --- 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 67d85b7b1a92..645f31e6e395 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 September 22, 2023 +.Dd October 20, 2023 .Dt PF 4 .Os .Sh NAME @@ -428,65 +428,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