diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-03-01 06:04:31 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-03-01 06:04:31 +0000 |
commit | cf5035cc8922a301bf1d4bb1e83ecad5bee91d7a (patch) | |
tree | c2d844a0084793d4d8ec9dcb3a0014715bc53da4 /epan/dissectors/packet-ntp.c | |
parent | a612eceeb4d786ea82f3b9357067b91749876b46 (diff) |
Show NTP times in a fashion more similar to that used for other times.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13561 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ntp.c')
-rw-r--r-- | epan/dissectors/packet-ntp.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c index c8bfdd9def..2c05012dd8 100644 --- a/epan/dissectors/packet-ntp.c +++ b/epan/dissectors/packet-ntp.c @@ -354,6 +354,21 @@ static void dissect_ntp_ctrl(tvbuff_t *, proto_tree *, guint8); static void dissect_ntp_priv(tvbuff_t *, proto_tree *, guint8); static int dissect_ntp_ext(tvbuff_t *, proto_tree *, int); +static const char *mon_names[12] = { + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" +}; + /* ntp_fmt_ts - converts NTP timestamp to human readable string. * reftime - 64bit timestamp (IN) * buff - string buffer for result (OUT) @@ -378,9 +393,13 @@ ntp_fmt_ts(const guint8 *reftime, char* buff) if (bd != NULL) { fractime = bd->tm_sec + tempfrac / 4294967296.0; snprintf(buff, NTP_TS_SIZE, - "%04d-%02d-%02d %02d:%02d:%07.4f UTC", - bd->tm_year + 1900, bd->tm_mon + 1, bd->tm_mday, - bd->tm_hour, bd->tm_min, fractime); + "%s %2d, %d %02d:%02d:%07.4f UTC", + mon_names[bd->tm_mon], + bd->tm_mday, + bd->tm_year + 1900, + bd->tm_hour, + bd->tm_min, + fractime); } else strncpy(buff, "Not representable", NTP_TS_SIZE); } |