From owner-dev-commits-src-branches@freebsd.org Fri May 7 15:25:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48F77631605; Fri, 7 May 2021 15:25:47 +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 4FcDmV17CTz4jxf; Fri, 7 May 2021 15:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 4887A5C3F; Fri, 7 May 2021 15:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 147FPjhA026303; Fri, 7 May 2021 15:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 147FPjor026302; Fri, 7 May 2021 15:25:45 GMT (envelope-from git) Date: Fri, 7 May 2021 15:25:45 GMT Message-Id: <202105071525.147FPjor026302@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: c3f3f537715c - stable/13 - pf: Move prototypes for userspace functions to userspace header 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: c3f3f537715c918bdf50f7ec8548ba7ad2778036 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2021 15:25:47 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c3f3f537715c918bdf50f7ec8548ba7ad2778036 commit c3f3f537715c918bdf50f7ec8548ba7ad2778036 Author: Kristof Provost AuthorDate: 2021-04-07 17:49:51 +0000 Commit: Kristof Provost CommitDate: 2021-05-07 08:15:42 +0000 pf: Move prototypes for userspace functions to userspace header These functions no longer exist in the kernel, so there's no reason to keep the prototypes in a kernel header. Move them to pfctl where they're actually implemented. Reviewed by: glebius MFC after: 4 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29643 (cherry picked from commit a9b338b260be39cc74dddb599d6c95b8794ca98b) --- sbin/pfctl/pf_ruleset.c | 2 ++ sbin/pfctl/pfctl.h | 8 ++++++++ sys/netpfil/pf/pf.h | 9 +-------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sbin/pfctl/pf_ruleset.c b/sbin/pfctl/pf_ruleset.c index 7c337d7a2da7..baac1deb4fa7 100644 --- a/sbin/pfctl/pf_ruleset.c +++ b/sbin/pfctl/pf_ruleset.c @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #define rs_malloc(x) calloc(1, x) #define rs_free(x) free(x) +#include "pfctl.h" + #ifdef PFDEBUG #include #define DPFPRINTF(format, x...) fprintf(stderr, format , ##x) diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index f43b71e19fec..5aa94b2bb0c8 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -128,4 +128,12 @@ u_int32_t pfctl_get_ticket(struct pfr_buffer *, int, const char *); int pfctl_trans(int, struct pfr_buffer *, u_long, int); +int pf_get_ruleset_number(u_int8_t); +void pf_init_ruleset(struct pf_ruleset *); +int pf_anchor_setup(struct pf_rule *, + const struct pf_ruleset *, const char *); +void pf_remove_if_empty_ruleset(struct pf_ruleset *); +struct pf_ruleset *pf_find_ruleset(const char *); +struct pf_ruleset *pf_find_or_create_ruleset(const char *); + #endif /* _PFCTL_H_ */ diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index bc6cd92ae7b8..3e358de8aba5 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -637,13 +637,6 @@ struct pf_anchor { RB_PROTOTYPE(pf_anchor_global, pf_anchor, entry_global, pf_anchor_compare); RB_PROTOTYPE(pf_anchor_node, pf_anchor, entry_node, pf_anchor_compare); -/* these ruleset functions can be linked into userland programs (pfctl) */ -int pf_get_ruleset_number(u_int8_t); -void pf_init_ruleset(struct pf_ruleset *); -int pf_anchor_setup(struct pf_rule *, - const struct pf_ruleset *, const char *); -void pf_remove_if_empty_ruleset(struct pf_ruleset *); -struct pf_ruleset *pf_find_ruleset(const char *); -struct pf_ruleset *pf_find_or_create_ruleset(const char *); +int pf_get_ruleset_number(u_int8_t); #endif /* _NET_PF_H_ */