]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-stp.c
Fix spaces
[tcpdump] / print-stp.c
index 95138d3b58ad27a7bdef960579214f796e6c57aa..0327ba49cf9f5b7120d5403dc35953b135f3afd4 100644 (file)
@@ -91,7 +91,7 @@ stp_print_bridge_id(const u_char *p)
 {
     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),
@@ -273,7 +273,7 @@ stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
            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));
 
@@ -292,7 +292,7 @@ stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
     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, ",
@@ -366,7 +366,7 @@ stp_print_spb_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu,
 
     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",
@@ -412,6 +412,7 @@ stp_print(netdissect_options *ndo, const u_char *p, u_int length)
     u_int                  mstp_len;
     u_int                  spb_len;
 
+    ndo->ndo_protocol = "stp";
     stp_bpdu = (const struct stp_bpdu_*)p;
 
     /* Minimum STP Frame size. */
@@ -508,12 +509,5 @@ stp_print(netdissect_options *ndo, const u_char *p, u_int length)
 
     return;
 trunc:
-    ND_PRINT("[|stp %u]", length);
+    nd_print_trunc(ndo);
 }
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 4
- * End:
- */