diff options
author | thompsa <thompsa@FreeBSD.org> | 2005-10-14 02:38:47 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2005-10-14 02:38:47 +0000 |
commit | 117e7120fa181d5236c7e36d4f4fd5bc3811fbc8 (patch) | |
tree | 79681e5e8c326ab9ad2fb9850212ba23c6a8ec86 /sys/net/if_bridgevar.h | |
parent | a2a05b4695590e296794cfb6673385b755a86bfe (diff) | |
download | FreeBSD-src-117e7120fa181d5236c7e36d4f4fd5bc3811fbc8.zip FreeBSD-src-117e7120fa181d5236c7e36d4f4fd5bc3811fbc8.tar.gz |
Further clean up the bridge hooks in if_ethersubr.c and ng_ether.c
- move the function pointer definitions to if_bridgevar.h
- move most of the logic to the new BRIDGE_INPUT and BRIDGE_OUTPUT macros
- remove unneeded functions from if_bridgevar.h and sort a little.
Diffstat (limited to 'sys/net/if_bridgevar.h')
-rw-r--r-- | sys/net/if_bridgevar.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h index 2cd7704..7c6b9c2 100644 --- a/sys/net/if_bridgevar.h +++ b/sys/net/if_bridgevar.h @@ -76,6 +76,7 @@ #include <sys/callout.h> #include <sys/queue.h> +#include <sys/condvar.h> /* * Commands used in the SIOCSDRVSPEC ioctl. Note the lookup of the @@ -335,23 +336,36 @@ struct bridge_softc { (_sc)->sc_iflist_xcnt--; \ } while (0) +#define BRIDGE_INPUT(_ifp, _m) do { \ + KASSERT(bridge_input_p != NULL, \ + ("%s: if_bridge not loaded!", __func__)); \ + _m = (*bridge_input_p)(_ifp, _m); \ + if (_m != NULL) \ + _ifp = _m->m_pkthdr.rcvif; \ +} while (0) + +#define BRIDGE_OUTPUT(_ifp, _m, _err) do { \ + KASSERT(bridge_output_p != NULL, \ + ("%s: if_bridge not loaded!", __func__)); \ + _err = (*bridge_output_p)(_ifp, _m, NULL, NULL); \ +} while (0) + extern const uint8_t bstp_etheraddr[]; -void bridge_ifdetach(struct ifnet *); +void bridge_enqueue(struct bridge_softc *, struct ifnet *, struct mbuf *); void bridge_rtdelete(struct bridge_softc *, struct ifnet *ifp, int); -int bridge_output(struct ifnet *, struct mbuf *, struct sockaddr *, - struct rtentry *); -void bridge_dummynet(struct mbuf *, struct ifnet *); -struct mbuf *bridge_input(struct ifnet *, struct mbuf *); - -extern void (*bstp_linkstate_p)(struct ifnet *ifp, int state); +extern struct mbuf *(*bridge_input_p)(struct ifnet *, struct mbuf *); +extern int (*bridge_output_p)(struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *); +extern void (*bridge_dn_p)(struct mbuf *, struct ifnet *); +extern void (*bridge_detach_p)(struct ifnet *); +extern void (*bstp_linkstate_p)(struct ifnet *ifp, int state); void bstp_initialization(struct bridge_softc *); void bstp_linkstate(struct ifnet *, int); void bstp_stop(struct bridge_softc *); struct mbuf *bstp_input(struct ifnet *, struct mbuf *); -void bridge_enqueue(struct bridge_softc *, struct ifnet *, struct mbuf *); #endif /* _KERNEL */ |