X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/9d449a4c46ea010e037a927f4af1f12870ebae20..86bed03b4740e542339f45dba70a556bb8433758:/print-ntp.c diff --git a/print-ntp.c b/print-ntp.c index 86e29e69..d41f5152 100644 --- a/print-ntp.c +++ b/print-ntp.c @@ -38,10 +38,6 @@ #include "netdissect-stdinc.h" -#ifdef HAVE_STRFTIME -#include -#endif - #define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" #include "addrtoname.h" @@ -181,7 +177,7 @@ static const struct tok ntp_leapind_values[] = { static const struct tok ntp_stratum_values[] = { { UNSPECIFIED, "unspecified" }, - { PRIM_REF, "primary reference" }, + { PRIM_REF, "primary reference" }, { 0, NULL } }; @@ -302,16 +298,16 @@ ntp_time_print(netdissect_options *ndo, p_ntp_delta(ndo, &(bp->org_timestamp), &(bp->xmt_timestamp)); /* FIXME: this code is not aware of any extension fields */ - if (length == NTP_TIMEMSG_MINLEN + 4) { /* Optional: key-id (crypto-NAK) */ + if (length == NTP_TIMEMSG_MINLEN + 4) { /* Optional: key-id (crypto-NAK) */ ND_PRINT("\n\tKey id: %u", GET_BE_U_4(bp->key_id)); - } else if (length == NTP_TIMEMSG_MINLEN + 4 + 16) { /* Optional: key-id + 128-bit digest */ + } else if (length == NTP_TIMEMSG_MINLEN + 4 + 16) { /* Optional: key-id + 128-bit digest */ ND_PRINT("\n\tKey id: %u", GET_BE_U_4(bp->key_id)); ND_PRINT("\n\tAuthentication: %08x%08x%08x%08x", GET_BE_U_4(bp->message_digest), GET_BE_U_4(bp->message_digest + 4), GET_BE_U_4(bp->message_digest + 8), GET_BE_U_4(bp->message_digest + 12)); - } else if (length == NTP_TIMEMSG_MINLEN + 4 + 20) { /* Optional: key-id + 160-bit digest */ + } else if (length == NTP_TIMEMSG_MINLEN + 4 + 20) { /* Optional: key-id + 160-bit digest */ ND_PRINT("\n\tKey id: %u", GET_BE_U_4(bp->key_id)); ND_PRINT("\n\tAuthentication: %08x%08x%08x%08x%08x", GET_BE_U_4(bp->message_digest),