+/*
+ * We need additional info for the bridge. The bdg_ifp2sc[] array
+ * provides a pointer to this struct using the if_index.
+ * bdg_softc has a backpointer to the struct ifnet, the bridge
+ * flags, and a cluster (bridging occurs only between port of the
+ * same cluster).
+ */
+struct bdg_softc {
+ struct ifnet *ifp ;
+ /* also ((struct arpcom *)ifp)->ac_enaddr is the eth. addr */
+ int flags ;
+#define IFF_BDG_PROMISC 0x0001 /* set promisc mode on this if. */
+#define IFF_MUTE 0x0002 /* mute this if for bridging. */
+#define IFF_USED 0x0004 /* use this if for bridging. */
+ short cluster_id ; /* in network format */
+ u_long magic;
+} ;
+
+extern struct bdg_softc *ifp2sc;
+
+#define BDG_USED(ifp) (ifp2sc[ifp->if_index].flags & IFF_USED)
+#define BDG_MUTED(ifp) (ifp2sc[ifp->if_index].flags & IFF_MUTE)
+#define BDG_MUTE(ifp) ifp2sc[ifp->if_index].flags |= IFF_MUTE
+#define BDG_UNMUTE(ifp) ifp2sc[ifp->if_index].flags &= ~IFF_MUTE
+#define BDG_CLUSTER(ifp) (ifp2sc[ifp->if_index].cluster_id)
+#define BDG_EH(ifp) ((struct arpcom *)ifp)->ac_enaddr
+
+#define BDG_SAMECLUSTER(ifp,src) \
+ (src == NULL || BDG_CLUSTER(ifp) == BDG_CLUSTER(src) )
+
+