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

Function bstp_transmit_bpdu

freebsd/net/bridgestp.c:192–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192static void
193bstp_transmit_bpdu(struct bstp_state *bs, struct bstp_port *bp)
194{
195 struct bstp_cbpdu bpdu;
196
197 BSTP_LOCK_ASSERT(bs);
198
199 bpdu.cbu_rootpri = htons(bp->bp_desg_pv.pv_root_id >> 48);
200 PV2ADDR(bp->bp_desg_pv.pv_root_id, bpdu.cbu_rootaddr);
201
202 bpdu.cbu_rootpathcost = htonl(bp->bp_desg_pv.pv_cost);
203
204 bpdu.cbu_bridgepri = htons(bp->bp_desg_pv.pv_dbridge_id >> 48);
205 PV2ADDR(bp->bp_desg_pv.pv_dbridge_id, bpdu.cbu_bridgeaddr);
206
207 bpdu.cbu_portid = htons(bp->bp_port_id);
208 bpdu.cbu_messageage = htons(bp->bp_desg_msg_age);
209 bpdu.cbu_maxage = htons(bp->bp_desg_max_age);
210 bpdu.cbu_hellotime = htons(bp->bp_desg_htime);
211 bpdu.cbu_forwarddelay = htons(bp->bp_desg_fdelay);
212
213 bpdu.cbu_flags = bstp_pdu_flags(bp);
214
215 switch (bp->bp_protover) {
216 case BSTP_PROTO_STP:
217 bpdu.cbu_bpdutype = BSTP_MSGTYPE_CFG;
218 break;
219
220 case BSTP_PROTO_RSTP:
221 bpdu.cbu_bpdutype = BSTP_MSGTYPE_RSTP;
222 break;
223 }
224
225 bstp_send_bpdu(bs, bp, &bpdu);
226}
227
228static void
229bstp_transmit_tcn(struct bstp_state *bs, struct bstp_port *bp)

Callers 1

bstp_transmitFunction · 0.85

Calls 2

bstp_pdu_flagsFunction · 0.85
bstp_send_bpduFunction · 0.85

Tested by

no test coverage detected