From d956567b8a83e77dcbaa40d1038b81c18ca02b19 Mon Sep 17 00:00:00 2001 From: dlg Date: Mon, 19 Dec 2022 04:35:33 +0000 Subject: [PATCH] move pf_state_item and pf_state_key structs from pfvar.h to pfvar_priv.h. both of these are kernel private data structures and do not need to be visible to userland. moving them to pfvar_priv.h makes this explicit, and makes it leass scary to tweak them in the future. ok deraadt@ kn@ sashan@ --- sys/net/pfvar.h | 27 +-------------------------- sys/net/pfvar_priv.h | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index d547bef23b2..52d18b4545d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.522 2022/12/16 02:05:44 dlg Exp $ */ +/* $OpenBSD: pfvar.h,v 1.523 2022/12/19 04:35:33 dlg Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -708,31 +708,6 @@ struct pf_state_key_cmp { u_int8_t proto; }; -struct pf_state_item { - TAILQ_ENTRY(pf_state_item) entry; - struct pf_state *s; -}; - -TAILQ_HEAD(pf_statelisthead, pf_state_item); - -struct pf_state_key { - struct pf_addr addr[2]; - u_int16_t port[2]; - u_int16_t rdomain; - sa_family_t af; - u_int8_t proto; - - RB_ENTRY(pf_state_key) entry; - struct pf_statelisthead states; - struct pf_state_key *reverse; - struct inpcb *inp; - pf_refcnt_t refcnt; - u_int8_t removed; -}; -#define PF_REVERSED_KEY(key, family) \ - ((key[PF_SK_WIRE]->af != key[PF_SK_STACK]->af) && \ - (key[PF_SK_WIRE]->af != (family))) - /* keep synced with struct pf_state, used in RB_FIND */ struct pf_state_cmp { u_int64_t id; diff --git a/sys/net/pfvar_priv.h b/sys/net/pfvar_priv.h index 81e26c96a38..b9114c341cc 100644 --- a/sys/net/pfvar_priv.h +++ b/sys/net/pfvar_priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar_priv.h,v 1.24 2022/12/16 02:05:45 dlg Exp $ */ +/* $OpenBSD: pfvar_priv.h,v 1.25 2022/12/19 04:35:34 dlg Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -40,6 +40,31 @@ #include #include +struct pf_state_item { + TAILQ_ENTRY(pf_state_item) entry; + struct pf_state *s; +}; + +TAILQ_HEAD(pf_statelisthead, pf_state_item); + +struct pf_state_key { + struct pf_addr addr[2]; + u_int16_t port[2]; + u_int16_t rdomain; + sa_family_t af; + u_int8_t proto; + + RB_ENTRY(pf_state_key) entry; + struct pf_statelisthead states; + struct pf_state_key *reverse; + struct inpcb *inp; + pf_refcnt_t refcnt; + u_int8_t removed; +}; +#define PF_REVERSED_KEY(key, family) \ + ((key[PF_SK_WIRE]->af != key[PF_SK_STACK]->af) && \ + (key[PF_SK_WIRE]->af != (family))) + /* * Protection/ownership of pf_state members: * I immutable after pf_state_insert() -- 2.20.1