Re: sys/net/pfvar.h: zap duplicate signatures

2018-12-09 Thread Jeremie Courreges-Anglas
On Sat, Dec 08 2018, Klemens Nanni  wrote:
> These are identical (see increased context) since introduction:

[...]

> OK to remove the duplicate signatures under _KERNEL for clarity?

Sure.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



sys/net/pfvar.h: zap duplicate signatures

2018-12-08 Thread Klemens Nanni
These are identical (see increased context) since introduction:

revision 1.240
date: 2006/10/27 13:56:51;  author: mcbride;  state: Exp;  lines: +26 -8;
Split ruleset manipulation functions out into pf_ruleset.c to allow them to
be imported into pfctl. This is a precursor to separating ruleset parsing
from loading in pfctl, and tons of good things will come from it.

2 minor changes aside from cut-n-paste and #define portability magic:

- instead of defining the global pf_main_ruleset, define pf_main_anchor
  (which contains the pf_main_ruleset)

- allow pf_find_or_create_ruleset() to return the pf_main_ruleset if it's
  passed an empty anchor name.

ok henning dhartmei


OK to remove the duplicate signatures under _KERNEL for clarity?

Index: pfvar.h
===
RCS file: /cvs/src/sys/net/pfvar.h,v
retrieving revision 1.486
diff -u -p -U11 -r1.486 pfvar.h
--- pfvar.h 13 Sep 2018 19:53:58 -  1.486
+++ pfvar.h 8 Dec 2018 21:42:31 -
@@ -1917,28 +1917,22 @@ int  pf_anchor_setup(struct pf_rule 
*,
 int pf_anchor_copyout(const struct pf_ruleset *,
const struct pf_rule *, struct pfioc_rule *);
 voidpf_anchor_remove(struct pf_rule *);
 voidpf_remove_if_empty_ruleset(struct pf_ruleset *);
 struct pf_anchor   *pf_find_anchor(const char *);
 struct pf_ruleset  *pf_find_ruleset(const char *);
 struct pf_ruleset  *pf_get_leaf_ruleset(char *, char **);
 struct pf_anchor   *pf_create_anchor(struct pf_anchor *, const char *);
 struct pf_ruleset  *pf_find_or_create_ruleset(const char *);
 voidpf_rs_initialize(void);
 
-#ifdef _KERNEL
-int pf_anchor_copyout(const struct pf_ruleset *,
-   const struct pf_rule *, struct pfioc_rule *);
-voidpf_anchor_remove(struct pf_rule *);
-#endif /* _KERNEL */
-
 /* The fingerprint functions can be linked into userland programs (tcpdump) */
 intpf_osfp_add(struct pf_osfp_ioctl *);
 #ifdef _KERNEL
 struct pf_osfp_enlist *
pf_osfp_fingerprint(struct pf_pdesc *);
 #endif /* _KERNEL */
 struct pf_osfp_enlist *
pf_osfp_fingerprint_hdr(const struct ip *, const struct ip6_hdr *,
const struct tcphdr *);
 void   pf_osfp_flush(void);
 intpf_osfp_get(struct pf_osfp_ioctl *);