From fde9648734bce1be3f68d02144f23c4ce62fe090 Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 19 Jan 2015 16:49:04 +0000 Subject: [PATCH] First step of hiding many kernel-only parts of 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 --- sys/netinet/ip_ipsp.h | 14 ++++++++++++-- usr.bin/netstat/route.c | 4 ++-- 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 -#include +#ifdef _KERNEL #include +#endif +#include #include 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 #define _KERNEL #include +#include #undef _KERNEL #include #include @@ -54,7 +55,6 @@ #include #include -#include #include "netstat.h" /* alignment constraint for routing socket */ -- 2.20.1