summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-19 16:49:04 +0000
committerderaadt <deraadt@openbsd.org>2015-01-19 16:49:04 +0000
commitfde9648734bce1be3f68d02144f23c4ce62fe090 (patch)
tree596d00c10e2bc78b1c968d6984e339cf2570e6f5
parentcleanup of the SMALL hiding from Mathias Svensson (diff)
downloadwireguard-openbsd-fde9648734bce1be3f68d02144f23c4ce62fe090.tar.xz
wireguard-openbsd-fde9648734bce1be3f68d02144f23c4ce62fe090.zip
First step of hiding many kernel-only parts of <netinet/ip_ipsp.h>
under _KERNEL, and adjust the one consumer (netstat) so that it requests the exposure. Will take a few more rounds to get this right. ok mikeb
-rw-r--r--sys/netinet/ip_ipsp.h14
-rw-r--r--usr.bin/netstat/route.c4
2 files changed, 14 insertions, 4 deletions
diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h
index 6192a97136b..39258488cfc 100644
--- a/sys/netinet/ip_ipsp.h
+++ b/sys/netinet/ip_ipsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.h,v 1.158 2014/12/23 03:24:08 tedu Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.159 2015/01/19 16:49:05 deraadt Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -45,8 +45,10 @@ struct m_tag;
/* IPSP global definitions. */
#include <sys/types.h>
-#include <sys/queue.h>
+#ifdef _KERNEL
#include <sys/timeout.h>
+#endif
+#include <sys/queue.h>
#include <netinet/in.h>
union sockaddr_union {
@@ -133,6 +135,8 @@ struct sockaddr_encap {
#define IPSP_DIRECTION_IN 0x1
#define IPSP_DIRECTION_OUT 0x2
+#ifdef _KERNEL
+
#define sen_data Sen.Data
#define sen_ip_src Sen.Sip4.Src
#define sen_ip_dst Sen.Sip4.Dst
@@ -182,6 +186,8 @@ struct ipsec_acquire {
TAILQ_ENTRY(ipsec_acquire) ipa_inp_next;
};
+#endif /* _KERNEL */
+
struct ipsec_policy {
struct sockaddr_encap ipo_addr;
struct sockaddr_encap ipo_mask;
@@ -219,6 +225,8 @@ struct ipsec_policy {
TAILQ_ENTRY(ipsec_policy) ipo_list; /* List of all policies */
};
+#ifdef _KERNEL
+
#define IPSP_POLICY_NONE 0x0000 /* No flags set */
#define IPSP_POLICY_SOCKET 0x0001 /* Socket-attached policy */
#define IPSP_POLICY_STATIC 0x0002 /* Static policy */
@@ -377,6 +385,8 @@ struct tdb { /* tunnel descriptor block */
TAILQ_ENTRY(tdb) tdb_sync_entry;
};
+#endif /* _KERNEL */
+
struct tdb_ident {
u_int32_t spi;
union sockaddr_union dst;
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index dabfdcc0a9d..6b8bcb8ff65 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.95 2015/01/16 06:40:10 deraadt Exp $ */
+/* $OpenBSD: route.c,v 1.96 2015/01/19 16:49:04 deraadt Exp $ */
/* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */
/*
@@ -40,6 +40,7 @@
#include <net/if_types.h>
#define _KERNEL
#include <net/route.h>
+#include <netinet/ip_ipsp.h>
#undef _KERNEL
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -54,7 +55,6 @@
#include <string.h>
#include <unistd.h>
-#include <netinet/ip_ipsp.h>
#include "netstat.h"
/* alignment constraint for routing socket */