#if NBPFILTER > 0
#include "../net/bpf.h"
#include "../net/bpfdesc.h"
#endif

#if NBPFILTER > 0
	caddr_t	sc_bpf;
#endif
#if NBPFILTER > 0
	{
		static struct bpf_devp dev = 
			{ DLT_EN10MB, sizeof(struct ether_header) };
	    
		bpfattach(&le->sc_bpf, ifp, &dev);
	}
#endif
#if NBPFILTER > 0
	if (le->sc_if.if_flags & IFF_PROMISC)
		/* set the promiscuous bit */
		le->sc_r2->ler2_mode = LE_MODE|0x8000;
	else
		le->sc_r2->ler2_mode = LE_MODE;
#endif
#if NBPFILTER > 0
	/* 
	 * If bpf is listening on this interface, let it 
	 * see the packet before we commit it to the wire.
	 */
	if (le->sc_bpf)
		bpf_tap(le->sc_bpf, le->sc_r2->ler2_tbuf[0], len);
#endif
#if NBPFILTER > 0
	/*
	 * Check if there's a bpf filter listening on this interface.
	 * If so, hand off the raw packet to enet. 
	 */
	if (le->sc_bpf) {
		bpf_tap(le->sc_bpf, buf, len + sizeof(struct ether_header));

		/*
		 * Note that the interface cannot be in promiscuous mode if
		 * there are no bpf listeners.  And if we are in promiscuous
		 * mode, we have to check if this packet is really ours.
		 *
		 * XXX This test does not support multicasts.
		 */
		if ((le->sc_if.if_flags & IFF_PROMISC)
		    && bcmp(et->ether_dhost, le->sc_addr, 
			    sizeof(et->ether_dhost)) != 0
		    && bcmp(et->ether_dhost, etherbroadcastaddr, 
			    sizeof(et->ether_dhost)) != 0)
			return;
	}
#endif
