MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bstp_enable

Function bstp_enable

freebsd/net/bridgestp.c:2225–2249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2223}
2224
2225int
2226bstp_enable(struct bstp_port *bp)
2227{
2228 struct bstp_state *bs = bp->bp_bs;
2229 struct ifnet *ifp = bp->bp_ifp;
2230
2231 KASSERT(bp->bp_active == 0, ("already a bstp member"));
2232
2233 switch (ifp->if_type) {
2234 case IFT_ETHER: /* These can do spanning tree. */
2235 break;
2236 default:
2237 /* Nothing else can. */
2238 return (EINVAL);
2239 }
2240
2241 BSTP_LOCK(bs);
2242 LIST_INSERT_HEAD(&bs->bs_bplist, bp, bp_next);
2243 bp->bp_active = 1;
2244 bp->bp_flags |= BSTP_PORT_NEWINFO;
2245 bstp_reinit(bs);
2246 bstp_update_roles(bs, bp);
2247 BSTP_UNLOCK(bs);
2248 return (0);
2249}
2250
2251void
2252bstp_disable(struct bstp_port *bp)

Callers 1

bridge_ioctl_sifflagsFunction · 0.85

Calls 2

bstp_reinitFunction · 0.85
bstp_update_rolesFunction · 0.85

Tested by

no test coverage detected