/* \summary: IEEE 802.1d Spanning Tree Protocol (STP) printer */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include "netdissect-stdinc.h"
{
static char bridge_id_str[sizeof("pppp.aa:bb:cc:dd:ee:ff")];
- snprintf(bridge_id_str, sizeof(bridge_id_str),
+ nd_snprintf(bridge_id_str, sizeof(bridge_id_str),
"%.2x%.2x.%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
EXTRACT_U_1(p), EXTRACT_U_1(p + 1), EXTRACT_U_1(p + 2),
EXTRACT_U_1(p + 3), EXTRACT_U_1(p + 4), EXTRACT_U_1(p + 5),
stp_print_bridge_id((const u_char *)&stp_bpdu->root_id),
EXTRACT_BE_U_4(stp_bpdu->root_path_cost));
- ND_TCHECK(stp_bpdu->bridge_id);
+ ND_TCHECK_SIZE(&stp_bpdu->bridge_id);
ND_PRINT("\n\tCIST regional-root-id %s, ",
stp_print_bridge_id((const u_char *)&stp_bpdu->bridge_id));
ND_PRINT("\n\tv3len %u, ", EXTRACT_BE_U_2(ptr + MST_BPDU_VER3_LEN_OFFSET));
ND_TCHECK_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12);
ND_PRINT("MCID Name ");
- if (fn_printzp(ndo, ptr + MST_BPDU_CONFIG_NAME_OFFSET, 32, ndo->ndo_snapend))
+ if (nd_printzp(ndo, ptr + MST_BPDU_CONFIG_NAME_OFFSET, 32, ndo->ndo_snapend))
goto trunc;
ND_PRINT(", rev %u,"
"\n\t\tdigest %08x%08x%08x%08x, ",
ND_PRINT("\n\tv4len %u, ", EXTRACT_BE_U_2(ptr + offset));
ND_PRINT("AUXMCID Name ");
- if (fn_printzp(ndo, ptr + offset + SPB_BPDU_CONFIG_NAME_OFFSET, 32,
+ if (nd_printzp(ndo, ptr + offset + SPB_BPDU_CONFIG_NAME_OFFSET, 32,
ndo->ndo_snapend))
goto trunc;
ND_PRINT(", Rev %u,\n\t\tdigest %08x%08x%08x%08x",
u_int mstp_len;
u_int spb_len;
+ ndo->ndo_protocol = "stp";
stp_bpdu = (const struct stp_bpdu_*)p;
/* Minimum STP Frame size. */
return;
trunc:
- ND_PRINT("[|stp %u]", length);
+ nd_print_trunc(ndo);
}
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 4
- * End:
- */