aboutsummaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1999-12-29 04:46:21 +0000
committerPeter Wemm <peter@FreeBSD.org>1999-12-29 04:46:21 +0000
commit664a31e4967a61ec61870f45adc2f1400617993e (patch)
treef6e6a9488aad27e9b1298da3083e214c1c209505 /sys/net
parenta0b57fb738b797a1aa540b8360260b19b6470bc4 (diff)
downloadsrc-664a31e4967a61ec61870f45adc2f1400617993e.tar.gz
src-664a31e4967a61ec61870f45adc2f1400617993e.zip
Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
Notes
Notes: svn path=/head/; revision=55205
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.h4
-rw-r--r--sys/net/bpf_filter.c22
-rw-r--r--sys/net/bridge.h5
-rw-r--r--sys/net/ethernet.h4
-rw-r--r--sys/net/fddi.h2
-rw-r--r--sys/net/hostcache.h4
-rw-r--r--sys/net/if.h8
-rw-r--r--sys/net/if_arp.h2
-rw-r--r--sys/net/if_atm.h7
-rw-r--r--sys/net/if_dl.h4
-rw-r--r--sys/net/if_media.h4
-rw-r--r--sys/net/if_sppp.h2
-rw-r--r--sys/net/if_var.h8
-rw-r--r--sys/net/if_vlan_var.h6
-rw-r--r--sys/net/netisr.h2
-rw-r--r--sys/net/pfkeyv2.h4
-rw-r--r--sys/net/radix.c4
-rw-r--r--sys/net/radix.h4
-rw-r--r--sys/net/raw_cb.h2
-rw-r--r--sys/net/route.h2
-rw-r--r--sys/net/slcompress.c2
-rw-r--r--sys/net/zlib.c8
-rw-r--r--sys/net/zlib.h2
23 files changed, 54 insertions, 58 deletions
diff --git a/sys/net/bpf.h b/sys/net/bpf.h
index d3ab193146bf..9b04c82944c2 100644
--- a/sys/net/bpf.h
+++ b/sys/net/bpf.h
@@ -129,7 +129,7 @@ struct bpf_hdr {
* will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work.
* Only the kernel needs to know about it; applications use bh_hdrlen.
*/
-#ifdef KERNEL
+#ifdef _KERNEL
#define SIZEOF_BPF_HDR (sizeof(struct bpf_hdr) <= 20 ? 18 : \
sizeof(struct bpf_hdr))
#endif
@@ -225,7 +225,7 @@ struct bpf_insn {
#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
-#ifdef KERNEL
+#ifdef _KERNEL
int bpf_validate __P((const struct bpf_insn *, int));
void bpf_tap __P((struct ifnet *, u_char *, u_int));
void bpf_mtap __P((struct ifnet *, struct mbuf *));
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c
index 0b2ed9e0d316..4f9bcf7cd2a0 100644
--- a/sys/net/bpf_filter.c
+++ b/sys/net/bpf_filter.c
@@ -65,11 +65,11 @@
(u_int32_t)*((u_char *)p+3)<<0)
#endif
-#ifdef KERNEL
+#ifdef _KERNEL
#include <sys/mbuf.h>
#endif
#include <net/bpf.h>
-#ifdef KERNEL
+#ifdef _KERNEL
#define MINDEX(m, k) \
{ \
register int len = m->m_len; \
@@ -204,7 +204,7 @@ bpf_filter(pc, p, wirelen, buflen)
switch (pc->code) {
default:
-#ifdef KERNEL
+#ifdef _KERNEL
return 0;
#else
abort();
@@ -218,7 +218,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_W|BPF_ABS:
k = pc->k;
if (k > buflen || sizeof(int32_t) > buflen - k) {
-#ifdef KERNEL
+#ifdef _KERNEL
int merr;
if (buflen != 0)
@@ -242,7 +242,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_H|BPF_ABS:
k = pc->k;
if (k > buflen || sizeof(int16_t) > buflen - k) {
-#ifdef KERNEL
+#ifdef _KERNEL
int merr;
if (buflen != 0)
@@ -259,7 +259,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_B|BPF_ABS:
k = pc->k;
if (k >= buflen) {
-#ifdef KERNEL
+#ifdef _KERNEL
register struct mbuf *m;
if (buflen != 0)
@@ -287,7 +287,7 @@ bpf_filter(pc, p, wirelen, buflen)
k = X + pc->k;
if (pc->k > buflen || X > buflen - pc->k ||
sizeof(int32_t) > buflen - k) {
-#ifdef KERNEL
+#ifdef _KERNEL
int merr;
if (buflen != 0)
@@ -312,7 +312,7 @@ bpf_filter(pc, p, wirelen, buflen)
k = X + pc->k;
if (X > buflen || pc->k > buflen - X ||
sizeof(int16_t) > buflen - k) {
-#ifdef KERNEL
+#ifdef _KERNEL
int merr;
if (buflen != 0)
@@ -331,7 +331,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LD|BPF_B|BPF_IND:
k = X + pc->k;
if (pc->k >= buflen || X >= buflen - pc->k) {
-#ifdef KERNEL
+#ifdef _KERNEL
register struct mbuf *m;
if (buflen != 0)
@@ -350,7 +350,7 @@ bpf_filter(pc, p, wirelen, buflen)
case BPF_LDX|BPF_MSH|BPF_B:
k = pc->k;
if (k >= buflen) {
-#ifdef KERNEL
+#ifdef _KERNEL
register struct mbuf *m;
if (buflen != 0)
@@ -507,7 +507,7 @@ bpf_filter(pc, p, wirelen, buflen)
}
}
-#ifdef KERNEL
+#ifdef _KERNEL
/*
* Return true if the 'fcode' is a valid filter program.
* The constraints are that each jump be forward and to a valid
diff --git a/sys/net/bridge.h b/sys/net/bridge.h
index e151e4e6ac7d..d8cb94d5f47a 100644
--- a/sys/net/bridge.h
+++ b/sys/net/bridge.h
@@ -22,6 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * $FreeBSD$
*/
extern int do_bridge;
@@ -99,7 +100,7 @@ struct bdg_stats {
#define BDG_STAT(ifp, type) bdg_stats.s[ifp->if_index].p_in[(int)type]++
-#ifdef KERNEL
+#ifdef _KERNEL
/*
* Find the right pkt destination:
* BDG_BCAST is a broadcast
@@ -139,4 +140,4 @@ bridge_dst_lookup(struct mbuf *m)
return BDG_UNKNOWN ;
}
-#endif /* KERNEL */
+#endif /* _KERNEL */
diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h
index 8e982d755f9b..7295e5a40d3f 100644
--- a/sys/net/ethernet.h
+++ b/sys/net/ethernet.h
@@ -80,7 +80,7 @@ struct ether_addr {
#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#ifndef KERNEL
+#ifndef _KERNEL
#include <sys/cdefs.h>
/*
@@ -93,6 +93,6 @@ int ether_line __P((char *, struct ether_addr *, char *));
char *ether_ntoa __P((struct ether_addr *));
int ether_ntohost __P((char *, struct ether_addr *));
__END_DECLS
-#endif /* !KERNEL */
+#endif
#endif /* !_NET_ETHERNET_H_ */
diff --git a/sys/net/fddi.h b/sys/net/fddi.h
index fc6acc6c9c8f..9f83882cdf10 100644
--- a/sys/net/fddi.h
+++ b/sys/net/fddi.h
@@ -69,7 +69,7 @@ struct fddi_header {
#define FDDIFC_LLC_SYNC 0xd0
#define FDDIFC_SMT 0x40
-#if defined(KERNEL) || defined(_KERNEL)
+#if defined(_KERNEL)
#define fddibroadcastaddr etherbroadcastaddr
#define fddi_ipmulticast_min ether_ipmulticast_min
#define fddi_ipmulticast_max ether_ipmulticast_max
diff --git a/sys/net/hostcache.h b/sys/net/hostcache.h
index 6ffb9ace5e3a..3158db9dc8c3 100644
--- a/sys/net/hostcache.h
+++ b/sys/net/hostcache.h
@@ -75,7 +75,7 @@ struct hctable {
int hct_primes;
};
-#ifdef KERNEL
+#ifdef _KERNEL
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_HOSTCACHE);
@@ -90,6 +90,6 @@ void hc_ref(struct hcentry *hc);
void hc_rele(struct hcentry *hc);
int hc_insert(struct hcentry *hc);
int hc_delete(struct hcentry *hc);
-#endif /* KERNEL */
+#endif
#endif /* _NET_HOSTCACHE_H */
diff --git a/sys/net/if.h b/sys/net/if.h
index 350e6d86ab11..0e0ff819e039 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -41,7 +41,7 @@
* <net/if.h> does not depend on <sys/time.h> on most other systems. This
* helps userland compatability. (struct timeval ifi_lastchange)
*/
-#ifndef KERNEL
+#ifndef _KERNEL
#include <sys/time.h>
#endif
@@ -241,14 +241,14 @@ struct if_laddrreq {
struct sockaddr_storage dstaddr; /* out */
};
-#ifdef KERNEL
+#ifdef _KERNEL
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_IFADDR);
MALLOC_DECLARE(M_IFMADDR);
#endif
#endif
-#ifndef KERNEL
+#ifndef _KERNEL
struct if_nameindex {
u_int if_index; /* 1, 2, ... */
char *if_name; /* null terminated name: "le0", ... */
@@ -262,7 +262,7 @@ void if_freenameindex __P((struct if_nameindex *));
__END_DECLS
#endif
-#ifdef KERNEL
+#ifdef _KERNEL
struct proc;
int prison_if __P((struct proc *p, struct sockaddr *sa));
diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h
index 52eeb26876e3..5bfbe4b65567 100644
--- a/sys/net/if_arp.h
+++ b/sys/net/if_arp.h
@@ -89,7 +89,7 @@ struct arpreq {
#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
#define ATF_USETRAILERS 0x10 /* has requested trailers */
-#ifdef KERNEL
+#ifdef _KERNEL
/*
* Structure shared between the ethernet driver modules and
* the address resolution code. For example, each ec_softc or il_softc
diff --git a/sys/net/if_atm.h b/sys/net/if_atm.h
index 16b32a65d3d5..fbd27926b271 100644
--- a/sys/net/if_atm.h
+++ b/sys/net/if_atm.h
@@ -1,4 +1,5 @@
/* $NetBSD: if_atm.h,v 1.7 1996/11/09 23:02:27 chuck Exp $ */
+/* $FreeBSD$ */
/*
*
@@ -36,12 +37,6 @@
* net/if_atm.h
*/
-#if (defined(__FreeBSD__) || defined(__bsdi__)) && defined(KERNEL)
-#ifndef _KERNEL
-#define _KERNEL
-#endif
-#endif /* freebsd doesn't define _KERNEL */
-
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
#define RTALLOC1(A,B) rtalloc1((A),(B))
#elif defined(__FreeBSD__)
diff --git a/sys/net/if_dl.h b/sys/net/if_dl.h
index aac7c1439dce..92ea90f921ab 100644
--- a/sys/net/if_dl.h
+++ b/sys/net/if_dl.h
@@ -74,7 +74,7 @@ struct sockaddr_dl {
#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
-#ifndef KERNEL
+#ifndef _KERNEL
#include <sys/cdefs.h>
@@ -83,6 +83,6 @@ void link_addr __P((const char *, struct sockaddr_dl *));
char *link_ntoa __P((const struct sockaddr_dl *));
__END_DECLS
-#endif /* !KERNEL */
+#endif /* !_KERNEL */
#endif
diff --git a/sys/net/if_media.h b/sys/net/if_media.h
index 1708559c08cc..2ed5ed0171c7 100644
--- a/sys/net/if_media.h
+++ b/sys/net/if_media.h
@@ -50,7 +50,7 @@
* to implement this interface.
*/
-#ifdef KERNEL
+#ifdef _KERNEL
#include <sys/queue.h>
@@ -104,7 +104,7 @@ void ifmedia_set __P((struct ifmedia *ifm, int mword));
int ifmedia_ioctl __P((struct ifnet *ifp, struct ifreq *ifr,
struct ifmedia *ifm, u_long cmd));
-#endif /*KERNEL */
+#endif /*_KERNEL */
/*
* if_media Options word:
diff --git a/sys/net/if_sppp.h b/sys/net/if_sppp.h
index 5d47287a4f11..84fede39716d 100644
--- a/sys/net/if_sppp.h
+++ b/sys/net/if_sppp.h
@@ -161,7 +161,7 @@ struct spppreq {
struct sppp defs;
};
-#ifdef KERNEL
+#ifdef _KERNEL
void sppp_attach (struct ifnet *ifp);
void sppp_detach (struct ifnet *ifp);
void sppp_input (struct ifnet *ifp, struct mbuf *m);
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 8d497d4d1f66..80de848d11aa 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -210,7 +210,7 @@ typedef void if_init_f_t __P((void *));
} \
}
-#ifdef KERNEL
+#ifdef _KERNEL
#define IF_ENQ_DROP(ifq, m) if_enq_drop(ifq, m)
#if defined(__GNUC__) && defined(MT_HEADER)
@@ -245,7 +245,7 @@ int if_enq_drop __P((struct ifqueue *, struct mbuf *));
#define IF_MINMTU 72
#define IF_MAXMTU 65535
-#endif /* KERNEL */
+#endif /* _KERNEL */
/*
* The ifaddr structure contains information about one address
@@ -306,7 +306,7 @@ struct ifmultiaddr {
void *ifma_protospec; /* protocol-specific state, if any */
};
-#ifdef KERNEL
+#ifdef _KERNEL
#define IFAFREE(ifa) \
do { \
if ((ifa)->ifa_refcnt <= 0) \
@@ -364,7 +364,7 @@ struct ifmultiaddr *ifmaof_ifpforaddr __P((struct sockaddr *,
int if_simloop __P((struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, int hlen));
-#endif /* KERNEL */
+#endif /* _KERNEL */
#endif /* !_NET_IF_VAR_H_ */
diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h
index 1427b34ea84f..8fbe10ca1ac9 100644
--- a/sys/net/if_vlan_var.h
+++ b/sys/net/if_vlan_var.h
@@ -32,7 +32,7 @@
#ifndef _NET_IF_VLAN_VAR_H_
#define _NET_IF_VLAN_VAR_H_ 1
-#ifdef KERNEL
+#ifdef _KERNEL
struct vlan_mc_entry {
struct ether_addr mc_addr;
SLIST_ENTRY(vlan_mc_entry) mc_entries;
@@ -50,7 +50,7 @@ struct ifvlan {
};
#define ifv_if ifv_ac.ac_if
#define ifv_tag ifv_mib.ifvm_tag
-#endif /* KERNEL */
+#endif /* _KERNEL */
struct ether_vlan_header {
u_char evl_dhost[ETHER_ADDR_LEN];
@@ -81,7 +81,7 @@ struct vlanreq {
#define SIOCSETVLAN SIOCSIFGENERIC
#define SIOCGETVLAN SIOCGIFGENERIC
-#ifdef KERNEL
+#ifdef _KERNEL
/* shared with if_ethersubr.c: */
extern u_int vlan_proto;
extern int vlan_input(struct ether_header *eh, struct mbuf *m);
diff --git a/sys/net/netisr.h b/sys/net/netisr.h
index 432607cf9840..b1e32f39e3e9 100644
--- a/sys/net/netisr.h
+++ b/sys/net/netisr.h
@@ -73,7 +73,7 @@
#define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); }
#ifndef LOCORE
-#ifdef KERNEL
+#ifdef _KERNEL
extern volatile unsigned int netisr; /* scheduling bits for network */
typedef void netisr_t __P((void));
diff --git a/sys/net/pfkeyv2.h b/sys/net/pfkeyv2.h
index ac509e0922bd..8f2cace27c1b 100644
--- a/sys/net/pfkeyv2.h
+++ b/sys/net/pfkeyv2.h
@@ -362,7 +362,7 @@ struct sadb_x_ipsecrequest {
#define PFKEY_UNUNIT64(a) ((a) << 3)
#define PFKEY_UNIT64(a) ((a) >> 3)
-#ifndef KERNEL
+#ifndef _KERNEL
extern void pfkey_sadump(struct sadb_msg *m);
extern void pfkey_spdump(struct sadb_msg *m);
@@ -413,7 +413,7 @@ int pfkey_send __P((int so, struct sadb_msg *msg, int len));
int pfkey_align __P((struct sadb_msg *msg, caddr_t *mhp));
int pfkey_check __P((caddr_t *mhp));
-#endif /*!KERNEL*/
+#endif /*!_KERNEL*/
#endif /* __PFKEY_V2_H */
diff --git a/sys/net/radix.c b/sys/net/radix.c
index 55887eb61eb9..9dbbf97c7a5f 100644
--- a/sys/net/radix.c
+++ b/sys/net/radix.c
@@ -39,7 +39,7 @@
*/
#ifndef _RADIX_H_
#include <sys/param.h>
-#ifdef KERNEL
+#ifdef _KERNEL
#include <sys/systm.h>
#include <sys/malloc.h>
#define M_DONTWAIT M_NOWAIT
@@ -1003,7 +1003,7 @@ void
rn_init()
{
char *cp, *cplim;
-#ifdef KERNEL
+#ifdef _KERNEL
struct domain *dom;
for (dom = domains; dom; dom = dom->dom_next)
diff --git a/sys/net/radix.h b/sys/net/radix.h
index f68f67aaecd5..899d53538370 100644
--- a/sys/net/radix.h
+++ b/sys/net/radix.h
@@ -140,7 +140,7 @@ struct radix_node_head {
struct radix_node rnh_nodes[3]; /* empty tree for common case */
};
-#ifndef KERNEL
+#ifndef _KERNEL
#define Bcmp(a, b, n) bcmp(((char *)(a)), ((char *)(b)), (n))
#define Bcopy(a, b, n) bcopy(((char *)(a)), ((char *)(b)), (unsigned)(n))
#define Bzero(p, n) bzero((char *)(p), (int)(n));
@@ -152,7 +152,7 @@ struct radix_node_head {
#define Bzero(p, n) bzero((caddr_t)(p), (unsigned)(n));
#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_DONTWAIT))
#define Free(p) free((caddr_t)p, M_RTABLE);
-#endif /*KERNEL*/
+#endif /* _KERNEL */
void rn_init __P((void));
int rn_inithead __P((void **, int));
diff --git a/sys/net/raw_cb.h b/sys/net/raw_cb.h
index 5184de6f1376..6c079a92878f 100644
--- a/sys/net/raw_cb.h
+++ b/sys/net/raw_cb.h
@@ -59,7 +59,7 @@ struct rawcb {
#define RAWSNDQ 8192
#define RAWRCVQ 8192
-#ifdef KERNEL
+#ifdef _KERNEL
extern LIST_HEAD(rawcb_list_head, rawcb) rawcb_list;
int raw_attach __P((struct socket *, int));
diff --git a/sys/net/route.h b/sys/net/route.h
index 255fbe3ed897..68d21fc778eb 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -259,7 +259,7 @@ struct route_cb {
int any_count;
};
-#ifdef KERNEL
+#ifdef _KERNEL
#define RTFREE(rt) \
do { \
if ((rt)->rt_refcnt <= 1) \
diff --git a/sys/net/slcompress.c b/sys/net/slcompress.c
index 200e9c17e969..d72d02dcd556 100644
--- a/sys/net/slcompress.c
+++ b/sys/net/slcompress.c
@@ -62,7 +62,7 @@
#define BCMP(p1, p2, n) bcmp((char *)(p1), (char *)(p2), (int)(n))
#define BCOPY(p1, p2, n) bcopy((char *)(p1), (char *)(p2), (int)(n))
-#ifndef KERNEL
+#ifndef _KERNEL
#define ovbcopy bcopy
#endif
diff --git a/sys/net/zlib.c b/sys/net/zlib.c
index 64c4ad0eaf6a..19df8590db24 100644
--- a/sys/net/zlib.c
+++ b/sys/net/zlib.c
@@ -24,7 +24,7 @@
#define NO_ZCFUNCS
#define MY_ZCALLOC
-#if defined(__FreeBSD__) && (defined(KERNEL) || defined(_KERNEL))
+#if defined(__FreeBSD__) && defined(_KERNEL)
#define inflate inflate_ppp /* FreeBSD already has an inflate :-( */
#endif
@@ -45,13 +45,13 @@
#ifndef _Z_UTIL_H
#define _Z_UTIL_H
-#ifdef KERNEL
+#ifdef _KERNEL
#include <net/zlib.h>
#else
#include "zlib.h"
#endif
-#if defined(KERNEL) || defined(_KERNEL)
+#ifdef _KERNEL
/* Assume this is a *BSD or SVR4 kernel */
#include <sys/types.h>
#include <sys/time.h>
@@ -80,7 +80,7 @@
# include <stdlib.h>
#endif
#endif /* __KERNEL__ */
-#endif /* _KERNEL || KERNEL */
+#endif /* _KERNEL */
#ifndef local
# define local static
diff --git a/sys/net/zlib.h b/sys/net/zlib.h
index 1f3ee5049f10..7316305ba2f3 100644
--- a/sys/net/zlib.h
+++ b/sys/net/zlib.h
@@ -507,7 +507,7 @@ extern int EXPORT inflateInit OF((z_streamp strm));
done by inflate().
*/
-#if defined(__FreeBSD__) && (defined(KERNEL) || defined(_KERNEL))
+#if defined(__FreeBSD__) && defined(_KERNEL)
#define inflate inflate_ppp /* FreeBSD already has an inflate :-( */
#endif