diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-03-25 21:37:29 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-03-26 04:38:11 +0000 |
commit | a6730565f8569b0b8dafc8aebad120c5b66cf3cb (patch) | |
tree | 2b0193184ad5f07549856cc1fc8aa1a893304185 /epan/proto.h | |
parent | 6c374a2a5c6c5125ab3ebacb922ca3978d9c0a9d (diff) |
Add ENC_TIME_TIMEVAL and use it for gsmtap.
From a look at the libosmocom code, time stamps in
GSMTAP_TYPE_OSMOCORE_LOG messages appear to be UN*X struct timevals with
a 4-byte tv_sec, not anything NTP-like with the fraction-of-a-second
part in units of 1/2^32s of a second.
Add ENC_TIME_TIMEVAL to handle time stamps like that, and use it rather
than ENC_TIME_NTP_BASE_ZERO.
Change-Id: Ia1511527ee292fb7725b2a64c0af16d23ff10a6d
Reviewed-on: https://code.wireshark.org/review/20710
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/proto.h')
-rw-r--r-- | epan/proto.h | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/epan/proto.h b/epan/proto.h index 6c41fc8663..155f99f51e 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -362,18 +362,46 @@ WS_DLL_PUBLIC WS_NORETURN void proto_report_dissector_bug(const char *message); #define ENC_HOST_ENDIAN ENC_BIG_ENDIAN #endif - /* * Historically FT_TIMEs were only timespecs; the only question was whether * they were stored in big- or little-endian format. * * For backwards compatibility, we interpret an encoding of 1 as meaning * "little-endian timespec", so that passing TRUE is interpreted as that. + * + * We now support: + * + * ENC_TIME_TIMESPEC - 4 or 8 bytes; the first 4 bytes are seconds since + * the UN*X epoch (1970-01-01 00:00:00 UTC), and, if there are 8 bytes, + * the next 4 bytes are nanoseconds since that second. (I.e., a UN*X + * struct timespec with a 4-byte time_t.) + * + * ENC_TIME_NTP - 4 or 8 bytes; the first 4 bytes are seconds since + * the NTP epoch (1901-01-01 00:00:00 GMT), and, if there are 8 bytes, + * the next 4 bytes are 1/2^32's of a second since that second. (I.e., + * a 64-bit count of 1/2^32's of a second since the NTP epoch, with + * the upper 32 bits first and the lower 32 bits second, even when + * little-endian.) + * + * ENC_TIME_TOD - 8 bytes, as a count of microseconds since the System/3x0 + * and z/Architecture epoch (1900-01-01 00:00:00 GMT). + * + * ENC_TIME_NTP_BASE_ZERO - 4 or 8 bytes; the first 4 bytes are seconds + * since the UN*X epoch, and, if there are 8 bytes, the next 4 bytes are + * are 1/2^32's of a second since that second. (I.e., it's the offspring + * of a mating between UN*X time and NTP time.) + * + * ENC_TIME_TIMEVAL - 8 bytes; the first 4 bytes are seconds since + * the UN*X epoch (1970-01-01 00:00:00 UTC), and, if there are 8 bytes, + * the next 4 bytes are microseconds since that second. (I.e., a UN*X + * struct timeval with a 4-byte time_t.) */ -#define ENC_TIME_TIMESPEC 0x00000000 /* "struct timespec" */ -#define ENC_TIME_NTP 0x00000002 /* NTP times */ -#define ENC_TIME_TOD 0x00000004 /* System/3xx and z/Architecture time-of-day clock */ -#define ENC_TIME_NTP_BASE_ZERO 0x00000008 /* NTP times with different BASETIME */ +#define ENC_TIME_TIMESPEC 0x00000000 +#define ENC_TIME_NTP 0x00000002 +#define ENC_TIME_TOD 0x00000004 +#define ENC_TIME_NTP_BASE_ZERO 0x00000008 +#define ENC_TIME_TIMEVAL 0x00000010 + /* * Historically, the only place the representation mattered for strings * was with FT_UINT_STRINGs, where we had FALSE for the string length |