Lines Matching defs:bpdu
62 /* BPDU message types */
66 /* BPDU flags */
74 * Because BPDU's do not make nicely aligned structures, two different
75 * declarations are used: bstp_?bpdu (wire representation, packed) and
221 struct bstp_cbpdu bpdu;
237 m->m_pkthdr.len = sizeof(*eh) + sizeof(bpdu);
240 bpdu.cbu_ssap = bpdu.cbu_dsap = LLC_8021D_LSAP;
241 bpdu.cbu_ctl = LLC_UI;
242 bpdu.cbu_protoid = htons(0);
243 bpdu.cbu_protover = 0;
244 bpdu.cbu_bpdutype = cu->cu_message_type;
245 bpdu.cbu_flags = (cu->cu_topology_change ? BSTP_FLAG_TC : 0) |
248 bpdu.cbu_rootpri = htons(cu->cu_rootid >> 48);
249 bpdu.cbu_rootaddr[0] = cu->cu_rootid >> 40;
250 bpdu.cbu_rootaddr[1] = cu->cu_rootid >> 32;
251 bpdu.cbu_rootaddr[2] = cu->cu_rootid >> 24;
252 bpdu.cbu_rootaddr[3] = cu->cu_rootid >> 16;
253 bpdu.cbu_rootaddr[4] = cu->cu_rootid >> 8;
254 bpdu.cbu_rootaddr[5] = cu->cu_rootid >> 0;
256 bpdu.cbu_rootpathcost = htonl(cu->cu_root_path_cost);
258 bpdu.cbu_bridgepri = htons(cu->cu_rootid >> 48);
259 bpdu.cbu_bridgeaddr[0] = cu->cu_rootid >> 40;
260 bpdu.cbu_bridgeaddr[1] = cu->cu_rootid >> 32;
261 bpdu.cbu_bridgeaddr[2] = cu->cu_rootid >> 24;
262 bpdu.cbu_bridgeaddr[3] = cu->cu_rootid >> 16;
263 bpdu.cbu_bridgeaddr[4] = cu->cu_rootid >> 8;
264 bpdu.cbu_bridgeaddr[5] = cu->cu_rootid >> 0;
266 bpdu.cbu_portid = htons(cu->cu_port_id);
267 bpdu.cbu_messageage = htons(cu->cu_message_age);
268 bpdu.cbu_maxage = htons(cu->cu_max_age);
269 bpdu.cbu_hellotime = htons(cu->cu_hello_time);
270 bpdu.cbu_forwarddelay = htons(cu->cu_forward_delay);
274 eh->ether_type = htons(sizeof(bpdu));
276 memcpy(mtod(m, char *) + sizeof(*eh), &bpdu, sizeof(bpdu));
360 struct bstp_tbpdu bpdu;
378 m->m_pkthdr.len = sizeof(*eh) + sizeof(bpdu);
385 eh->ether_type = htons(sizeof(bpdu));
387 bpdu.tbu_ssap = bpdu.tbu_dsap = LLC_8021D_LSAP;
388 bpdu.tbu_ctl = LLC_UI;
389 bpdu.tbu_protoid = 0;
390 bpdu.tbu_protover = 0;
391 bpdu.tbu_bpdutype = BSTP_MSGTYPE_TCN;
393 memcpy(mtod(m, char *) + sizeof(*eh), &bpdu, sizeof(bpdu));