summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_disc.c5
-rw-r--r--sys/net/if_fddisubr.c4
-rw-r--r--sys/net/if_iso88025subr.c3
-rw-r--r--sys/net/if_loop.c33
-rw-r--r--sys/net/if_ppp.c8
-rw-r--r--sys/net/if_sl.c21
-rw-r--r--sys/net/if_tun.c11
-rw-r--r--sys/net/if_vlan.c11
8 files changed, 13 insertions, 83 deletions
diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c
index a1981f7..97e23b1 100644
--- a/sys/net/if_disc.c
+++ b/sys/net/if_disc.c
@@ -51,7 +51,6 @@
#include <net/route.h>
#include <net/bpf.h>
-#include "bpf.h"
#include "opt_inet.h"
#ifdef TINY_DSMTU
@@ -85,9 +84,7 @@ discattach(dummy)
ifp->if_hdrlen = 0;
ifp->if_addrlen = 0;
if_attach(ifp);
-#if NBPF > 0
bpfattach(ifp, DLT_NULL, sizeof(u_int));
-#endif
}
static int
@@ -99,7 +96,6 @@ discoutput(ifp, m, dst, rt)
{
if ((m->m_flags & M_PKTHDR) == 0)
panic("discoutput no HDR");
-#if NBPF > 0
/* BPF write needs to be handled specially */
if (dst->sa_family == AF_UNSPEC) {
dst->sa_family = *(mtod(m, int *));
@@ -125,7 +121,6 @@ discoutput(ifp, m, dst, rt)
bpf_mtap(&discif, &m0);
}
-#endif
m->m_pkthdr.rcvif = ifp;
ifp->if_opackets++;
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index c4d65ec..25409fd 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -105,8 +105,6 @@ extern u_char aarp_org_code[ 3 ];
extern struct ifqueue pkintrq;
#endif
-#include "bpf.h"
-
#define senderr(e) { error = (e); goto bad;}
/*
@@ -309,7 +307,6 @@ fddi_output(ifp, m0, dst, rt0)
break;
}
-#if NBPF > 0
case AF_IMPLINK:
{
fh = mtod(m, struct fddi_header *);
@@ -343,7 +340,6 @@ fddi_output(ifp, m0, dst, rt0)
m->m_flags |= (M_BCAST|M_MCAST);
goto queue_it;
}
-#endif
default:
printf("%s%d: can't handle af%d\n", ifp->if_name, ifp->if_unit,
dst->sa_family);
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c
index 495362b..0983fc0 100644
--- a/sys/net/if_iso88025subr.c
+++ b/sys/net/if_iso88025subr.c
@@ -68,10 +68,7 @@
#include <netinet/if_ether.h>
#endif
-#if NBPF > 0
#include <net/bpf.h>
-#include <net/bpfdesc.h>
-#endif
#include <machine/clock.h>
#include <machine/md_var.h>
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index e160790..de692e5 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -82,11 +82,6 @@
#include <netatalk/at_var.h>
#endif NETATALK
-#include "bpf.h"
-#if NBPF > 0
-#include <net/bpfdesc.h>
-#endif
-
static int loioctl __P((struct ifnet *, u_long, caddr_t));
static void lortrequest __P((int, struct rtentry *, struct sockaddr *));
@@ -122,9 +117,7 @@ loopattach(dummy)
ifp->if_type = IFT_LOOP;
ifp->if_snd.ifq_maxlen = ifqmaxlen;
if_attach(ifp);
-#if NBPF > 0
bpfattach(ifp, DLT_NULL, sizeof(u_int));
-#endif
}
}
@@ -186,7 +179,6 @@ if_simloop(ifp, m, dst, hlen)
if ((m->m_flags & M_PKTHDR) == 0)
panic("if_simloop: no HDR");
m->m_pkthdr.rcvif = ifp;
-#if NBPF > 0
/* BPF write needs to be handled specially */
if (dst->sa_family == AF_UNSPEC) {
dst->sa_family = *(mtod(m, int *));
@@ -199,22 +191,19 @@ if_simloop(ifp, m, dst, hlen)
struct mbuf m0, *n = m;
u_int af = dst->sa_family;
- if (ifp->if_bpf->bif_dlt == DLT_NULL) {
- /*
- * We need to prepend the address family as
- * a four byte field. Cons up a dummy header
- * to pacify bpf. This is safe because bpf
- * will only read from the mbuf (i.e., it won't
- * try to free it or keep a pointer a to it).
- */
- m0.m_next = m;
- m0.m_len = 4;
- m0.m_data = (char *)&af;
- n = &m0;
- }
+ /*
+ * We need to prepend the address family as
+ * a four byte field. Cons up a dummy header
+ * to pacify bpf. This is safe because bpf
+ * will only read from the mbuf (i.e., it won't
+ * try to free it or keep a pointer a to it).
+ */
+ m0.m_next = m;
+ m0.m_len = 4;
+ m0.m_data = (char *)&af;
+ n = &m0;
bpf_mtap(ifp, n);
}
-#endif
/* Strip away media header */
if (hlen > 0) {
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index f781204..edcc575a 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -113,9 +113,7 @@
#endif
#include "bpf.h"
-#if NBPF > 0
#include <net/bpf.h>
-#endif
#if defined(PPP_FILTER) && NBPF == 0
#error "PPP_FILTER requires bpf"
@@ -221,9 +219,7 @@ pppattach(dummy)
sc->sc_fastq.ifq_maxlen = IFQ_MAXLEN;
sc->sc_rawq.ifq_maxlen = IFQ_MAXLEN;
if_attach(&sc->sc_if);
-#if NBPF > 0
bpfattach(&sc->sc_if, DLT_PPP, PPP_HDRLEN);
-#endif
}
register_netisr(NETISR_PPP, pppintr);
/*
@@ -828,13 +824,11 @@ pppoutput(ifp, m0, dst, rtp)
#endif /* PPP_FILTER */
}
-#if NBPF > 0
/*
* See if bpf wants to look at the packet.
*/
if (ifp->if_bpf)
bpf_mtap(ifp, m0);
-#endif
/*
* Put the packet on the appropriate queue.
@@ -1463,11 +1457,9 @@ ppp_inproc(sc, m)
#endif /* PPP_FILTER */
}
-#if NBPF > 0
/* See if bpf wants to look at the packet. */
if (sc->sc_if.if_bpf)
bpf_mtap(&sc->sc_if, m);
-#endif
rv = 0;
switch (proto) {
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c
index 06d9598..264e4a8 100644
--- a/sys/net/if_sl.c
+++ b/sys/net/if_sl.c
@@ -68,7 +68,6 @@
#include "sl.h"
#if NSL > 0
-#include "bpf.h"
#include "opt_inet.h"
#if !defined(ACTUALLY_LKM_NOT_KERNEL) && !defined(KLD_MODULE)
#include "opt_slip.h"
@@ -105,9 +104,7 @@
#include <net/if_slvar.h>
#include <net/slip.h>
-#if NBPF > 0
#include <net/bpf.h>
-#endif
static void slattach __P((void *));
PSEUDO_SET(slattach, if_sl);
@@ -150,11 +147,7 @@ PSEUDO_SET(slattach, if_sl);
* time. So, setting SLIP_HIWAT to ~100 guarantees that we'll lose
* at most 1% while maintaining good interactive response.
*/
-#if NBPF > 0
#define BUFOFFSET (128+sizeof(struct ifnet **)+SLIP_HDRLEN)
-#else
-#define BUFOFFSET (128+sizeof(struct ifnet **))
-#endif
#define SLRMAX (MCLBYTES - BUFOFFSET)
#define SLBUFSIZE (SLRMAX + BUFOFFSET)
#ifndef SLMTU
@@ -232,9 +225,7 @@ slattach(dummy)
sc->sc_if.if_linkmib = sc;
sc->sc_if.if_linkmiblen = sizeof *sc;
if_attach(&sc->sc_if);
-#if NBPF > 0
bpfattach(&sc->sc_if, DLT_SLIP, SLIP_HDRLEN);
-#endif
}
}
@@ -539,10 +530,8 @@ slstart(tp)
register struct ip *ip;
int s;
struct mbuf *m2;
-#if NBPF > 0
u_char bpfbuf[SLTMAX + SLIP_HDRLEN];
register int len = 0;
-#endif
for (;;) {
/*
@@ -584,7 +573,6 @@ slstart(tp)
* queueing, and the connection id compression will get
* munged when this happens.
*/
-#if NBPF > 0
if (sc->sc_if.if_bpf) {
/*
* We need to save the TCP/IP header before it's
@@ -606,14 +594,12 @@ slstart(tp)
len += mlen;
} while ((m1 = m1->m_next) != NULL);
}
-#endif
ip = mtod(m, struct ip *);
if (ip->ip_v == IPVERSION && ip->ip_p == IPPROTO_TCP) {
if (sc->sc_if.if_flags & SC_COMPRESS)
*mtod(m, u_char *) |= sl_compress_tcp(m, ip,
&sc->sc_comp, 1);
}
-#if NBPF > 0
if (sc->sc_if.if_bpf) {
/*
* Put the SLIP pseudo-"link header" in place. The
@@ -624,7 +610,6 @@ slstart(tp)
bcopy(mtod(m, caddr_t), &bpfbuf[SLX_CHDR], CHDR_LEN);
bpf_tap(&sc->sc_if, bpfbuf, len + SLIP_HDRLEN);
}
-#endif
/*
* If system is getting low on clists, just flush our
@@ -776,9 +761,7 @@ slinput(c, tp)
register struct mbuf *m;
register int len;
int s;
-#if NBPF > 0
u_char chdr[CHDR_LEN];
-#endif
tk_nin++;
sc = (struct sl_softc *)tp->t_sc;
@@ -845,7 +828,6 @@ slinput(c, tp)
/* less than min length packet - ignore */
goto newpack;
-#if NBPF > 0
if (sc->sc_if.if_bpf) {
/*
* Save the compressed header, so we
@@ -857,7 +839,6 @@ slinput(c, tp)
*/
bcopy(sc->sc_buf, chdr, CHDR_LEN);
}
-#endif
if ((c = (*sc->sc_buf & 0xf0)) != (IPVERSION << 4)) {
if (c & 0x80)
@@ -886,7 +867,6 @@ slinput(c, tp)
} else
goto error;
}
-#if NBPF > 0
if (sc->sc_if.if_bpf) {
/*
* Put the SLIP pseudo-"link header" in place.
@@ -900,7 +880,6 @@ slinput(c, tp)
bcopy(chdr, &hp[SLX_CHDR], CHDR_LEN);
bpf_tap(&sc->sc_if, hp, len + SLIP_HDRLEN);
}
-#endif
m = sl_btom(sc, len);
if (m == NULL)
goto error;
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 9c4332e..7617968 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -12,6 +12,8 @@
* roots in a similar driver written by Phil Cockcroft (formerly) at
* UCL. This driver is based much more on read/write/poll mode of
* operation though.
+ *
+ * $FreeBSD$
*/
#include "tun.h"
@@ -50,10 +52,7 @@
#include <netns/ns_if.h>
#endif
-#include "bpf.h"
-#if NBPF > 0
#include <net/bpf.h>
-#endif
#include <net/if_tunvar.h>
#include <net/if_tun.h>
@@ -136,9 +135,7 @@ tuncreate(dev)
ifp->if_snd.ifq_maxlen = ifqmaxlen;
ifp->if_softc = sc;
if_attach(ifp);
-#if NBPF > 0
bpfattach(ifp, DLT_NULL, sizeof(u_int));
-#endif
dev->si_drv1 = sc;
}
@@ -336,7 +333,6 @@ tunoutput(ifp, m0, dst, rt)
return EHOSTDOWN;
}
-#if NBPF > 0
/* BPF write needs to be handled specially */
if (dst->sa_family == AF_UNSPEC) {
dst->sa_family = *(mtod(m0, int *));
@@ -362,7 +358,6 @@ tunoutput(ifp, m0, dst, rt)
bpf_mtap(ifp, &m);
}
-#endif /* NBPF > 0 */
/* prepend sockaddr? this may abort if the mbuf allocation fails */
if (tp->tun_flags & TUN_LMODE) {
@@ -628,7 +623,6 @@ tunwrite(dev, uio, flag)
top->m_pkthdr.len = tlen;
top->m_pkthdr.rcvif = ifp;
-#if NBPF > 0
if (ifp->if_bpf) {
/*
* We need to prepend the address family as
@@ -646,7 +640,6 @@ tunwrite(dev, uio, flag)
bpf_mtap(ifp, &m);
}
-#endif
#ifdef INET
s = splimp();
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index dac28c8..bc0de3a 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -57,7 +57,6 @@
#include "vlan.h"
#if NVLAN > 0
#include "opt_inet.h"
-#include "bpf.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -69,9 +68,7 @@
#include <sys/sysctl.h>
#include <sys/systm.h>
-#if NBPF > 0
#include <net/bpf.h>
-#endif
#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_arp.h>
@@ -176,9 +173,7 @@ vlaninit(void *dummy)
ifp->if_snd.ifq_maxlen = ifqmaxlen;
if_attach(ifp);
ether_ifattach(ifp);
-#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
-#endif
/* Now undo some of the damage... */
ifp->if_data.ifi_type = IFT_8021_VLAN;
ifp->if_data.ifi_hdrlen = EVL_ENCAPLEN;
@@ -209,10 +204,8 @@ vlan_start(struct ifnet *ifp)
IF_DEQUEUE(&ifp->if_snd, m);
if (m == 0)
break;
-#if NBPF > 0
if (ifp->if_bpf)
bpf_mtap(ifp, m);
-#endif /* NBPF > 0 */
/*
* If the LINK0 flag is set, it means the underlying interface
@@ -304,7 +297,6 @@ vlan_input_tag(struct ether_header *eh, struct mbuf *m, u_int16_t t)
*/
m->m_pkthdr.rcvif = &ifv->ifv_if;
-#if NBPF > 0
if (ifv->ifv_if.if_bpf) {
/*
* Do the usual BPF fakery. Note that we don't support
@@ -318,7 +310,6 @@ vlan_input_tag(struct ether_header *eh, struct mbuf *m, u_int16_t t)
m0.m_data = (char *)eh;
bpf_mtap(&ifv->ifv_if, &m0);
}
-#endif
ifv->ifv_if.if_ipackets++;
ether_input(&ifv->ifv_if, eh, m);
return;
@@ -356,7 +347,6 @@ vlan_input(struct ether_header *eh, struct mbuf *m)
m->m_len -= EVL_ENCAPLEN;
m->m_pkthdr.len -= EVL_ENCAPLEN;
-#if NBPF > 0
if (ifv->ifv_if.if_bpf) {
/*
* Do the usual BPF fakery. Note that we don't support
@@ -370,7 +360,6 @@ vlan_input(struct ether_header *eh, struct mbuf *m)
m0.m_data = (char *)eh;
bpf_mtap(&ifv->ifv_if, &m0);
}
-#endif
ifv->ifv_if.if_ipackets++;
ether_input(&ifv->ifv_if, eh, m);
return 0;
OpenPOWER on IntegriCloud