| 190 | } |
| 191 | |
| 192 | static void |
| 193 | bstp_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 | |
| 228 | static void |
| 229 | bstp_transmit_tcn(struct bstp_state *bs, struct bstp_port *bp) |
no test coverage detected