Lines Matching refs:stp_bpdu
102 stp_print_config_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, in stp_print_config_bpdu() argument
105 ND_TCHECK(stp_bpdu->flags); in stp_print_config_bpdu()
107 bittok2str(stp_bpdu_flag_values, "none", stp_bpdu->flags))); in stp_print_config_bpdu()
109 ND_TCHECK(stp_bpdu->port_id); in stp_print_config_bpdu()
111 stp_print_bridge_id((const u_char *)&stp_bpdu->bridge_id), in stp_print_config_bpdu()
112 EXTRACT_16BITS(&stp_bpdu->port_id), length)); in stp_print_config_bpdu()
119 ND_TCHECK(stp_bpdu->forward_delay); in stp_print_config_bpdu()
122 (float)EXTRACT_16BITS(&stp_bpdu->message_age) / STP_TIME_BASE, in stp_print_config_bpdu()
123 (float)EXTRACT_16BITS(&stp_bpdu->max_age) / STP_TIME_BASE, in stp_print_config_bpdu()
124 (float)EXTRACT_16BITS(&stp_bpdu->hello_time) / STP_TIME_BASE, in stp_print_config_bpdu()
125 (float)EXTRACT_16BITS(&stp_bpdu->forward_delay) / STP_TIME_BASE)); in stp_print_config_bpdu()
128 stp_print_bridge_id((const u_char *)&stp_bpdu->root_id), in stp_print_config_bpdu()
129 EXTRACT_32BITS(&stp_bpdu->root_path_cost))); in stp_print_config_bpdu()
132 if (stp_bpdu->protocol_version == STP_PROTO_RAPID) { in stp_print_config_bpdu()
135 RSTP_EXTRACT_PORT_ROLE(stp_bpdu->flags)))); in stp_print_config_bpdu()
239 stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, in stp_print_mstp_bpdu() argument
248 ptr = (const u_char *)stp_bpdu; in stp_print_mstp_bpdu()
250 bittok2str(stp_bpdu_flag_values, "none", stp_bpdu->flags), length)); in stp_print_mstp_bpdu()
259 ND_TCHECK(stp_bpdu->flags); in stp_print_mstp_bpdu()
262 RSTP_EXTRACT_PORT_ROLE(stp_bpdu->flags)))); in stp_print_mstp_bpdu()
264 ND_TCHECK(stp_bpdu->root_path_cost); in stp_print_mstp_bpdu()
266 stp_print_bridge_id((const u_char *)&stp_bpdu->root_id), in stp_print_mstp_bpdu()
267 EXTRACT_32BITS(&stp_bpdu->root_path_cost))); in stp_print_mstp_bpdu()
269 ND_TCHECK(stp_bpdu->bridge_id); in stp_print_mstp_bpdu()
271 stp_print_bridge_id((const u_char *)&stp_bpdu->bridge_id))); in stp_print_mstp_bpdu()
273 ND_TCHECK(stp_bpdu->port_id); in stp_print_mstp_bpdu()
274 ND_PRINT((ndo, "CIST port-id %04x,", EXTRACT_16BITS(&stp_bpdu->port_id))); in stp_print_mstp_bpdu()
276 ND_TCHECK(stp_bpdu->forward_delay); in stp_print_mstp_bpdu()
279 (float)EXTRACT_16BITS(&stp_bpdu->message_age) / STP_TIME_BASE, in stp_print_mstp_bpdu()
280 (float)EXTRACT_16BITS(&stp_bpdu->max_age) / STP_TIME_BASE, in stp_print_mstp_bpdu()
281 (float)EXTRACT_16BITS(&stp_bpdu->hello_time) / STP_TIME_BASE, in stp_print_mstp_bpdu()
282 (float)EXTRACT_16BITS(&stp_bpdu->forward_delay) / STP_TIME_BASE)); in stp_print_mstp_bpdu()
347 stp_print_spb_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, in stp_print_spb_bpdu() argument
359 ptr = (const u_char *)stp_bpdu; in stp_print_spb_bpdu()
404 const struct stp_bpdu_ *stp_bpdu; in stp_print() local
408 stp_bpdu = (const struct stp_bpdu_*)p; in stp_print()
414 ND_TCHECK(stp_bpdu->protocol_id); in stp_print()
415 if (EXTRACT_16BITS(&stp_bpdu->protocol_id)) { in stp_print()
420 ND_TCHECK(stp_bpdu->protocol_version); in stp_print()
422 stp_bpdu->protocol_version))); in stp_print()
424 switch (stp_bpdu->protocol_version) { in stp_print()
434 ND_TCHECK(stp_bpdu->bpdu_type); in stp_print()
436 stp_bpdu->bpdu_type))); in stp_print()
438 switch (stp_bpdu->bpdu_type) { in stp_print()
443 if (!stp_print_config_bpdu(ndo, stp_bpdu, length)) in stp_print()
448 if (stp_bpdu->protocol_version == STP_PROTO_RAPID) { in stp_print()
452 if (!stp_print_config_bpdu(ndo, stp_bpdu, length)) in stp_print()
454 } else if (stp_bpdu->protocol_version == STP_PROTO_MSTP || in stp_print()
455 stp_bpdu->protocol_version == STP_PROTO_SPB) { in stp_print()
460 ND_TCHECK(stp_bpdu->v1_length); in stp_print()
461 if (stp_bpdu->v1_length != 0) { in stp_print()
473 if (!stp_print_mstp_bpdu(ndo, stp_bpdu, length)) in stp_print()
476 if (stp_bpdu->protocol_version == STP_PROTO_SPB) in stp_print()
486 if (!stp_print_spb_bpdu(ndo, stp_bpdu, (sizeof(struct stp_bpdu_) + mstp_len))) in stp_print()