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

Function bstp_attach

freebsd/net/bridgestp.c:2137–2161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2135MODULE_VERSION(bridgestp, 1);
2136
2137void
2138bstp_attach(struct bstp_state *bs, struct bstp_cb_ops *cb)
2139{
2140 BSTP_LOCK_INIT(bs);
2141 callout_init_mtx(&bs->bs_bstpcallout, &bs->bs_mtx, 0);
2142 LIST_INIT(&bs->bs_bplist);
2143
2144 bs->bs_bridge_max_age = BSTP_DEFAULT_MAX_AGE;
2145 bs->bs_bridge_htime = BSTP_DEFAULT_HELLO_TIME;
2146 bs->bs_bridge_fdelay = BSTP_DEFAULT_FORWARD_DELAY;
2147 bs->bs_bridge_priority = BSTP_DEFAULT_BRIDGE_PRIORITY;
2148 bs->bs_hold_time = BSTP_DEFAULT_HOLD_TIME;
2149 bs->bs_migration_delay = BSTP_DEFAULT_MIGRATE_DELAY;
2150 bs->bs_txholdcount = BSTP_DEFAULT_HOLD_COUNT;
2151 bs->bs_protover = BSTP_PROTO_RSTP;
2152 bs->bs_state_cb = cb->bcb_state;
2153 bs->bs_rtage_cb = cb->bcb_rtage;
2154 bs->bs_vnet = curvnet;
2155
2156 getmicrotime(&bs->bs_last_tc_time);
2157
2158 mtx_lock(&bstp_list_mtx);
2159 LIST_INSERT_HEAD(&bstp_list, bs, bs_list);
2160 mtx_unlock(&bstp_list_mtx);
2161}
2162
2163void
2164bstp_detach(struct bstp_state *bs)

Callers 1

bridge_clone_createFunction · 0.85

Calls 3

getmicrotimeFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected