| 2135 | MODULE_VERSION(bridgestp, 1); |
| 2136 | |
| 2137 | void |
| 2138 | bstp_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 | |
| 2163 | void |
| 2164 | bstp_detach(struct bstp_state *bs) |
no test coverage detected