diff options
author | Boris Popov <bp@FreeBSD.org> | 1999-12-13 16:24:22 +0000 |
---|---|---|
committer | Boris Popov <bp@FreeBSD.org> | 1999-12-13 16:24:22 +0000 |
commit | 4f93599fba5500180b7fd690683a1546ff1a683f (patch) | |
tree | 42ffc82a0af54fbc073f6421fbe397b2de6f5525 /sys/net/if_ethersubr.c | |
parent | 8b7805e44e9aeaf8fd798a813f000e087eac63b9 (diff) | |
download | src-4f93599fba5500180b7fd690683a1546ff1a683f.tar.gz src-4f93599fba5500180b7fd690683a1546ff1a683f.zip |
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>
Notes
Notes:
svn path=/head/; revision=54558
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index bf11e9d9f4df..f01ccc1a1ea0 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 */ |