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

Function bstp_transmit

freebsd/net/bridgestp.c:154–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152static void bstp_reinit(struct bstp_state *);
153
154static void
155bstp_transmit(struct bstp_state *bs, struct bstp_port *bp)
156{
157 if (bs->bs_running == 0)
158 return;
159
160 /*
161 * a PDU can only be sent if we have tx quota left and the
162 * hello timer is running.
163 */
164 if (bp->bp_hello_timer.active == 0) {
165 /* Test if it needs to be reset */
166 bstp_hello_timer_expiry(bs, bp);
167 return;
168 }
169 if (bp->bp_txcount > bs->bs_txholdcount)
170 /* Ran out of karma */
171 return;
172
173 if (bp->bp_protover == BSTP_PROTO_RSTP) {
174 bstp_transmit_bpdu(bs, bp);
175 bp->bp_tc_ack = 0;
176 } else { /* STP */
177 switch (bp->bp_role) {
178 case BSTP_ROLE_DESIGNATED:
179 bstp_transmit_bpdu(bs, bp);
180 bp->bp_tc_ack = 0;
181 break;
182
183 case BSTP_ROLE_ROOT:
184 bstp_transmit_tcn(bs, bp);
185 break;
186 }
187 }
188 bstp_timer_start(&bp->bp_hello_timer, bp->bp_desg_htime);
189 bp->bp_flags &= ~BSTP_PORT_NEWINFO;
190}
191
192static void
193bstp_transmit_bpdu(struct bstp_state *bs, struct bstp_port *bp)

Callers 3

bstp_update_rolesFunction · 0.85
bstp_set_port_tcFunction · 0.85
bstp_hello_timer_expiryFunction · 0.85

Calls 4

bstp_hello_timer_expiryFunction · 0.85
bstp_transmit_bpduFunction · 0.85
bstp_transmit_tcnFunction · 0.85
bstp_timer_startFunction · 0.85

Tested by

no test coverage detected