diff options
author | brian <brian@FreeBSD.org> | 2000-01-27 23:37:39 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-01-27 23:37:39 +0000 |
commit | 3f0a670dfadb774662f4d1cefa85f9cfd8276337 (patch) | |
tree | feb0adca4a5c8cb25290d326c8523b73ee3b4877 /sys/net/if_tun.c | |
parent | 5674e933817d6931a868ea3d12dd39b130380136 (diff) | |
download | FreeBSD-src-3f0a670dfadb774662f4d1cefa85f9cfd8276337.zip FreeBSD-src-3f0a670dfadb774662f4d1cefa85f9cfd8276337.tar.gz |
Redo the intrq.c idea as
int family_enqueue(sa_family_t, struct mbuf *);
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 117 |
1 files changed, 2 insertions, 115 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 9db0048..6a59859 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -46,42 +46,11 @@ #include <net/route.h> #include <net/intrq.h> -#ifdef ATM_CORE -#include <netatm/kern_include.h> -#include <netatm/atm.h> -#include <netatm/atm_var.h> -#endif - #ifdef INET #include <netinet/in.h> #include <netinet/in_var.h> #endif -#ifdef INET6 -#include <netinet6/in6.h> -#include <netinet6/in6_var.h> -#endif - -#ifdef IPX -#include <netipx/ipx.h> -#include <netipx/ipx_if.h> -#endif - -#ifdef NATM -#include <netnatm/natm.h> -#endif - -#ifdef NETATALK -#include <netatalk/at.h> -#include <netatalk/at_var.h> -#endif - -#ifdef NS -/* This will never be defined by config(8), or for the if_tun module ! */ -#include <netns/ns.h> -#include <netns/ns_if.h> -#endif - #include <net/bpf.h> #include <net/if_tunvar.h> @@ -631,9 +600,8 @@ tunwrite(dev, uio, flag) struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = &tp->tun_if; struct mbuf *top, **mp, *m; - int error=0, s, tlen, mlen, isr; + int error=0, tlen, mlen; u_int32_t family; - struct ifqueue *q; TUNDEBUG("%s%d: tunwrite\n", ifp->if_name, ifp->if_unit); @@ -713,88 +681,7 @@ tunwrite(dev, uio, flag) } else family = AF_INET; - q = NULL; - isr = 0; - - switch (family) { -#ifdef ATM_CORE - case AF_ATM: - if (atmintrq_present) { - q = &atm_intrq; - isr = NETISR_ATM; - } - break; -#endif -#ifdef INET - case AF_INET: - if (ipintrq_present) { - q = &ipintrq; - isr = NETISR_IP; - } - break; -#endif -#ifdef INET6 - case AF_INET6: - if (ip6intrq_present) { - q = &ip6intrq; - isr = NETISR_IPV6; - } - break; -#endif -#ifdef IPX - case AF_IPX: - if (ipxintrq_present) { - q = &ipxintrq; - isr = NETISR_IPX; - } - break; -#endif -#ifdef NATM - case AF_NATM: - if (natmintrq_present) { - q = &natmintrq; - isr = NETISR_NATM; - } - break; -#endif -#ifdef NETATALK - case AF_APPLETALK: - if (atintrq2_present) { - q = &atintrq2; - isr = NETISR_ATALK; - } - break; -#endif -#ifdef NS - case AF_NS: - if (nsintrq_present) { - q = &nsintrq; - isr = NETISR_NS; - } - break; -#endif - } - - if (!q) { - m_freem(top); - return EAFNOSUPPORT; - } - - s = splimp(); - if (IF_QFULL (q)) { - IF_DROP(q); - splx(s); - ifp->if_collisions++; - m_freem(top); - return ENOBUFS; - } - IF_ENQUEUE(q, top); - splx(s); - ifp->if_ibytes += tlen; - ifp->if_ipackets++; - schednetisr(isr); - - return error; + return family_enqueue(family, top); } /* |