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

Function bstp_set_port_state

freebsd/net/bridgestp.c:1202–1237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1200}
1201
1202static void
1203bstp_set_port_state(struct bstp_port *bp, int state)
1204{
1205 if (bp->bp_state == state)
1206 return;
1207
1208 bp->bp_state = state;
1209
1210 switch (bp->bp_state) {
1211 case BSTP_IFSTATE_DISCARDING:
1212 DPRINTF("state changed to DISCARDING on %s\n",
1213 bp->bp_ifp->if_xname);
1214 break;
1215
1216 case BSTP_IFSTATE_LEARNING:
1217 DPRINTF("state changed to LEARNING on %s\n",
1218 bp->bp_ifp->if_xname);
1219
1220 bstp_timer_start(&bp->bp_forward_delay_timer,
1221 bp->bp_protover == BSTP_PROTO_RSTP ?
1222 bp->bp_desg_htime : bp->bp_desg_fdelay);
1223 break;
1224
1225 case BSTP_IFSTATE_FORWARDING:
1226 DPRINTF("state changed to FORWARDING on %s\n",
1227 bp->bp_ifp->if_xname);
1228
1229 bstp_timer_stop(&bp->bp_forward_delay_timer);
1230 /* Record that we enabled forwarding */
1231 bp->bp_forward_transitions++;
1232 break;
1233 }
1234
1235 /* notify the parent bridge */
1236 taskqueue_enqueue(taskqueue_swi, &bp->bp_statetask);
1237}
1238
1239static void
1240bstp_set_port_role(struct bstp_port *bp, int role)

Callers 4

bstp_update_rolesFunction · 0.85
bstp_set_port_roleFunction · 0.85
bstp_stopFunction · 0.85
bstp_createFunction · 0.85

Calls 3

bstp_timer_startFunction · 0.85
bstp_timer_stopFunction · 0.85
taskqueue_enqueueFunction · 0.85

Tested by

no test coverage detected