summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-10-26 20:31:59 +0000
committerjulian <julian@FreeBSD.org>1995-10-26 20:31:59 +0000
commit90ae06d6ac1d2da3758389a70a20c91f3e9fd1dc (patch)
treed823a4d0efac391c6dfad3ac2e27c0e984cea732 /sys/net
parent627b063e661d2c0187cf625f83db54c6aca0a0c1 (diff)
downloadFreeBSD-src-90ae06d6ac1d2da3758389a70a20c91f3e9fd1dc.zip
FreeBSD-src-90ae06d6ac1d2da3758389a70a20c91f3e9fd1dc.tar.gz
Reviewed by: julian and jhay@mikom.csir.co.za
Submitted by: Mike Mitchell, supervisor@alb.asctmd.com This is a bulk mport of Mike's IPX/SPX protocol stacks and all the related gunf that goes with it.. it is not guaranteed to work 100% correctly at this time but as we had several people trying to work on it I figured it would be better to get it checked in so they could all get teh same thing to work on.. Mikes been using it for a year or so but on 2.0 more changes and stuff will be merged in from other developers now that this is in. Mike Mitchell, Network Engineer AMTECH Systems Corporation, Technology and Manufacturing 8600 Jefferson Street, Albuquerque, New Mexico 87113 (505) 856-8000 supervisor@alb.asctmd.com
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c26
-rw-r--r--sys/net/if_fddisubr.c19
-rw-r--r--sys/net/if_loop.c13
-rw-r--r--sys/net/if_ppp.c7
-rw-r--r--sys/net/if_ppp.h4
-rw-r--r--sys/net/if_spppsubr.c11
-rw-r--r--sys/net/netisr.h3
-rw-r--r--sys/net/route.h3
-rw-r--r--sys/net/rtsock.c7
9 files changed, 83 insertions, 10 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index ff63303..9da90b1 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $Id: if_ethersubr.c,v 1.8.2.1 1995/06/03 04:46:21 davidg Exp $
+ * $Id: if_ethersubr.c,v 1.9 1995/06/11 19:31:39 rgrimes Exp $
*/
#include <sys/param.h>
@@ -60,6 +60,11 @@
#endif
#include <netinet/if_ether.h>
+#ifdef IPX
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
+#endif
+
#ifdef NS
#include <netns/ns.h>
#include <netns/ns_if.h>
@@ -147,6 +152,18 @@ ether_output(ifp, m0, dst, rt0)
type = ETHERTYPE_IP;
break;
#endif
+#ifdef IPX
+ case AF_IPX:
+ type = ETHERTYPE_IPX;
+ bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
+ (caddr_t)edst, sizeof (edst));
+ if (!bcmp((caddr_t)edst, (caddr_t)&ipx_thishost, sizeof(edst)))
+ return (looutput(ifp, m, dst, rt));
+ /* If broadcasting on a simplex interface, loopback a copy */
+ if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
+ mcopy = m_copy(m, 0, (int)M_COPYALL);
+ break;
+#endif
#ifdef NS
case AF_NS:
type = ETHERTYPE_NS;
@@ -342,12 +359,17 @@ ether_input(ifp, eh, m)
inq = &arpintrq;
break;
#endif
+#ifdef IPX
+ case ETHERTYPE_IPX:
+ schednetisr(NETISR_IPX);
+ inq = &ipxintrq;
+ break;
+#endif
#ifdef NS
case ETHERTYPE_NS:
schednetisr(NETISR_NS);
inq = &nsintrq;
break;
-
#endif
default:
#if defined (ISO) || defined (LLC)
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index 41ea156..0824ede 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp
- * $Id: if_fddisubr.c,v 1.4 1995/05/09 13:35:40 davidg Exp $
+ * $Id: if_fddisubr.c,v 1.5 1995/05/30 08:08:05 rgrimes Exp $
*/
#include <sys/param.h>
@@ -61,6 +61,11 @@
#include <netinet/if_ether.h>
#include <netinet/if_fddi.h>
+#ifdef IPX
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
+#endif
+
#ifdef NS
#include <netns/ns.h>
#include <netns/ns_if.h>
@@ -164,6 +169,18 @@ fddi_output(ifp, m0, dst, rt0)
type = ETHERTYPE_IP;
break;
#endif
+#ifdef IPX
+ case AF_IPX:
+ type = ETHERTYPE_IPX;
+ bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
+ (caddr_t)edst, sizeof (edst));
+ if (!bcmp((caddr_t)edst, (caddr_t)&ipx_thishost, sizeof(edst)))
+ return (looutput(ifp, m, dst, rt));
+ /* If broadcasting on a simplex interface, loopback a copy */
+ if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
+ mcopy = m_copy(m, 0, (int)M_COPYALL);
+ break;
+#endif
#ifdef NS
case AF_NS:
type = ETHERTYPE_NS;
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 5bf79ee..cf29912 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_loop.c 8.1 (Berkeley) 6/10/93
- * $Id: if_loop.c,v 1.12 1995/09/09 18:10:22 davidg Exp $
+ * $Id: if_loop.c,v 1.13 1995/09/22 17:57:48 wollman Exp $
*/
/*
@@ -63,6 +63,11 @@
#include <netinet/ip.h>
#endif
+#ifdef IPX
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
+#endif
+
#ifdef NS
#include <netns/ns.h>
#include <netns/ns_if.h>
@@ -169,6 +174,12 @@ looutput(ifp, m, dst, rt)
isr = NETISR_IP;
break;
#endif
+#ifdef IPX
+ case AF_IPX:
+ ifq = &ipxintrq;
+ isr = NETISR_IPX;
+ break;
+#endif
#ifdef NS
case AF_NS:
ifq = &nsintrq;
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 7e1a321..dab6370 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -69,7 +69,7 @@
* Paul Mackerras (paulus@cs.anu.edu.au).
*/
-/* $Id: if_ppp.c,v 1.21 1995/09/09 18:10:23 davidg Exp $ */
+/* $Id: if_ppp.c,v 1.22 1995/10/05 00:33:27 bde Exp $ */
/* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
#include "ppp.h"
@@ -699,6 +699,11 @@ pppoutput(ifp, m0, dst, rt)
break;
#endif
+#ifdef IPX
+ case AF_IPX:
+ protocol = PPP_IPX;
+ break;
+#endif
#ifdef NS
case AF_NS:
protocol = PPP_XNS;
diff --git a/sys/net/if_ppp.h b/sys/net/if_ppp.h
index 97df728..099b9be 100644
--- a/sys/net/if_ppp.h
+++ b/sys/net/if_ppp.h
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: if_ppp.h,v 1.2 1994/09/23 00:13:20 wollman Exp $
+ * $Id: if_ppp.h,v 1.3 1995/05/30 08:08:09 rgrimes Exp $
*/
#ifndef _IF_PPP_H_
@@ -45,10 +45,12 @@ struct ppp_header {
*/
#define PPP_IP 0x21 /* Internet Protocol */
#define PPP_XNS 0x25 /* Xerox NS */
+#define PPP_IPX 0x2b /* IPX Datagram (RFC1552) */
#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */
#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */
#define PPP_COMP 0xfd /* compressed packet */
#define PPP_LCP 0xc021 /* Link Control Protocol */
+#define PPP_IPXCP 0x802b /* IPX Control Protocol (RFC1552) */
#define PPP_CCP 0x80fd /* Compression Control Protocol */
/*
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index e8a9576..c26fddc 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -36,6 +36,11 @@
#include <netinet/if_ether.h>
#endif
+#ifdef IPX
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
+#endif
+
#ifdef NS
#include <netns/ns.h>
#include <netns/ns_if.h>
@@ -405,6 +410,12 @@ int sppp_output (struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct
ETHERTYPE_NS : PPP_XNS);
break;
#endif
+#ifdef IPX
+ case AF_IPX: /* Xerox NS Protocol */
+ h->protocol = htons ((sp->pp_flags & PP_CISCO) ?
+ ETHERTYPE_IPX : PPP_XNS);
+ break;
+#endif
#ifdef ISO
case AF_ISO: /* ISO OSI Protocol */
if (sp->pp_flags & PP_CISCO)
diff --git a/sys/net/netisr.h b/sys/net/netisr.h
index 3558348..5dd9b87 100644
--- a/sys/net/netisr.h
+++ b/sys/net/netisr.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)netisr.h 8.1 (Berkeley) 6/10/93
- * $Id: netisr.h,v 1.5 1995/01/05 19:51:47 se Exp $
+ * $Id: netisr.h,v 1.6 1995/05/11 00:13:10 wollman Exp $
*/
#ifndef _NET_NETISR_H_
@@ -62,6 +62,7 @@
#define NETISR_ISO 7 /* same as AF_ISO */
#define NETISR_CCITT 10 /* same as AF_CCITT */
#define NETISR_ARP 18 /* same as AF_LINK */
+#define NETISR_IPX 23 /* same as AF_IPX */
#define NETISR_ISDN 26 /* same as AF_E164 */
#define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); }
diff --git a/sys/net/route.h b/sys/net/route.h
index 894669c..6d26488 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)route.h 8.3 (Berkeley) 4/19/94
- * $Id: route.h,v 1.15 1995/07/29 11:41:03 bde Exp $
+ * $Id: route.h,v 1.16 1995/10/16 20:53:55 wollman Exp $
*/
#ifndef _NET_ROUTE_H_
@@ -242,6 +242,7 @@ struct rt_addrinfo {
struct route_cb {
int ip_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 2601ad7..f24ac4e 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)rtsock.c 8.5 (Berkeley) 11/2/94
- * $Id: rtsock.c,v 1.14 1995/10/09 04:06:28 bde Exp $
+ * $Id: rtsock.c,v 1.15 1995/10/13 16:01:59 wollman Exp $
*/
#include <sys/param.h>
@@ -92,12 +92,13 @@ route_usrreq(so, req, m, nam, control)
so->so_pcb = (caddr_t)rp;
if (so->so_pcb)
bzero(so->so_pcb, sizeof(*rp));
-
}
if (req == PRU_DETACH && rp) {
int af = rp->rcb_proto.sp_protocol;
if (af == AF_INET)
route_cb.ip_count--;
+ else if (af == AF_IPX)
+ route_cb.ipx_count--;
else if (af == AF_NS)
route_cb.ns_count--;
else if (af == AF_ISO)
@@ -116,6 +117,8 @@ route_usrreq(so, req, m, nam, control)
}
if (af == AF_INET)
route_cb.ip_count++;
+ else if (af == AF_IPX)
+ route_cb.ipx_count++;
else if (af == AF_NS)
route_cb.ns_count++;
else if (af == AF_ISO)
OpenPOWER on IntegriCloud