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

Function bstp_create

freebsd/net/bridgestp.c:2200–2223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2198}
2199
2200int
2201bstp_create(struct bstp_state *bs, struct bstp_port *bp, struct ifnet *ifp)
2202{
2203 bzero(bp, sizeof(struct bstp_port));
2204
2205 BSTP_LOCK(bs);
2206 bp->bp_ifp = ifp;
2207 bp->bp_bs = bs;
2208 bp->bp_priority = BSTP_DEFAULT_PORT_PRIORITY;
2209 TASK_INIT(&bp->bp_statetask, 0, bstp_notify_state, bp);
2210 TASK_INIT(&bp->bp_rtagetask, 0, bstp_notify_rtage, bp);
2211 TASK_INIT(&bp->bp_mediatask, 0, bstp_ifupdstatus, bp);
2212
2213 /* Init state */
2214 bp->bp_infois = BSTP_INFO_DISABLED;
2215 bp->bp_flags = BSTP_PORT_AUTOEDGE|BSTP_PORT_AUTOPTP;
2216 bstp_set_port_state(bp, BSTP_IFSTATE_DISCARDING);
2217 bstp_set_port_proto(bp, bs->bs_protover);
2218 bstp_set_port_role(bp, BSTP_ROLE_DISABLED);
2219 bstp_set_port_tc(bp, BSTP_TCSTATE_INACTIVE);
2220 bp->bp_path_cost = bstp_calc_path_cost(bp);
2221 BSTP_UNLOCK(bs);
2222 return (0);
2223}
2224
2225int
2226bstp_enable(struct bstp_port *bp)

Callers 1

bridge_ioctl_addFunction · 0.85

Calls 6

bzeroFunction · 0.85
bstp_set_port_stateFunction · 0.85
bstp_set_port_protoFunction · 0.85
bstp_set_port_roleFunction · 0.85
bstp_set_port_tcFunction · 0.85
bstp_calc_path_costFunction · 0.85

Tested by

no test coverage detected