summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipsp.h
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2024-04-17 20:48:52 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2024-04-17 20:48:52 +0000
commit243a389a6ab4dfd405e3acb44510c86c9f0427af (patch)
tree3ee231eed6be924567c56bb3e98b8a07477c284f /sys/netinet/ip_ipsp.h
parent168c1fd50290b3cac3b75ebfeb69d1a4f531a191 (diff)
Use struct ipsec_level within inpcb.
Instead of passing around u_char[4], introduce struct ipsec_level that contains 4 ipsec levels. This provides better type safety. The embedding struct inpcb is globally visible for netstat(1), so put struct ipsec_level outside of #ifdef _KERNEL. OK deraadt@ mvs@
Diffstat (limited to 'sys/netinet/ip_ipsp.h')
-rw-r--r--sys/netinet/ip_ipsp.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h
index 0b847b9b9b1..e72d17e366f 100644
--- a/sys/netinet/ip_ipsp.h
+++ b/sys/netinet/ip_ipsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.h,v 1.244 2023/11/26 22:08:10 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.245 2024/04/17 20:48:51 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -149,6 +149,13 @@ struct ipsecstat {
uint64_t ipsec_exctdb; /* TDBs with hardlimit excess */
};
+struct ipsec_level {
+ u_char sl_auth; /* Authentication level */
+ u_char sl_esp_trans; /* ESP transport level */
+ u_char sl_esp_network; /* ESP network (encapsulation) level */
+ u_char sl_ipcomp; /* Compression level */
+};
+
#ifdef _KERNEL
#include <sys/timeout.h>
@@ -671,7 +678,7 @@ int checkreplaywindow(struct tdb *, u_int64_t, u_int32_t, u_int32_t *, int);
int ipsp_process_packet(struct mbuf *, struct tdb *, int, int);
int ipsp_process_done(struct mbuf *, struct tdb *);
int ipsp_spd_lookup(struct mbuf *, int, int, int, struct tdb *,
- const u_char[], struct tdb **, struct ipsec_ids *);
+ const struct ipsec_level *, struct tdb **, struct ipsec_ids *);
int ipsp_is_unspecified(union sockaddr_union);
int ipsp_aux_match(struct tdb *, struct ipsec_ids *,
struct sockaddr_encap *, struct sockaddr_encap *);