-/* $OpenBSD: ip_ipsp.c,v 1.271 2022/06/28 09:32:27 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.272 2022/07/14 13:52:10 mvs Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
/*
* Locks used to protect global data and struct members:
- * F ipsec_flows_mtx
+ * D tdb_sadb_mtx
+ * F ipsec_flows_mtx SA database global mutex
*/
struct mutex ipsec_flows_mtx = MUTEX_INITIALIZER(IPL_SOFTNET);
#define TDB_HASHSIZE_INIT 32
-/* Protected by the tdb_sadb_mtx. */
struct mutex tdb_sadb_mtx = MUTEX_INITIALIZER(IPL_SOFTNET);
-static SIPHASH_KEY tdbkey;
-static struct tdb **tdbh;
-static struct tdb **tdbdst;
-static struct tdb **tdbsrc;
-static u_int tdb_hashmask = TDB_HASHSIZE_INIT - 1;
-static int tdb_count;
+static SIPHASH_KEY tdbkey; /* [D] */
+static struct tdb **tdbh; /* [D] */
+static struct tdb **tdbdst; /* [D] */
+static struct tdb **tdbsrc; /* [D] */
+static u_int tdb_hashmask = TDB_HASHSIZE_INIT - 1; /* [D] */
+static int tdb_count; /* [D] */
void
ipsp_init(void)
-/* $OpenBSD: ip_ipsp.h,v 1.239 2022/04/30 13:28:53 mvs Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.240 2022/07/14 13:52:10 mvs Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
* N net lock
* A ipsec_acquire_mtx
* F ipsec_flows_mtx
+ * P ipo_tdb_mtx link policy to TDB global mutex
+ * D tdb_sadb_mtx SA database global mutex
* m tdb_mtx fields of struct tdb
- * p ipo_tdb_mtx link policy to TDB global mutex
- * s tdb_sadb_mtx SA database global mutex
*/
/* IPSP global definitions. */
* mode was used.
*/
- u_int64_t ipo_last_searched; /* [p] Timestamp of lookup */
+ u_int64_t ipo_last_searched; /* [P] Timestamp of lookup */
u_int8_t ipo_flags; /* See IPSP_POLICY_* definitions */
u_int8_t ipo_type; /* USE/ACQUIRE/... */
struct refcnt ipo_refcnt;
- struct tdb *ipo_tdb; /* [p] Cached TDB entry */
+ struct tdb *ipo_tdb; /* [P] Cached TDB entry */
struct ipsec_ids *ipo_ids;
struct ipsec_acquire_head ipo_acquires; /* [A] List of acquires */
- TAILQ_ENTRY(ipsec_policy) ipo_tdb_next; /* [p] List TDB policies */
+ TAILQ_ENTRY(ipsec_policy) ipo_tdb_next; /* [P] List TDB policies */
TAILQ_ENTRY(ipsec_policy) ipo_list; /* List of all policies */
};
* policy matching. The following three fields maintain the hash
* queues in those three tables.
*/
- struct tdb *tdb_hnext; /* [s] dst/spi/sproto table */
- struct tdb *tdb_dnext; /* [s] dst/sproto table */
- struct tdb *tdb_snext; /* [s] src/sproto table */
+ struct tdb *tdb_hnext; /* [D] dst/spi/sproto table */
+ struct tdb *tdb_dnext; /* [D] dst/sproto table */
+ struct tdb *tdb_snext; /* [D] src/sproto table */
struct tdb *tdb_inext;
struct tdb *tdb_onext;
SIMPLEQ_ENTRY(tdb) tdb_walk; /* [N] temp list for tdb walker */
struct sockaddr_encap tdb_filter; /* What traffic is acceptable */
struct sockaddr_encap tdb_filtermask; /* And the mask */
- TAILQ_HEAD(tdb_policy_head, ipsec_policy) tdb_policy_head; /* [p] */
+ TAILQ_HEAD(tdb_policy_head, ipsec_policy) tdb_policy_head; /* [P] */
TAILQ_ENTRY(tdb) tdb_sync_entry;
TAILQ_ENTRY(tdb) tdb_sync_snap;
};