summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-10-24 18:50:16 +0000
committerderaadt <deraadt@openbsd.org>2013-10-24 18:50:16 +0000
commitcca880e494f8d9132ef0e07578201df66bfed813 (patch)
treedd0f990aae4736371fe36e2ab5cfe19651cb80a9
parentback out to 1.33, subtle bug being hunted... (diff)
downloadwireguard-openbsd-cca880e494f8d9132ef0e07578201df66bfed813.tar.xz
wireguard-openbsd-cca880e494f8d9132ef0e07578201df66bfed813.zip
Move more stuff under _KERNEL
ok claudio
-rw-r--r--sys/net/netisr.h7
-rw-r--r--sys/net/pfkeyv2.h3
-rw-r--r--sys/net/radix.h3
-rw-r--r--sys/net/radix_mpath.h4
-rw-r--r--sys/net/raw_cb.h8
-rw-r--r--sys/net/route.h7
-rw-r--r--sys/net/slcompress.h4
-rw-r--r--sys/net/slip.h3
-rw-r--r--sys/net/trunklacp.h93
9 files changed, 72 insertions, 60 deletions
diff --git a/sys/net/netisr.h b/sys/net/netisr.h
index d0602afbfde..a554a24cb4f 100644
--- a/sys/net/netisr.h
+++ b/sys/net/netisr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: netisr.h,v 1.38 2013/08/20 09:14:24 mpi Exp $ */
+/* $OpenBSD: netisr.h,v 1.39 2013/10/24 18:50:16 deraadt Exp $ */
/* $NetBSD: netisr.h,v 1.12 1995/08/12 23:59:24 mycroft Exp $ */
/*
@@ -34,6 +34,7 @@
#ifndef _NET_NETISR_H_
#define _NET_NETISR_H_
+
/*
* The networking code runs off software interrupts.
*
@@ -90,7 +91,7 @@ do { \
void netisr_init(void);
-#endif
-#endif
+#endif /* _KERNEL */
+#endif /*_LOCORE */
#endif /* _NET_NETISR_H_ */
diff --git a/sys/net/pfkeyv2.h b/sys/net/pfkeyv2.h
index 4c63e48f241..ace99172939 100644
--- a/sys/net/pfkeyv2.h
+++ b/sys/net/pfkeyv2.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2.h,v 1.63 2013/03/09 02:27:07 deraadt Exp $ */
+/* $OpenBSD: pfkeyv2.h,v 1.64 2013/10/24 18:50:16 deraadt Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) January 1998
*
@@ -478,4 +478,5 @@ void import_udpencap(struct tdb *, struct sadb_x_udpencap *);
void import_tag(struct tdb *, struct sadb_x_tag *);
void import_tap(struct tdb *, struct sadb_x_tap *);
#endif /* _KERNEL */
+
#endif /* _NET_PFKEY_V2_H_ */
diff --git a/sys/net/radix.h b/sys/net/radix.h
index 36cfceca6aa..a8e3621921d 100644
--- a/sys/net/radix.h
+++ b/sys/net/radix.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: radix.h,v 1.19 2012/12/28 17:52:06 gsoares Exp $ */
+/* $OpenBSD: radix.h,v 1.20 2013/10/24 18:50:16 deraadt Exp $ */
/* $NetBSD: radix.h,v 1.8 1996/02/13 22:00:37 christos Exp $ */
/*
@@ -154,4 +154,5 @@ struct radix_node *rn_lookup(void *, void *, struct radix_node_head *);
struct radix_node *rn_match(void *, struct radix_node_head *);
#endif /* _KERNEL */
+
#endif /* _NET_RADIX_H_ */
diff --git a/sys/net/radix_mpath.h b/sys/net/radix_mpath.h
index 9312ca4f9d0..1b49416a14e 100644
--- a/sys/net/radix_mpath.h
+++ b/sys/net/radix_mpath.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: radix_mpath.h,v 1.10 2013/10/20 16:17:37 claudio Exp $ */
+/* $OpenBSD: radix_mpath.h,v 1.11 2013/10/24 18:50:16 deraadt Exp $ */
/* $KAME: radix_mpath.h,v 1.9 2004/03/30 11:21:49 keiichi Exp $ */
/*
@@ -55,6 +55,6 @@ int rt_mpath_conflict(struct radix_node_head *, struct rtentry *,
struct sockaddr *, int);
void rtalloc_mpath(struct route *, u_int32_t *);
int rn_mpath_inithead(void **, int);
-#endif
+#endif /* _KERNEL */
#endif /* _NET_RADIX_MPATH_H_ */
diff --git a/sys/net/raw_cb.h b/sys/net/raw_cb.h
index 39040cbdeb1..e5102887e5c 100644
--- a/sys/net/raw_cb.h
+++ b/sys/net/raw_cb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_cb.h,v 1.8 2009/11/13 20:54:05 claudio Exp $ */
+/* $OpenBSD: raw_cb.h,v 1.9 2013/10/24 18:50:16 deraadt Exp $ */
/* $NetBSD: raw_cb.h,v 1.9 1996/02/13 22:00:41 christos Exp $ */
/*
@@ -47,8 +47,6 @@ struct rawcb {
struct sockproto rcb_proto; /* protocol family, protocol */
};
-#define sotorawcb(so) ((struct rawcb *)(so)->so_pcb)
-
/*
* Nominal space allocated to a raw socket.
*/
@@ -56,8 +54,10 @@ struct rawcb {
#define RAWRCVQ 8192
#ifdef _KERNEL
+
extern LIST_HEAD(rawcbhead, rawcb) rawcb; /* head of list */
+#define sotorawcb(so) ((struct rawcb *)(so)->so_pcb)
int raw_attach(struct socket *, int);
void *raw_ctlinput(int, struct sockaddr *, u_int, void *);
void raw_detach(struct rawcb *);
@@ -66,6 +66,6 @@ void raw_init(void);
void raw_input(struct mbuf *, ...);
int raw_usrreq(struct socket *,
int, struct mbuf *, struct mbuf *, struct mbuf *, struct proc *);
-
#endif /* _KERNEL */
+
#endif /* _NET_RAW_CB_H_ */
diff --git a/sys/net/route.h b/sys/net/route.h
index 4dc68b78f91..be189441e14 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.h,v 1.81 2013/10/24 11:14:35 deraadt Exp $ */
+/* $OpenBSD: route.h,v 1.82 2013/10/24 18:50:16 deraadt Exp $ */
/* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */
/*
@@ -35,8 +35,6 @@
#ifndef _NET_ROUTE_H_
#define _NET_ROUTE_H_
-#include <sys/queue.h>
-
/*
* Kernel resident routing tables.
*
@@ -83,6 +81,9 @@ struct rt_metrics {
#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
#ifdef _KERNEL
+
+#include <sys/queue.h>
+
/*
* We distinguish between routes to hosts and routes to networks,
* preferring the former if available. For each route we infer
diff --git a/sys/net/slcompress.h b/sys/net/slcompress.h
index ea65d59dfa7..62d03779c65 100644
--- a/sys/net/slcompress.h
+++ b/sys/net/slcompress.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: slcompress.h,v 1.8 2013/10/24 11:14:35 deraadt Exp $ */
+/* $OpenBSD: slcompress.h,v 1.9 2013/10/24 18:50:16 deraadt Exp $ */
/* $NetBSD: slcompress.h,v 1.11 1997/05/17 21:12:11 christos Exp $ */
/*
@@ -109,6 +109,7 @@
#define TCP_PUSH_BIT 0x10
+#ifdef _KERNEL
/*
* "state" data for each active tcp conversation on the wire. This is
@@ -154,7 +155,6 @@ struct slcompress {
/* flag values */
#define SLF_TOSS 1 /* tossing rcvd frames because of input err */
-#ifdef _KERNEL
void sl_compress_init(struct slcompress *);
void sl_compress_setup(struct slcompress *, int);
u_int sl_compress_tcp(struct mbuf *,
diff --git a/sys/net/slip.h b/sys/net/slip.h
index c2b9d73541a..14d8675aff1 100644
--- a/sys/net/slip.h
+++ b/sys/net/slip.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: slip.h,v 1.4 2003/06/02 23:28:12 millert Exp $ */
+/* $OpenBSD: slip.h,v 1.5 2013/10/24 18:50:16 deraadt Exp $ */
/* $NetBSD: slip.h,v 1.6 1994/06/29 06:36:53 cgd Exp $ */
/*-
@@ -51,4 +51,5 @@
#define SLIPDIR_IN 0 /* incoming */
#define SLIPDIR_OUT 1 /* outgoing */
+
#endif /* _NET_SLIP_H_ */
diff --git a/sys/net/trunklacp.h b/sys/net/trunklacp.h
index 97489ce66df..bdee00b27c1 100644
--- a/sys/net/trunklacp.h
+++ b/sys/net/trunklacp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: trunklacp.h,v 1.6 2013/10/24 11:14:35 deraadt Exp $ */
+/* $OpenBSD: trunklacp.h,v 1.7 2013/10/24 18:50:16 deraadt Exp $ */
/* $NetBSD: ieee8023ad_impl.h,v 1.2 2005/12/10 23:21:39 elad Exp $ */
/*
@@ -29,46 +29,8 @@
* $FreeBSD: src/sys/net/ieee8023ad_lacp.h,v 1.11 2008/03/17 01:26:44 thompsa Exp $
*/
-/*
- * IEEE802.3ad LACP implementation details.
- */
-#define LACP_TIMER_CURRENT_WHILE 0
-#define LACP_TIMER_PERIODIC 1
-#define LACP_TIMER_WAIT_WHILE 2
-#define LACP_NTIMER 3
-
-#define LACP_TIMER_ARM(port, timer, val) \
- (port)->lp_timer[(timer)] = (val)
-#define LACP_TIMER_DISARM(port, timer) \
- (port)->lp_timer[(timer)] = 0
-#define LACP_TIMER_ISARMED(port, timer) \
- ((port)->lp_timer[(timer)] > 0)
-
-/*
- * IEEE802.3ad LACP protocol definitions.
- */
-#define LACP_STATE_ACTIVITY (1<<0)
-#define LACP_STATE_TIMEOUT (1<<1)
-#define LACP_STATE_AGGREGATION (1<<2)
-#define LACP_STATE_SYNC (1<<3)
-#define LACP_STATE_COLLECTING (1<<4)
-#define LACP_STATE_DISTRIBUTING (1<<5)
-#define LACP_STATE_DEFAULTED (1<<6)
-#define LACP_STATE_EXPIRED (1<<7)
-
-#define LACP_PORT_NTT 0x00000001
-#define LACP_PORT_MARK 0x00000002
-
-#define LACP_STATE_BITS \
- "\020" \
- "\001ACTIVITY" \
- "\002TIMEOUT" \
- "\003AGGREGATION" \
- "\004SYNC" \
- "\005COLLECTING" \
- "\006DISTRIBUTING" \
- "\007DEFAULTED" \
- "\010EXPIRED"
+#ifndef _NET_TRUNKLACP_H_
+#define _NET_TRUNKLACP_H_
/*
* IEEE802.3 slow protocols (on-wire) definitions.
@@ -147,6 +109,49 @@ struct lacp_markerinfo {
u_int8_t mi_pad[2];
} __packed;
+#ifdef _KERNEL
+
+/*
+ * IEEE802.3ad LACP implementation details.
+ */
+#define LACP_TIMER_CURRENT_WHILE 0
+#define LACP_TIMER_PERIODIC 1
+#define LACP_TIMER_WAIT_WHILE 2
+#define LACP_NTIMER 3
+
+#define LACP_TIMER_ARM(port, timer, val) \
+ (port)->lp_timer[(timer)] = (val)
+#define LACP_TIMER_DISARM(port, timer) \
+ (port)->lp_timer[(timer)] = 0
+#define LACP_TIMER_ISARMED(port, timer) \
+ ((port)->lp_timer[(timer)] > 0)
+
+/*
+ * IEEE802.3ad LACP protocol definitions.
+ */
+#define LACP_STATE_ACTIVITY (1<<0)
+#define LACP_STATE_TIMEOUT (1<<1)
+#define LACP_STATE_AGGREGATION (1<<2)
+#define LACP_STATE_SYNC (1<<3)
+#define LACP_STATE_COLLECTING (1<<4)
+#define LACP_STATE_DISTRIBUTING (1<<5)
+#define LACP_STATE_DEFAULTED (1<<6)
+#define LACP_STATE_EXPIRED (1<<7)
+
+#define LACP_PORT_NTT 0x00000001
+#define LACP_PORT_MARK 0x00000002
+
+#define LACP_STATE_BITS \
+ "\020" \
+ "\001ACTIVITY" \
+ "\002TIMEOUT" \
+ "\003AGGREGATION" \
+ "\004SYNC" \
+ "\005COLLECTING" \
+ "\006DISTRIBUTING" \
+ "\007DEFAULTED" \
+ "\010EXPIRED"
+
struct markerdu {
struct slowprothdr mdu_sph;
@@ -255,7 +260,6 @@ struct lacp_softc {
#define LACP_UNLOCK(_lsc) mtx_unlock(&(_lsc)->lsc_mtx)
#define LACP_LOCK_ASSERT(_lsc) mtx_assert(&(_lsc)->lsc_mtx, MA_OWNED)
-#ifdef _KERNEL
struct mbuf *lacp_input(struct trunk_port *,
struct ether_header *, struct mbuf *);
struct trunk_port *lacp_select_tx_port(struct trunk_softc *, struct mbuf *);
@@ -269,7 +273,6 @@ void lacp_linkstate(struct trunk_port *);
void lacp_req(struct trunk_softc *, caddr_t);
void lacp_portreq(struct trunk_port *, caddr_t);
u_int lacp_port_status(struct trunk_port *);
-#endif /* _KERNEL */
/* following constants don't include terminating NUL */
#define LACP_MACSTR_MAX (2*6 + 5)
@@ -285,3 +288,7 @@ u_int lacp_port_status(struct trunk_port *);
#define LACP_LAGIDSTR_MAX \
(1 + LACP_PARTNERSTR_MAX + 1 + LACP_PARTNERSTR_MAX + 1)
#define LACP_STATESTR_MAX (255) /* XXX */
+
+#endif /* _KERNEL */
+
+#endif /* _NET_TRUNKLACP_H_ */