summaryrefslogtreecommitdiffstats
path: root/sys/net/ethernet.h
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2000-06-26 23:34:54 +0000
committerarchie <archie@FreeBSD.org>2000-06-26 23:34:54 +0000
commit9af816e94656f88812336df4be5d2ddac233080f (patch)
tree3c138021e860caf3702977959a7cf77c2d4eb2e3 /sys/net/ethernet.h
parent9b2c6ebcad4b7500a4fb6f89dcd04a814bc3e7ac (diff)
downloadFreeBSD-src-9af816e94656f88812336df4be5d2ddac233080f.zip
FreeBSD-src-9af816e94656f88812336df4be5d2ddac233080f.tar.gz
Make the ng_ether(4) node type dynamically loadable like the rest.
This means 'options NETGRAPH' is no longer necessary in order to get netgraph-enabled Ethernet interfaces. This supports loading/unloading the ng_ether.ko and attaching/detaching the Ethernet interface in any order. Add two new hooks 'upper' and 'lower' to allow access to the protocol demux engine and the raw device, respectively. This enables bridging to be defined as a netgraph node, if so desired. Reviewed by: freebsd-net@freebsd.org
Diffstat (limited to 'sys/net/ethernet.h')
-rw-r--r--sys/net/ethernet.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h
index 7295e5a..5bb3448 100644
--- a/sys/net/ethernet.h
+++ b/sys/net/ethernet.h
@@ -80,7 +80,18 @@ struct ether_addr {
#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#ifndef _KERNEL
+#ifdef _KERNEL
+
+extern void (*ng_ether_input_p)(struct ifnet *ifp,
+ struct mbuf **mp, struct ether_header *eh);
+extern void (*ng_ether_input_orphan_p)(struct ifnet *ifp,
+ struct mbuf *m, struct ether_header *eh);
+extern int (*ng_ether_output_p)(struct ifnet *ifp, struct mbuf **mp);
+extern void (*ng_ether_attach_p)(struct ifnet *ifp);
+extern void (*ng_ether_detach_p)(struct ifnet *ifp);
+
+#else /* _KERNEL */
+
#include <sys/cdefs.h>
/*
@@ -93,6 +104,7 @@ int ether_line __P((char *, struct ether_addr *, char *));
char *ether_ntoa __P((struct ether_addr *));
int ether_ntohost __P((char *, struct ether_addr *));
__END_DECLS
-#endif
+
+#endif /* !_KERNEL */
#endif /* !_NET_ETHERNET_H_ */
OpenPOWER on IntegriCloud