diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-03-25 21:58:47 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-03-26 04:59:35 +0000 |
commit | bb2ab6ac9664869eaadec1d472acb478be285168 (patch) | |
tree | 89bdcdfed887ecd579761631a9d8cfaa8db13e5d /epan/proto.c | |
parent | a6730565f8569b0b8dafc8aebad120c5b66cf3cb (diff) |
Don't speak of RTPS time_t as an "NTP" time.
It's some weird hybrid of UN*X time and NTP time stamps, using UN*X's
epoch and NTP's seconds/fractions split. I'm sure they had their
reasons for not using something like struct timespec or regular NTP
time, and instead inventing something that's halfway in between them.
Change-Id: I1f39ec1368af52b82adfa2a22677dfa6e9341309
Reviewed-on: https://code.wireshark.org/review/20711
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/epan/proto.c b/epan/proto.c index c19ab27bd8..f5a779dcbf 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -1803,16 +1803,14 @@ get_time_value(tvbuff_t *tvb, const gint start, const gint length, const guint e time_stamp->nsecs = (int)((todsecs % 1000000) * 1000); break; - case ENC_TIME_NTP_BASE_ZERO|ENC_BIG_ENDIAN: + case ENC_TIME_RTPS|ENC_BIG_ENDIAN: /* - * DDS NTP time stamp, big-endian. + * Time stamp using the same seconds/fraction format + * as NTP, but with the origin of the time stamp being + * the UNIX epoch rather than the NTP epoch; big- + * endian. */ - -#define NTP_BASETIME_ZERO G_GUINT64_CONSTANT(0) - - tmpsecs = tvb_get_ntohl(tvb, start); - time_stamp->secs = (time_t)(tmpsecs - (guint32)NTP_BASETIME_ZERO); - + time_stamp->secs = (time_t)tvb_get_ntohl(tvb, start); if (length == 8) { /* * We're using nanoseconds here (and we will @@ -1827,9 +1825,12 @@ get_time_value(tvbuff_t *tvb, const gint start, const gint length, const guint e } break; - case ENC_TIME_NTP_BASE_ZERO|ENC_LITTLE_ENDIAN: + case ENC_TIME_RTPS|ENC_LITTLE_ENDIAN: /* - * NTP time stamp, big-endian. + * Time stamp using the same seconds/fraction format + * as NTP, but with the origin of the time stamp being + * the UNIX epoch rather than the NTP epoch; little- + * endian. */ time_stamp->secs = (time_t)tvb_get_letohl(tvb, start); if (length == 8) { |