summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>1999-12-13 16:24:22 +0000
committerbp <bp@FreeBSD.org>1999-12-13 16:24:22 +0000
commit390ab38ea8753fb1b368174480d1539a4c6f0f7e (patch)
tree8a54df3befe786a2b2e84bb40d3d0b6799f1773c /sys/net/if_ethersubr.c
parent5e7ec8edf1a8ac8a9a4f9fd827fb39beb4ec1b03 (diff)
downloadFreeBSD-src-390ab38ea8753fb1b368174480d1539a4c6f0f7e.zip
FreeBSD-src-390ab38ea8753fb1b368174480d1539a4c6f0f7e.tar.gz
Bring up an if_ef driver which allows support for four ethernet
frame types. Currently it supports only IPX protocol and doesn't affect existing functionality when not loaded. Reviewed by: Ollivier Robert <roberto@keltia.freenix.fr>
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index bf11e9d..f01ccc1 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -70,6 +70,9 @@
#ifdef IPX
#include <netipx/ipx.h>
#include <netipx/ipx_if.h>
+int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m);
+int (*ef_outputp)(struct ifnet *ifp, struct mbuf *m,
+ struct sockaddr *dst, short *tp);
#endif
#ifdef NS
@@ -233,7 +236,14 @@ ether_output(ifp, m0, dst, rt0)
#endif
#ifdef IPX
case AF_IPX:
- type = htons(ETHERTYPE_IPX);
+ if (ef_outputp) {
+ error = ef_outputp(ifp, m, dst, &type);
+ if (error < 0)
+ senderr(EPFNOSUPPORT);
+ if (error > 0)
+ type = htons(ETHERTYPE_IPX);
+ } else
+ type = htons(ETHERTYPE_IPX);
bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
(caddr_t)edst, sizeof (edst));
break;
@@ -543,6 +553,8 @@ ether_input(ifp, eh, m)
#endif
#ifdef IPX
case ETHERTYPE_IPX:
+ if (ef_inputp && ef_inputp(ifp, eh, m) == 0)
+ return;
schednetisr(NETISR_IPX);
inq = &ipxintrq;
break;
@@ -571,6 +583,10 @@ ether_input(ifp, eh, m)
return;
#endif NETATALK
default:
+#ifdef IPX
+ if (ef_inputp && ef_inputp(ifp, eh, m) == 0)
+ return;
+#endif /* IPX */
#ifdef NS
checksum = mtod(m, ushort *);
/* Novell 802.3 */
OpenPOWER on IntegriCloud