]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ntp.c
PIM: refresh and use tok2str()
[tcpdump] / print-ntp.c
index 367d9fe5148957ecb3bd86ca4826e3c3e83ee846..93268ac017b50b024d98cb93a156df099cbdc81f 100644 (file)
@@ -215,21 +215,21 @@ ntp_print(netdissect_options *ndo,
        ND_PRINT((ndo, "NTPv%d", version));
 
        mode = bp->status & MODEMASK;
-        if (!ndo->ndo_vflag) {
-            printf (", %s, length %u",
-                    tok2str(ntp_mode_values, "Unknown mode", mode),
-                    length);
-            return;
-        }
+       if (!ndo->ndo_vflag) {
+               ND_PRINT((ndo, ", %s, length %u",
+                         tok2str(ntp_mode_values, "Unknown mode", mode),
+                         length));
+               return;
+       }
 
-        printf (", length %u\n\t%s",
-                length,
-                tok2str(ntp_mode_values, "Unknown mode", mode));
+       ND_PRINT((ndo, ", length %u\n\t%s",
+                 length,
+                 tok2str(ntp_mode_values, "Unknown mode", mode)));
 
        leapind = bp->status & LEAPMASK;
-        printf (", Leap indicator: %s (%u)",
-                tok2str(ntp_leapind_values, "Unknown", leapind),
-                leapind);
+       ND_PRINT((ndo, ", Leap indicator: %s (%u)",
+                 tok2str(ntp_leapind_values, "Unknown", leapind),
+                 leapind));
 
        ND_TCHECK(bp->stratum);
        ND_PRINT((ndo, ", Stratum %u (%s)",
@@ -266,17 +266,17 @@ ntp_print(netdissect_options *ndo,
                break;
 
        case INFO_QUERY:
-               ND_PRINT((ndo, "%s INFO_QUERY", ipaddr_string(&(bp->refid))));
+               ND_PRINT((ndo, "%s INFO_QUERY", ipaddr_string(ndo, &(bp->refid))));
                /* this doesn't have more content */
                return;
 
        case INFO_REPLY:
-               ND_PRINT((ndo, "%s INFO_REPLY", ipaddr_string(&(bp->refid))));
+               ND_PRINT((ndo, "%s INFO_REPLY", ipaddr_string(ndo, &(bp->refid))));
                /* this is too complex to be worth printing */
                return;
 
        default:
-               ND_PRINT((ndo, "%s", ipaddr_string(&(bp->refid))));
+               ND_PRINT((ndo, "%s", ipaddr_string(ndo, &(bp->refid))));
                break;
        }
 
@@ -367,7 +367,7 @@ p_ntp_time(netdissect_options *ndo,
 
            tm = localtime(&seconds);
            strftime(time_buf, sizeof (time_buf), "%Y/%m/%d %H:%M:%S", tm);
-           printf (" (%s)", time_buf);
+           ND_PRINT((ndo, " (%s)", time_buf));
        }
 #endif
 }