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

Function bstp_set_port_proto

freebsd/net/bridgestp.c:1313–1342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1311}
1312
1313static void
1314bstp_set_port_proto(struct bstp_port *bp, int proto)
1315{
1316 struct bstp_state *bs = bp->bp_bs;
1317
1318 /* supported protocol versions */
1319 switch (proto) {
1320 case BSTP_PROTO_STP:
1321 /* we can downgrade protocols only */
1322 bstp_timer_stop(&bp->bp_migrate_delay_timer);
1323 /* clear unsupported features */
1324 bp->bp_operedge = 0;
1325 /* STP compat mode only uses 16 bits of the 32 */
1326 if (bp->bp_path_cost > 65535)
1327 bp->bp_path_cost = 65535;
1328 break;
1329
1330 case BSTP_PROTO_RSTP:
1331 bstp_timer_start(&bp->bp_migrate_delay_timer,
1332 bs->bs_migration_delay);
1333 break;
1334
1335 default:
1336 DPRINTF("Unsupported STP version %d\n", proto);
1337 return;
1338 }
1339
1340 bp->bp_protover = proto;
1341 bp->bp_flags &= ~BSTP_PORT_CANMIGRATE;
1342}
1343
1344static void
1345bstp_set_port_tc(struct bstp_port *bp, int state)

Callers 3

bstp_inputFunction · 0.85
bstp_set_protocolFunction · 0.85
bstp_createFunction · 0.85

Calls 2

bstp_timer_stopFunction · 0.85
bstp_timer_startFunction · 0.85

Tested by

no test coverage detected