summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_arcsubr.c42
-rw-r--r--sys/net/if_ef.c603
-rw-r--r--sys/net/if_ethersubr.c54
-rw-r--r--sys/net/if_fddisubr.c43
-rw-r--r--sys/net/if_iso88025subr.c68
-rw-r--r--sys/net/if_loop.c12
-rw-r--r--sys/net/if_spppfr.c16
-rw-r--r--sys/net/if_spppsubr.c26
-rw-r--r--sys/net/if_tun.c6
-rw-r--r--sys/net/if_types.h1
-rw-r--r--sys/net/netisr.h2
-rw-r--r--sys/net/rtsock.c7
12 files changed, 1 insertions, 879 deletions
diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c
index 6cec6d9..f593150 100644
--- a/sys/net/if_arcsubr.c
+++ b/sys/net/if_arcsubr.c
@@ -40,7 +40,6 @@
*/
#include "opt_inet.h"
#include "opt_inet6.h"
-#include "opt_ipx.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -77,11 +76,6 @@
#include <netinet6/nd6.h>
#endif
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
#define ARCNET_ALLOW_BROKEN_ARP
static struct mbuf *arc_defrag(struct ifnet *, struct mbuf *);
@@ -94,7 +88,6 @@ u_int8_t arcbroadcastaddr = 0;
#define senderr(e) { error = (e); goto bad;}
#define SIN(s) ((const struct sockaddr_in *)(s))
-#define SIPX(s) ((const struct sockaddr_ipx *)(s))
/*
* ARCnet output routine.
@@ -177,15 +170,6 @@ arc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
atype = ARCTYPE_INET6;
break;
#endif
-#ifdef IPX
- case AF_IPX:
- adst = SIPX(dst)->sipx_addr.x_host.c_host[5];
- atype = ARCTYPE_IPX;
- if (adst == 0xff)
- adst = arcbroadcastaddr;
- break;
-#endif
-
case AF_UNSPEC:
{
const struct arc_header *ah;
@@ -602,12 +586,6 @@ arc_input(struct ifnet *ifp, struct mbuf *m)
isr = NETISR_IPV6;
break;
#endif
-#ifdef IPX
- case ARCTYPE_IPX:
- m_adj(m, ARC_HDRNEWLEN);
- isr = NETISR_IPX;
- break;
-#endif
default:
m_freem(m);
return;
@@ -689,26 +667,6 @@ arc_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
arp_ifinit(ifp, ifa);
break;
#endif
-#ifdef IPX
- /*
- * XXX This code is probably wrong
- */
- case AF_IPX:
- {
- struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr);
-
- if (ipx_nullhost(*ina))
- ina->x_host.c_host[5] = ARC_LLADDR(ifp);
- else
- arc_storelladdr(ifp, ina->x_host.c_host[5]);
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
default:
ifp->if_init(ifp->if_softc);
break;
diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c
deleted file mode 100644
index 887c912..0000000
--- a/sys/net/if_ef.c
+++ /dev/null
@@ -1,603 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include "opt_inet.h"
-#include "opt_ipx.h"
-#include "opt_ef.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/syslog.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-
-#include <net/ethernet.h>
-#include <net/if_llc.h>
-#include <net/if.h>
-#include <net/if_var.h>
-#include <net/if_arp.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/netisr.h>
-#include <net/bpf.h>
-#include <net/vnet.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/if_ether.h>
-#endif
-
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
-/* If none of the supported layers is enabled explicitly enable them all */
-#if !defined(ETHER_II) && !defined(ETHER_8023) && !defined(ETHER_8022) && \
- !defined(ETHER_SNAP)
-#define ETHER_II 1
-#define ETHER_8023 1
-#define ETHER_8022 1
-#define ETHER_SNAP 1
-#endif
-
-/* internal frame types */
-#define ETHER_FT_EII 0 /* Ethernet_II - default */
-#define ETHER_FT_8023 1 /* 802.3 (Novell) */
-#define ETHER_FT_8022 2 /* 802.2 */
-#define ETHER_FT_SNAP 3 /* SNAP */
-#define EF_NFT 4 /* total number of frame types */
-
-#ifdef EF_DEBUG
-#define EFDEBUG(format, args...) printf("%s: "format, __func__ ,## args)
-#else
-#define EFDEBUG(format, args...)
-#endif
-
-#define EFERROR(format, args...) printf("%s: "format, __func__ ,## args)
-
-struct efnet {
- struct ifnet *ef_ifp;
- struct ifnet *ef_pifp;
- int ef_frametype;
-};
-
-struct ef_link {
- SLIST_ENTRY(ef_link) el_next;
- struct ifnet *el_ifp; /* raw device for this clones */
- struct efnet *el_units[EF_NFT]; /* our clones */
-};
-
-static SLIST_HEAD(ef_link_head, ef_link) efdev = {NULL};
-static int efcount;
-
-extern int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m);
-extern int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp,
- const struct sockaddr *dst, short *tp, int *hlen);
-
-/*
-static void ef_reset (struct ifnet *);
-*/
-static int ef_attach(struct efnet *sc);
-static int ef_detach(struct efnet *sc);
-static void ef_init(void *);
-static int ef_ioctl(struct ifnet *, u_long, caddr_t);
-static void ef_start(struct ifnet *);
-static int ef_input(struct ifnet*, struct ether_header *, struct mbuf *);
-static int ef_output(struct ifnet *ifp, struct mbuf **mp,
- const struct sockaddr *dst, short *tp, int *hlen);
-
-static int ef_load(void);
-static int ef_unload(void);
-
-/*
- * Install the interface, most of structure initialization done in ef_clone()
- */
-static int
-ef_attach(struct efnet *sc)
-{
- struct ifnet *ifp = sc->ef_ifp;
-
- ifp->if_start = ef_start;
- ifp->if_init = ef_init;
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
- ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
- /*
- * Attach the interface
- */
- ether_ifattach(ifp, IF_LLADDR(sc->ef_pifp));
-
- ifp->if_resolvemulti = 0;
- ifp->if_type = IFT_XETHER;
- ifp->if_drv_flags |= IFF_DRV_RUNNING;
-
- EFDEBUG("%s: attached\n", ifp->if_xname);
- return 1;
-}
-
-/*
- * This is for _testing_only_, just removes interface from interfaces list
- */
-static int
-ef_detach(struct efnet *sc)
-{
- struct ifnet *ifp = sc->ef_ifp;
-
- ether_ifdetach(ifp);
- if_free(ifp);
-
- return 0;
-}
-
-static void
-ef_init(void *foo) {
- return;
-}
-
-static int
-ef_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
-{
- struct efnet *sc = ifp->if_softc;
- struct ifaddr *ifa = (struct ifaddr*)data;
- int error;
-
- EFDEBUG("IOCTL %ld for %s\n", cmd, ifp->if_xname);
- error = 0;
- switch (cmd) {
- case SIOCSIFFLAGS:
- error = 0;
- break;
- case SIOCSIFADDR:
- if (sc->ef_frametype == ETHER_FT_8023 &&
- ifa->ifa_addr->sa_family != AF_IPX) {
- error = EAFNOSUPPORT;
- break;
- }
- ifp->if_flags |= IFF_UP;
- /* FALL THROUGH */
- default:
- error = ether_ioctl(ifp, cmd, data);
- break;
- }
- return error;
-}
-
-/*
- * Currently packet prepared in the ether_output(), but this can be a better
- * place.
- */
-static void
-ef_start(struct ifnet *ifp)
-{
- struct efnet *sc = (struct efnet*)ifp->if_softc;
- struct ifnet *p;
- struct mbuf *m;
- int error;
-
- ifp->if_drv_flags |= IFF_DRV_OACTIVE;
- p = sc->ef_pifp;
-
- EFDEBUG("\n");
- for (;;) {
- IF_DEQUEUE(&ifp->if_snd, m);
- if (m == 0)
- break;
- BPF_MTAP(ifp, m);
- error = p->if_transmit(p, m);
- if (error) {
- ifp->if_oerrors++;
- continue;
- }
- ifp->if_opackets++;
- }
- ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- return;
-}
-
-/*
- * Inline functions do not put additional overhead to procedure call or
- * parameter passing but simplify the code
- */
-static int __inline
-ef_inputEII(struct mbuf *m, struct ether_header *eh, u_short ether_type)
-{
- int isr;
-
- switch(ether_type) {
-#ifdef IPX
- case ETHERTYPE_IPX:
- isr = NETISR_IPX;
- break;
-#endif
-#ifdef INET
- case ETHERTYPE_IP:
- if ((m = ip_fastforward(m)) == NULL)
- return (0);
- isr = NETISR_IP;
- break;
-
- case ETHERTYPE_ARP:
- isr = NETISR_ARP;
- break;
-#endif
- default:
- return (EPROTONOSUPPORT);
- }
- netisr_dispatch(isr, m);
- return (0);
-}
-
-static int __inline
-ef_inputSNAP(struct mbuf *m, struct ether_header *eh, struct llc* l,
- u_short ether_type)
-{
- int isr;
-
- switch(ether_type) {
-#ifdef IPX
- case ETHERTYPE_IPX:
- m_adj(m, 8);
- isr = NETISR_IPX;
- break;
-#endif
- default:
- return (EPROTONOSUPPORT);
- }
- netisr_dispatch(isr, m);
- return (0);
-}
-
-static int __inline
-ef_input8022(struct mbuf *m, struct ether_header *eh, struct llc* l,
- u_short ether_type)
-{
- int isr;
-
- switch(ether_type) {
-#ifdef IPX
- case 0xe0:
- m_adj(m, 3);
- isr = NETISR_IPX;
- break;
-#endif
- default:
- return (EPROTONOSUPPORT);
- }
- netisr_dispatch(isr, m);
- return (0);
-}
-
-/*
- * Called from ether_input()
- */
-static int
-ef_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
-{
- u_short ether_type;
- int ft = -1;
- struct efnet *efp;
- struct ifnet *eifp;
- struct llc *l;
- struct ef_link *efl;
- int isr;
-
- ether_type = ntohs(eh->ether_type);
- l = NULL;
- if (ether_type < ETHERMTU) {
- l = mtod(m, struct llc*);
- if (l->llc_dsap == 0xff && l->llc_ssap == 0xff) {
- /*
- * Novell's "802.3" frame
- */
- ft = ETHER_FT_8023;
- } else if (l->llc_dsap == 0xaa && l->llc_ssap == 0xaa) {
- /*
- * 802.2/SNAP
- */
- ft = ETHER_FT_SNAP;
- ether_type = ntohs(l->llc_un.type_snap.ether_type);
- } else if (l->llc_dsap == l->llc_ssap) {
- /*
- * 802.3/802.2
- */
- ft = ETHER_FT_8022;
- ether_type = l->llc_ssap;
- }
- } else
- ft = ETHER_FT_EII;
-
- if (ft == -1) {
- EFDEBUG("Unrecognised ether_type %x\n", ether_type);
- return EPROTONOSUPPORT;
- }
-
- /*
- * Check if interface configured for the given frame
- */
- efp = NULL;
- SLIST_FOREACH(efl, &efdev, el_next) {
- if (efl->el_ifp == ifp) {
- efp = efl->el_units[ft];
- break;
- }
- }
- if (efp == NULL) {
- EFDEBUG("Can't find if for %d\n", ft);
- return EPROTONOSUPPORT;
- }
- eifp = efp->ef_ifp;
- if ((eifp->if_flags & IFF_UP) == 0)
- return EPROTONOSUPPORT;
- eifp->if_ibytes += m->m_pkthdr.len + sizeof (*eh);
- m->m_pkthdr.rcvif = eifp;
-
- BPF_MTAP2(eifp, eh, ETHER_HDR_LEN, m);
- /*
- * Now we ready to adjust mbufs and pass them to protocol intr's
- */
- switch(ft) {
- case ETHER_FT_EII:
- return (ef_inputEII(m, eh, ether_type));
-#ifdef IPX
- case ETHER_FT_8023: /* only IPX can be here */
- isr = NETISR_IPX;
- break;
-#endif
- case ETHER_FT_SNAP:
- return (ef_inputSNAP(m, eh, l, ether_type));
- case ETHER_FT_8022:
- return (ef_input8022(m, eh, l, ether_type));
- default:
- EFDEBUG("No support for frame %d and proto %04x\n",
- ft, ether_type);
- return (EPROTONOSUPPORT);
- }
- netisr_dispatch(isr, m);
- return (0);
-}
-
-static int
-ef_output(struct ifnet *ifp, struct mbuf **mp, const struct sockaddr *dst,
- short *tp, int *hlen)
-{
- struct efnet *sc = (struct efnet*)ifp->if_softc;
- struct mbuf *m = *mp;
- u_char *cp;
- short type;
-
- if (ifp->if_type != IFT_XETHER)
- return ENETDOWN;
- switch (sc->ef_frametype) {
- case ETHER_FT_EII:
-#ifdef IPX
- type = htons(ETHERTYPE_IPX);
-#else
- return EPFNOSUPPORT;
-#endif
- break;
- case ETHER_FT_8023:
- type = htons(m->m_pkthdr.len);
- break;
- case ETHER_FT_8022:
- M_PREPEND(m, ETHER_HDR_LEN + 3, M_WAITOK);
- /*
- * Ensure that ethernet header and next three bytes
- * will fit into single mbuf
- */
- m = m_pullup(m, ETHER_HDR_LEN + 3);
- if (m == NULL) {
- *mp = NULL;
- return ENOBUFS;
- }
- m_adj(m, ETHER_HDR_LEN);
- type = htons(m->m_pkthdr.len);
- cp = mtod(m, u_char *);
- *cp++ = 0xE0;
- *cp++ = 0xE0;
- *cp++ = 0x03;
- *hlen += 3;
- break;
- case ETHER_FT_SNAP:
- M_PREPEND(m, 8, M_WAITOK);
- type = htons(m->m_pkthdr.len);
- cp = mtod(m, u_char *);
- bcopy("\xAA\xAA\x03\x00\x00\x00\x81\x37", cp, 8);
- *hlen += 8;
- break;
- default:
- return EPFNOSUPPORT;
- }
- *mp = m;
- *tp = type;
- return 0;
-}
-
-/*
- * Create clone from the given interface
- */
-static int
-ef_clone(struct ef_link *efl, int ft)
-{
- struct efnet *efp;
- struct ifnet *eifp;
- struct ifnet *ifp = efl->el_ifp;
-
- efp = (struct efnet*)malloc(sizeof(struct efnet), M_IFADDR,
- M_WAITOK | M_ZERO);
- if (efp == NULL)
- return ENOMEM;
- efp->ef_pifp = ifp;
- efp->ef_frametype = ft;
- eifp = efp->ef_ifp = if_alloc(IFT_ETHER);
- if (eifp == NULL) {
- free(efp, M_IFADDR);
- return (ENOSPC);
- }
- snprintf(eifp->if_xname, IFNAMSIZ,
- "%sf%d", ifp->if_xname, efp->ef_frametype);
- eifp->if_dname = "ef";
- eifp->if_dunit = IF_DUNIT_NONE;
- eifp->if_softc = efp;
- if (ifp->if_ioctl)
- eifp->if_ioctl = ef_ioctl;
- efl->el_units[ft] = efp;
- return 0;
-}
-
-static int
-ef_load(void)
-{
- VNET_ITERATOR_DECL(vnet_iter);
- struct ifnet *ifp;
- struct efnet *efp;
- struct ef_link *efl = NULL, *efl_temp;
- int error = 0, d;
-
- VNET_LIST_RLOCK();
- VNET_FOREACH(vnet_iter) {
- CURVNET_SET(vnet_iter);
-
- /*
- * XXXRW: The following loop walks the ifnet list while
- * modifying it, something not well-supported by ifnet
- * locking. To avoid lock upgrade/recursion issues, manually
- * acquire a write lock of ifnet_sxlock here, rather than a
- * read lock, so that when if_alloc() recurses the lock, we
- * don't panic. This structure, in which if_ef automatically
- * attaches to all ethernet interfaces, should be replaced
- * with a model like that found in if_vlan, in which
- * interfaces are explicitly configured, which would avoid
- * this (and other) problems.
- */
- sx_xlock(&ifnet_sxlock);
- TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
- if (ifp->if_type != IFT_ETHER) continue;
- EFDEBUG("Found interface %s\n", ifp->if_xname);
- efl = (struct ef_link*)malloc(sizeof(struct ef_link),
- M_IFADDR, M_WAITOK | M_ZERO);
- if (efl == NULL) {
- error = ENOMEM;
- break;
- }
-
- efl->el_ifp = ifp;
-#ifdef ETHER_II
- error = ef_clone(efl, ETHER_FT_EII);
- if (error) break;
-#endif
-#ifdef ETHER_8023
- error = ef_clone(efl, ETHER_FT_8023);
- if (error) break;
-#endif
-#ifdef ETHER_8022
- error = ef_clone(efl, ETHER_FT_8022);
- if (error) break;
-#endif
-#ifdef ETHER_SNAP
- error = ef_clone(efl, ETHER_FT_SNAP);
- if (error) break;
-#endif
- efcount++;
- SLIST_INSERT_HEAD(&efdev, efl, el_next);
- }
- sx_xunlock(&ifnet_sxlock);
- CURVNET_RESTORE();
- }
- VNET_LIST_RUNLOCK();
- if (error) {
- if (efl)
- SLIST_INSERT_HEAD(&efdev, efl, el_next);
- SLIST_FOREACH_SAFE(efl, &efdev, el_next, efl_temp) {
- for (d = 0; d < EF_NFT; d++)
- if (efl->el_units[d]) {
- if (efl->el_units[d]->ef_pifp != NULL)
- if_free(efl->el_units[d]->ef_pifp);
- free(efl->el_units[d], M_IFADDR);
- }
- free(efl, M_IFADDR);
- }
- return error;
- }
- SLIST_FOREACH(efl, &efdev, el_next) {
- for (d = 0; d < EF_NFT; d++) {
- efp = efl->el_units[d];
- if (efp)
- ef_attach(efp);
- }
- }
- ef_inputp = ef_input;
- ef_outputp = ef_output;
- EFDEBUG("Loaded\n");
- return 0;
-}
-
-static int
-ef_unload(void)
-{
- struct efnet *efp;
- struct ef_link *efl;
- int d;
-
- ef_inputp = NULL;
- ef_outputp = NULL;
- SLIST_FOREACH(efl, &efdev, el_next) {
- for (d = 0; d < EF_NFT; d++) {
- efp = efl->el_units[d];
- if (efp) {
- ef_detach(efp);
- }
- }
- }
- EFDEBUG("Unloaded\n");
- return 0;
-}
-
-static int
-if_ef_modevent(module_t mod, int type, void *data)
-{
- switch ((modeventtype_t)type) {
- case MOD_LOAD:
- return ef_load();
- case MOD_UNLOAD:
- return ef_unload();
- default:
- return EOPNOTSUPP;
- }
- return 0;
-}
-
-static moduledata_t if_ef_mod = {
- "if_ef", if_ef_modevent, NULL
-};
-
-DECLARE_MODULE(if_ef, if_ef_mod, SI_SUB_PSEUDO, SI_ORDER_MIDDLE);
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index ec29b69..44d5f24 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -33,7 +33,6 @@
#include "opt_atalk.h"
#include "opt_inet.h"
#include "opt_inet6.h"
-#include "opt_ipx.h"
#include "opt_netgraph.h"
#include "opt_mbuf_profiling.h"
@@ -79,11 +78,6 @@
#include <netinet6/nd6.h>
#endif
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m);
int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp,
const struct sockaddr *dst, short *tp, int *hlen);
@@ -249,18 +243,6 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
type = htons(ETHERTYPE_IPV6);
break;
#endif
-#ifdef IPX
- case AF_IPX:
- if (ef_outputp) {
- error = ef_outputp(ifp, &m, dst, &type, &hlen);
- if (error)
- goto bad;
- } else
- type = htons(ETHERTYPE_IPX);
- bcopy(&((const struct sockaddr_ipx *)dst)->sipx_addr.x_host,
- edst, sizeof (edst));
- break;
-#endif
#ifdef NETATALK
case AF_APPLETALK:
{
@@ -811,13 +793,6 @@ ether_demux(struct ifnet *ifp, struct mbuf *m)
isr = NETISR_ARP;
break;
#endif
-#ifdef IPX
- case ETHERTYPE_IPX:
- if (ef_inputp && ef_inputp(ifp, eh, m) == 0)
- return;
- isr = NETISR_IPX;
- break;
-#endif
#ifdef INET6
case ETHERTYPE_IPV6:
isr = NETISR_IPV6;
@@ -832,10 +807,6 @@ ether_demux(struct ifnet *ifp, struct mbuf *m)
break;
#endif /* NETATALK */
default:
-#ifdef IPX
- if (ef_inputp && ef_inputp(ifp, eh, m) == 0)
- return;
-#endif /* IPX */
#if defined(NETATALK)
if (ether_type > ETHERMTU)
goto discard;
@@ -1080,31 +1051,6 @@ ether_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
arp_ifinit(ifp, ifa);
break;
#endif
-#ifdef IPX
- /*
- * XXX - This code is probably wrong
- */
- case AF_IPX:
- {
- struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr);
-
- if (ipx_nullhost(*ina))
- ina->x_host =
- *(union ipx_host *)
- IF_LLADDR(ifp);
- else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) IF_LLADDR(ifp),
- ETHER_ADDR_LEN);
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- break;
- }
-#endif
default:
ifp->if_init(ifp->if_softc);
break;
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index 2bb818b..bfaf71a 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -39,7 +39,6 @@
#include "opt_atalk.h"
#include "opt_inet.h"
#include "opt_inet6.h"
-#include "opt_ipx.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -72,11 +71,6 @@
#include <netinet6/nd6.h>
#endif
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
#ifdef DECNET
#include <netdnet/dn.h>
#endif
@@ -184,13 +178,6 @@ fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
type = htons(ETHERTYPE_IPV6);
break;
#endif /* INET6 */
-#ifdef IPX
- case AF_IPX:
- type = htons(ETHERTYPE_IPX);
- bcopy(&((const struct sockaddr_ipx *)dst)->sipx_addr.x_host,
- edst, FDDI_ADDR_LEN);
- break;
-#endif /* IPX */
#ifdef NETATALK
case AF_APPLETALK: {
struct at_ifaddr *aa;
@@ -518,11 +505,6 @@ fddi_input(ifp, m)
isr = NETISR_IPV6;
break;
#endif
-#ifdef IPX
- case ETHERTYPE_IPX:
- isr = NETISR_IPX;
- break;
-#endif
#ifdef DECNET
case ETHERTYPE_DECNET:
isr = NETISR_DECNET;
@@ -640,31 +622,6 @@ fddi_ioctl (ifp, command, data)
arp_ifinit(ifp, ifa);
break;
#endif
-#ifdef IPX
- /*
- * XXX - This code is probably wrong
- */
- case AF_IPX: {
- struct ipx_addr *ina;
-
- ina = &(IA_SIPX(ifa)->sipx_addr);
-
- if (ipx_nullhost(*ina)) {
- ina->x_host = *(union ipx_host *)
- IF_LLADDR(ifp);
- } else {
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) IF_LLADDR(ifp),
- ETHER_ADDR_LEN);
- }
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- }
- break;
-#endif
default:
ifp->if_init(ifp->if_softc);
break;
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c
index 593c5ab..2c93b20 100644
--- a/sys/net/if_iso88025subr.c
+++ b/sys/net/if_iso88025subr.c
@@ -42,7 +42,6 @@
#include "opt_inet.h"
#include "opt_inet6.h"
-#include "opt_ipx.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -76,11 +75,6 @@
#include <netinet6/nd6.h>
#endif
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
#include <security/mac/mac_framework.h>
static const u_char iso88025_broadcastaddr[ISO88025_ADDR_LEN] =
@@ -171,30 +165,6 @@ iso88025_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
arp_ifinit(ifp, ifa);
break;
#endif /* INET */
-#ifdef IPX
- /*
- * XXX - This code is probably wrong
- */
- case AF_IPX: {
- struct ipx_addr *ina;
-
- ina = &(IA_SIPX(ifa)->sipx_addr);
-
- if (ipx_nullhost(*ina))
- ina->x_host = *(union ipx_host *)
- IF_LLADDR(ifp);
- else
- bcopy((caddr_t) ina->x_host.c_host,
- (caddr_t) IF_LLADDR(ifp),
- ISO88025_ADDR_LEN);
-
- /*
- * Set new address
- */
- ifp->if_init(ifp->if_softc);
- }
- break;
-#endif /* IPX */
default:
ifp->if_init(ifp->if_softc);
break;
@@ -328,25 +298,6 @@ iso88025_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
snap_type = ETHERTYPE_IPV6;
break;
#endif /* INET6 */
-#ifdef IPX
- case AF_IPX:
- {
- u_int8_t *cp;
-
- bcopy((caddr_t)&(satoipx_addr(dst).x_host), (caddr_t)edst,
- ISO88025_ADDR_LEN);
-
- M_PREPEND(m, 3, M_WAITOK);
- m = m_pullup(m, 3);
- if (m == 0)
- senderr(ENOBUFS);
- cp = mtod(m, u_int8_t *);
- *cp++ = ETHERTYPE_IPX_8022;
- *cp++ = ETHERTYPE_IPX_8022;
- *cp++ = LLC_UI;
- }
- break;
-#endif /* IPX */
case AF_UNSPEC:
{
const struct iso88025_sockaddr_data *sd;
@@ -546,19 +497,6 @@ iso88025_input(ifp, m)
l = mtod(m, struct llc *);
switch (l->llc_dsap) {
-#ifdef IPX
- case ETHERTYPE_IPX_8022: /* Thanks a bunch Novell */
- if ((l->llc_control != LLC_UI) ||
- (l->llc_ssap != ETHERTYPE_IPX_8022)) {
- ifp->if_noproto++;
- goto dropanyway;
- }
-
- th->iso88025_shost[0] &= ~(TR_RII);
- m_adj(m, 3);
- isr = NETISR_IPX;
- break;
-#endif /* IPX */
case LLC_SNAP_LSAP: {
u_int16_t type;
if ((l->llc_control != LLC_UI) ||
@@ -591,12 +529,6 @@ iso88025_input(ifp, m)
isr = NETISR_ARP;
break;
#endif /* INET */
-#ifdef IPX_SNAP /* XXX: Not supported! */
- case ETHERTYPE_IPX:
- th->iso88025_shost[0] &= ~(TR_RII);
- isr = NETISR_IPX;
- break;
-#endif /* IPX_SNAP */
#ifdef INET6
case ETHERTYPE_IPV6:
th->iso88025_shost[0] &= ~(TR_RII);
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 1cfe77b..e114699 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -37,7 +37,6 @@
#include "opt_atalk.h"
#include "opt_inet.h"
#include "opt_inet6.h"
-#include "opt_ipx.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -64,11 +63,6 @@
#include <netinet/in_var.h>
#endif
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
#ifdef INET6
#ifndef INET
#include <netinet/in.h>
@@ -273,7 +267,6 @@ looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
#endif
m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES6;
break;
- case AF_IPX:
case AF_APPLETALK:
break;
default:
@@ -368,11 +361,6 @@ if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen)
isr = NETISR_IPV6;
break;
#endif
-#ifdef IPX
- case AF_IPX:
- isr = NETISR_IPX;
- break;
-#endif
#ifdef NETATALK
case AF_APPLETALK:
isr = NETISR_ATALK2;
diff --git a/sys/net/if_spppfr.c b/sys/net/if_spppfr.c
index a151849..fffcdba 100644
--- a/sys/net/if_spppfr.c
+++ b/sys/net/if_spppfr.c
@@ -28,7 +28,6 @@
#if defined(__FreeBSD__)
#include "opt_inet.h"
#include "opt_inet6.h"
-#include "opt_ipx.h"
#endif
#ifdef NetBSD1_3
@@ -85,11 +84,6 @@
# include <net/ethertypes.h>
#endif
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
#include <net/if_sppp.h>
/*
@@ -266,11 +260,6 @@ drop: ++ifp->if_ierrors;
isr = NETISR_IP;
break;
#endif
-#ifdef IPX
- case ETHERTYPE_IPX:
- isr = NETISR_IPX;
- break;
-#endif
#ifdef NETATALK
case ETHERTYPE_AT:
isr = NETISR_ATALK;
@@ -345,11 +334,6 @@ struct mbuf *sppp_fr_header (struct sppp *sp, struct mbuf *m,
h[3] = FR_IP;
return m;
#endif
-#ifdef IPX
- case AF_IPX:
- type = ETHERTYPE_IPX;
- break;
-#endif
#ifdef NS
case AF_NS:
type = 0x8137;
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index b24ea73..74bcfa06 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -25,7 +25,6 @@
#include "opt_inet.h"
#include "opt_inet6.h"
-#include "opt_ipx.h"
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -65,11 +64,6 @@
#include <netinet/if_ether.h>
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
#include <net/if_sppp.h>
#define IOCTL_CMD_T u_long
@@ -672,14 +666,6 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
do_account++;
break;
#endif
-#ifdef IPX
- case PPP_IPX:
- /* IPX IPXCP not implemented yet */
- if (sp->pp_phase == PHASE_NETWORK)
- isr = NETISR_IPX;
- do_account++;
- break;
-#endif
}
break;
case CISCO_MULTICAST:
@@ -715,12 +701,6 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
do_account++;
break;
#endif
-#ifdef IPX
- case ETHERTYPE_IPX:
- isr = NETISR_IPX;
- do_account++;
- break;
-#endif
}
break;
default: /* Invalid PPP packet. */
@@ -984,12 +964,6 @@ nobufs: if (debug)
}
break;
#endif
-#ifdef IPX
- case AF_IPX: /* Novell IPX Protocol */
- h->protocol = htons (sp->pp_mode == IFF_CISCO ?
- ETHERTYPE_IPX : PPP_IPX);
- break;
-#endif
default:
m_freem (m);
++ifp->if_oerrors;
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 45e10c1..03fcd59 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -19,7 +19,6 @@
#include "opt_atalk.h"
#include "opt_inet.h"
#include "opt_inet6.h"
-#include "opt_ipx.h"
#include <sys/param.h>
#include <sys/priv.h>
@@ -906,11 +905,6 @@ tunwrite(struct cdev *dev, struct uio *uio, int flag)
isr = NETISR_IPV6;
break;
#endif
-#ifdef IPX
- case AF_IPX:
- isr = NETISR_IPX;
- break;
-#endif
#ifdef NETATALK
case AF_APPLETALK:
isr = NETISR_ATALK2;
diff --git a/sys/net/if_types.h b/sys/net/if_types.h
index fe6ab5e..80a5606 100644
--- a/sys/net/if_types.h
+++ b/sys/net/if_types.h
@@ -250,5 +250,4 @@
#define IFT_ENC 0xf4
#define IFT_PFLOG 0xf6
#define IFT_PFSYNC 0xf7
-#define IFT_IPXIP 0xf9 /* IPX over IP tunneling; no longer used. */
#endif /* !_NET_IF_TYPES_H_ */
diff --git a/sys/net/netisr.h b/sys/net/netisr.h
index 83bf9ce..2cf3113 100644
--- a/sys/net/netisr.h
+++ b/sys/net/netisr.h
@@ -56,7 +56,7 @@
#define NETISR_ATALK2 5 /* Appletalk phase 2 */
#define NETISR_ATALK1 6 /* Appletalk phase 1 */
#define NETISR_ARP 7 /* same as AF_LINK */
-#define NETISR_IPX 8 /* same as AF_IPX */
+/* 8 was IPX */
#define NETISR_ETHER 9 /* ethernet input */
#define NETISR_IPV6 10
#define NETISR_NATM 11
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 4cb9b07..324520f 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -129,7 +129,6 @@ int (*carp_get_vhid_p)(struct ifaddr *);
typedef struct {
int ip_count; /* attached w/ AF_INET */
int ip6_count; /* attached w/ AF_INET6 */
- int ipx_count; /* attached w/ AF_IPX */
int any_count; /* total attached */
} route_cb_t;
static VNET_DEFINE(route_cb_t, route_cb);
@@ -294,9 +293,6 @@ rts_attach(struct socket *so, int proto, struct thread *td)
case AF_INET6:
V_route_cb.ip6_count++;
break;
- case AF_IPX:
- V_route_cb.ipx_count++;
- break;
}
V_route_cb.any_count++;
RTSOCK_UNLOCK();
@@ -337,9 +333,6 @@ rts_detach(struct socket *so)
case AF_INET6:
V_route_cb.ip6_count--;
break;
- case AF_IPX:
- V_route_cb.ipx_count--;
- break;
}
V_route_cb.any_count--;
RTSOCK_UNLOCK();
OpenPOWER on IntegriCloud