diff options
author | peter <peter@FreeBSD.org> | 2000-02-13 03:32:07 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2000-02-13 03:32:07 +0000 |
commit | a5441090deef0b9401bd8291ffdca1f66ca5362d (patch) | |
tree | 08db8fae584f4c3cdf2ad5b2ac80c1bd44801d5a /sys/net | |
parent | 97c685efe694921d4948ef681efe38f0ad0bac8c (diff) | |
download | FreeBSD-src-a5441090deef0b9401bd8291ffdca1f66ca5362d.zip FreeBSD-src-a5441090deef0b9401bd8291ffdca1f66ca5362d.tar.gz |
Clean up some loose ends in the network code, including the X.25 and ISO
#ifdefs. Clean out unused netisr's and leftover netisr linker set gunk.
Tested on x86 and alpha, including world.
Approved by: jkh
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_ethersubr.c | 175 | ||||
-rw-r--r-- | sys/net/if_fddisubr.c | 159 | ||||
-rw-r--r-- | sys/net/if_loop.c | 12 | ||||
-rw-r--r-- | sys/net/if_spppsubr.c | 23 | ||||
-rw-r--r-- | sys/net/netisr.h | 21 | ||||
-rw-r--r-- | sys/net/route.h | 1 | ||||
-rw-r--r-- | sys/net/rtsock.c | 6 |
7 files changed, 7 insertions, 390 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 37c3d11..4042028 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -83,22 +83,6 @@ int ether_outputdebug = 0; int ether_inputdebug = 0; #endif -#ifdef ISO -#include <netiso/argo_debug.h> -#include <netiso/iso.h> -#include <netiso/iso_var.h> -#include <netiso/iso_snpac.h> -#endif - -/*#ifdef LLC -#include <netccitt/dll.h> -#include <netccitt/llc_var.h> -#endif*/ - -#if defined(LLC) && defined(CCITT) -extern struct ifqueue pkintrq; -#endif - #ifdef NETATALK #include <netatalk/at.h> #include <netatalk/at_var.h> @@ -325,68 +309,6 @@ ether_output(ifp, m, dst, rt0) } break; #endif /* NS */ -#ifdef ISO - case AF_ISO: { - int snpalen; - struct llc *l; - register struct sockaddr_dl *sdl; - - if (rt && (sdl = (struct sockaddr_dl *)rt->rt_gateway) && - sdl->sdl_family == AF_LINK && sdl->sdl_alen > 0) { - bcopy(LLADDR(sdl), (caddr_t)edst, sizeof(edst)); - } else if (error = - iso_snparesolve(ifp, (struct sockaddr_iso *)dst, - (char *)edst, &snpalen)) - goto bad; /* Not Resolved */ - /* If broadcasting on a simplex interface, loopback a copy */ - if (*edst & 1) - m->m_flags |= (M_BCAST|M_MCAST); - M_PREPEND(m, 3, M_DONTWAIT); - if (m == NULL) - return (0); - type = htons(m->m_pkthdr.len); - l = mtod(m, struct llc *); - l->llc_dsap = l->llc_ssap = LLC_ISO_LSAP; - l->llc_control = LLC_UI; - len += 3; - IFDEBUG(D_ETHER) - int i; - printf("unoutput: sending pkt to: "); - for (i=0; i<6; i++) - printf("%x ", edst[i] & 0xff); - printf("\n"); - ENDDEBUG - } break; -#endif /* ISO */ -#ifdef LLC -/* case AF_NSAP: */ - case AF_CCITT: { - register struct sockaddr_dl *sdl = - (struct sockaddr_dl *) rt -> rt_gateway; - - if (sdl && sdl->sdl_family == AF_LINK - && sdl->sdl_alen > 0) { - bcopy(LLADDR(sdl), (char *)edst, sizeof(edst)); - } else goto bad; /* Not a link interface ? Funny ... */ - if (*edst & 1) - loop_copy = 1; - type = htons(m->m_pkthdr.len); -#ifdef LLC_DEBUG - { - int i; - register struct llc *l = mtod(m, struct llc *); - - printf("ether_output: sending LLC2 pkt to: "); - for (i=0; i<6; i++) - printf("%x ", edst[i] & 0xff); - printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n", - type & 0xff, l->llc_dsap & 0xff, l->llc_ssap &0xff, - l->llc_control & 0xff); - - } -#endif /* LLC_DEBUG */ - } break; -#endif /* LLC */ case pseudo_AF_HDRCMPLT: hdrcmplt = 1; @@ -497,7 +419,7 @@ ether_input(ifp, eh, m) register struct ifqueue *inq; u_short ether_type; int s; -#if defined (ISO) || defined (LLC) || defined(NETATALK) +#if defined(NETATALK) register struct llc *l; #endif @@ -601,12 +523,11 @@ ether_input(ifp, eh, m) break; } #endif /* NS */ -#if defined (ISO) || defined (LLC) || defined(NETATALK) +#if defined(NETATALK) if (ether_type > ETHERMTU) goto dropanyway; l = mtod(m, struct llc *); switch (l->llc_dsap) { -#ifdef NETATALK case LLC_SNAP_LSAP: switch (l->llc_control) { case LLC_UI: @@ -634,94 +555,6 @@ ether_input(ifp, eh, m) goto dropanyway; } break; -#endif NETATALK -#ifdef ISO - case LLC_ISO_LSAP: - switch (l->llc_control) { - case LLC_UI: - /* LLC_UI_P forbidden in class 1 service */ - if ((l->llc_dsap == LLC_ISO_LSAP) && - (l->llc_ssap == LLC_ISO_LSAP)) { - /* LSAP for ISO */ - if (m->m_pkthdr.len > ether_type) - m_adj(m, ether_type - m->m_pkthdr.len); - m->m_data += 3; /* XXX */ - m->m_len -= 3; /* XXX */ - m->m_pkthdr.len -= 3; /* XXX */ - M_PREPEND(m, sizeof *eh, M_DONTWAIT); - if (m == 0) - return; - *mtod(m, struct ether_header *) = *eh; - IFDEBUG(D_ETHER) - printf("clnp packet"); - ENDDEBUG - schednetisr(NETISR_ISO); - inq = &clnlintrq; - break; - } - goto dropanyway; - - case LLC_XID: - case LLC_XID_P: - if(m->m_len < 6) - goto dropanyway; - l->llc_window = 0; - l->llc_fid = 9; - l->llc_class = 1; - l->llc_dsap = l->llc_ssap = 0; - /* Fall through to */ - case LLC_TEST: - case LLC_TEST_P: - { - struct sockaddr sa; - register struct ether_header *eh2; - int i; - u_char c = l->llc_dsap; - - l->llc_dsap = l->llc_ssap; - l->llc_ssap = c; - if (m->m_flags & (M_BCAST | M_MCAST)) - bcopy((caddr_t)ac->ac_enaddr, - (caddr_t)eh->ether_dhost, 6); - sa.sa_family = AF_UNSPEC; - sa.sa_len = sizeof(sa); - eh2 = (struct ether_header *)sa.sa_data; - for (i = 0; i < 6; i++) { - eh2->ether_shost[i] = c = eh->ether_dhost[i]; - eh2->ether_dhost[i] = - eh->ether_dhost[i] = eh->ether_shost[i]; - eh->ether_shost[i] = c; - } - ifp->if_output(ifp, m, &sa, NULL); - return; - } - default: - m_freem(m); - return; - } - break; -#endif /* ISO */ -#ifdef LLC - case LLC_X25_LSAP: - { - if (m->m_pkthdr.len > ether_type) - m_adj(m, ether_type - m->m_pkthdr.len); - M_PREPEND(m, sizeof(struct sdl_hdr) , M_DONTWAIT); - if (m == 0) - return; - if ( !sdl_sethdrif(ifp, eh->ether_shost, LLC_X25_LSAP, - eh->ether_dhost, LLC_X25_LSAP, 6, - mtod(m, struct sdl_hdr *))) - panic("ETHER cons addr failure"); - mtod(m, struct sdl_hdr *)->sdlhdr_len = ether_type; -#ifdef LLC_DEBUG - printf("llc packet\n"); -#endif /* LLC_DEBUG */ - schednetisr(NETISR_CCITT); - inq = &llcintrq; - break; - } -#endif /* LLC */ dropanyway: default: #ifdef NETGRAPH @@ -731,14 +564,14 @@ ether_input(ifp, eh, m) #endif /* NETGRAPH */ return; } -#else /* ISO || LLC || NETATALK */ +#else /* NETATALK */ #ifdef NETGRAPH ngether_send(IFP2AC(ifp), eh, m); #else /* NETGRAPH */ m_freem(m); #endif /* NETGRAPH */ return; -#endif /* ISO || LLC || NETATALK */ +#endif /* NETATALK */ } s = splimp(); diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index fc9a75c..b9c431a 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -81,18 +81,6 @@ #include <netdnet/dn.h> #endif -#ifdef ISO -#include <netiso/argo_debug.h> -#include <netiso/iso.h> -#include <netiso/iso_var.h> -#include <netiso/iso_snpac.h> -#endif - -#ifdef LLC -#include <netccitt/dll.h> -#include <netccitt/llc_var.h> -#endif - #ifdef NETATALK #include <netatalk/at.h> #include <netatalk/at_var.h> @@ -105,10 +93,6 @@ extern u_char at_org_code[ 3 ]; extern u_char aarp_org_code[ 3 ]; #endif /* NETATALK */ -#if defined(LLC) && defined(CCITT) -extern struct ifqueue pkintrq; -#endif - #define senderr(e) { error = (e); goto bad;} /* @@ -247,66 +231,6 @@ fddi_output(ifp, m, dst, rt0) (caddr_t)edst, sizeof (edst)); break; #endif -#ifdef ISO - case AF_ISO: { - int snpalen; - struct llc *l; - register struct sockaddr_dl *sdl; - - if (rt && (sdl = (struct sockaddr_dl *)rt->rt_gateway) && - sdl->sdl_family == AF_LINK && sdl->sdl_alen > 0) { - bcopy(LLADDR(sdl), (caddr_t)edst, sizeof(edst)); - } else if (error = - iso_snparesolve(ifp, (struct sockaddr_iso *)dst, - (char *)edst, &snpalen)) - goto bad; /* Not Resolved */ - /* If broadcasting on a simplex interface, loopback a copy */ - if (*edst & 1) - m->m_flags |= (M_BCAST|M_MCAST); - M_PREPEND(m, 3, M_DONTWAIT); - if (m == NULL) - return (0); - type = 0; - l = mtod(m, struct llc *); - l->llc_dsap = l->llc_ssap = LLC_ISO_LSAP; - l->llc_control = LLC_UI; - IFDEBUG(D_ETHER) - int i; - printf("unoutput: sending pkt to: "); - for (i=0; i<6; i++) - printf("%x ", edst[i] & 0xff); - printf("\n"); - ENDDEBUG - } break; -#endif /* ISO */ -#ifdef LLC -/* case AF_NSAP: */ - case AF_CCITT: { - register struct sockaddr_dl *sdl = - (struct sockaddr_dl *) rt -> rt_gateway; - - if (sdl && sdl->sdl_family != AF_LINK && sdl->sdl_alen <= 0) - goto bad; /* Not a link interface ? Funny ... */ - bcopy(LLADDR(sdl), (char *)edst, sizeof(edst)); - if (*edst & 1) - loop_copy = 1; - type = 0; -#ifdef LLC_DEBUG - { - int i; - register struct llc *l = mtod(m, struct llc *); - - printf("fddi_output: sending LLC2 pkt to: "); - for (i=0; i<6; i++) - printf("%x ", edst[i] & 0xff); - printf(" len 0x%x dsap 0x%x ssap 0x%x control 0x%x\n", - type & 0xff, l->llc_dsap & 0xff, l->llc_ssap &0xff, - l->llc_control & 0xff); - - } -#endif /* LLC_DEBUG */ - } break; -#endif /* LLC */ case pseudo_AF_HDRCMPLT: { @@ -583,89 +507,6 @@ fddi_input(ifp, fh, m) break; } #endif /* INET || NS */ -#ifdef ISO - case LLC_ISO_LSAP: - switch (l->llc_control) { - case LLC_UI: - /* LLC_UI_P forbidden in class 1 service */ - if ((l->llc_dsap == LLC_ISO_LSAP) && - (l->llc_ssap == LLC_ISO_LSAP)) { - /* LSAP for ISO */ - m->m_data += 3; /* XXX */ - m->m_len -= 3; /* XXX */ - m->m_pkthdr.len -= 3; /* XXX */ - M_PREPEND(m, sizeof *fh, M_DONTWAIT); - if (m == 0) - return; - *mtod(m, struct fddi_header *) = *fh; - IFDEBUG(D_ETHER) - printf("clnp packet"); - ENDDEBUG - schednetisr(NETISR_ISO); - inq = &clnlintrq; - break; - } - goto dropanyway; - - case LLC_XID: - case LLC_XID_P: - if(m->m_len < 6) - goto dropanyway; - l->llc_window = 0; - l->llc_fid = 9; - l->llc_class = 1; - l->llc_dsap = l->llc_ssap = 0; - /* Fall through to */ - case LLC_TEST: - case LLC_TEST_P: - { - struct sockaddr sa; - register struct ether_header *eh; - struct arpcom *ac = (struct arpcom *) ifp; - int i; - u_char c = l->llc_dsap; - - l->llc_dsap = l->llc_ssap; - l->llc_ssap = c; - if (m->m_flags & (M_BCAST | M_MCAST)) - bcopy((caddr_t)ac->ac_enaddr, - (caddr_t)eh->ether_dhost, 6); - sa.sa_family = AF_UNSPEC; - sa.sa_len = sizeof(sa); - eh = (struct ether_header *)sa.sa_data; - for (i = 0; i < 6; i++) { - eh->ether_shost[i] = fh->fddi_dhost[i]; - eh->ether_dhost[i] = fh->fddi_shost[i]; - } - eh->ether_type = 0; - ifp->if_output(ifp, m, &sa, NULL); - return; - } - default: - m_freem(m); - return; - } - break; -#endif /* ISO */ -#ifdef LLC - case LLC_X25_LSAP: - { - M_PREPEND(m, sizeof(struct sdl_hdr) , M_DONTWAIT); - if (m == 0) - return; - if ( !sdl_sethdrif(ifp, fh->fddi_shost, LLC_X25_LSAP, - fh->fddi_dhost, LLC_X25_LSAP, 6, - mtod(m, struct sdl_hdr *))) - panic("ETHER cons addr failure"); - mtod(m, struct sdl_hdr *)->sdlhdr_len = m->m_pkthdr.len - sizeof(struct sdl_hdr); -#ifdef LLC_DEBUG - printf("llc packet\n"); -#endif /* LLC_DEBUG */ - schednetisr(NETISR_CCITT); - inq = &llcintrq; - break; - } -#endif /* LLC */ default: /* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */ diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index a4f37cd..3efef6d 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -80,11 +80,6 @@ #include <netns/ns_if.h> #endif -#ifdef ISO -#include <netiso/iso.h> -#include <netiso/iso_var.h> -#endif - #ifdef NETATALK #include <netatalk/at.h> #include <netatalk/at_var.h> @@ -183,7 +178,6 @@ contiguousfail: case AF_INET6: case AF_IPX: case AF_NS: - case AF_ISO: case AF_APPLETALK: break; default: @@ -286,12 +280,6 @@ if_simloop(ifp, m, dst, hlen) isr = NETISR_NS; break; #endif -#ifdef ISO - case AF_ISO: - ifq = &clnlintrq; - isr = NETISR_ISO; - break; -#endif #ifdef NETATALK case AF_APPLETALK: ifq = &atintrq2; diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index e02ef90..36ede2b 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -92,13 +92,6 @@ #include <netns/ns_if.h> #endif -#ifdef ISO -#include <netiso/argo_debug.h> -#include <netiso/iso.h> -#include <netiso/iso_var.h> -#include <netiso/iso_snpac.h> -#endif - #include <net/if_sppp.h> #if defined(__FreeBSD__) && __FreeBSD__ >= 3 @@ -537,15 +530,6 @@ sppp_input(struct ifnet *ifp, struct mbuf *m) } break; #endif -#ifdef ISO - case PPP_ISO: - /* OSI NLCP not implemented yet */ - if (sp->pp_phase == PHASE_NETWORK) { - schednetisr (NETISR_ISO); - inq = &clnlintrq; - } - break; -#endif } break; case CISCO_MULTICAST: @@ -770,13 +754,6 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, ETHERTYPE_IPX : PPP_IPX); break; #endif -#ifdef ISO - case AF_ISO: /* ISO OSI Protocol */ - if (sp->pp_mode == IFF_CISCO) - goto nosupport; - h->protocol = htons (PPP_ISO); - break; -#endif nosupport: default: m_freem (m); diff --git a/sys/net/netisr.h b/sys/net/netisr.h index 563c4ec..3ae1d13 100644 --- a/sys/net/netisr.h +++ b/sys/net/netisr.h @@ -45,9 +45,6 @@ * level for the clock (so you can enter the network in routines called * at timeout time). */ -#if defined(vax) || defined(tahoe) -#define setsoftnet() mtpr(SIRR, 12) -#endif /* * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status @@ -55,41 +52,29 @@ * interrupt used for scheduling the network code to calls * on the lowest level routine of each protocol. */ -#define NETISR_RAW 0 /* same as AF_UNSPEC */ #define NETISR_IP 2 /* same as AF_INET */ -#define NETISR_IMP 3 /* same as AF_IMPLINK */ #define NETISR_NS 6 /* same as AF_NS */ -#define NETISR_ISO 7 /* same as AF_ISO */ -#define NETISR_CCITT 10 /* same as AF_CCITT */ #define NETISR_ATALK 16 /* same as AF_APPLETALK */ #define NETISR_ARP 18 /* same as AF_LINK */ #define NETISR_IPX 23 /* same as AF_IPX */ #define NETISR_USB 25 /* USB soft interrupt */ -#define NETISR_ISDN 26 /* same as AF_E164 */ #define NETISR_PPP 27 /* PPP soft interrupt */ #define NETISR_IPV6 28 /* same as AF_INET6 */ #define NETISR_NATM 29 /* same as AF_NATM */ #define NETISR_NETGRAPH 31 /* same as AF_NETGRAPH */ -#define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); } #ifndef LOCORE #ifdef _KERNEL + extern volatile unsigned int netisr; /* scheduling bits for network */ +#define schednetisr(anisr) { netisr |= 1 << (anisr); setsoftnet(); } typedef void netisr_t __P((void)); -struct netisrtab { - int nit_num; - netisr_t *nit_isr; -}; - int register_netisr __P((int, netisr_t *)); -void netisr_sysinit __P((void *)); +int unregister_netisr __P((int)); -#define NETISR_SET(num, isr) \ - static struct netisrtab nisr_##num = { num, isr }; \ - SYSINIT(nisr_##num, SI_SUB_CPU, SI_ORDER_ANY, netisr_sysinit, &nisr_##num) #endif #endif diff --git a/sys/net/route.h b/sys/net/route.h index 68d21fc..c9c5c3f 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -255,7 +255,6 @@ struct route_cb { int ip6_count; int ipx_count; int ns_count; - int iso_count; int any_count; }; diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 265a1c7..e03eb61 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -142,9 +142,6 @@ rts_attach(struct socket *so, int proto, struct proc *p) case AF_NS: route_cb.ns_count++; break; - case AF_ISO: - route_cb.iso_count++; - break; } rp->rcb_faddr = &route_src; route_cb.any_count++; @@ -198,9 +195,6 @@ rts_detach(struct socket *so) case AF_NS: route_cb.ns_count--; break; - case AF_ISO: - route_cb.iso_count--; - break; } route_cb.any_count--; } |