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)",
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
}
ptr.hna = (struct olsr_hna4 *)msg_data;
/* print 4 prefixes per line */
- if (col == 0)
- printf ("\n\t ");
- else
- printf (", ");
-
- ND_PRINT((ndo, "%s/%u",
+ ND_PRINT((ndo, "%s%s/%u",
+ col == 0 ? "\n\t " : ", ",
ipaddr_string(ptr.hna->network),
mask2plen(EXTRACT_32BITS(ptr.hna->mask))));