aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-07-01 21:08:41 -0700
committerGuy Harris <guy@alum.mit.edu>2018-07-02 04:09:21 +0000
commit1075054a1053bf6b4cac2f3ef10168618fc9594e (patch)
treedf12650487da24e9bc4567ad12e7990a23218e8f /epan/proto.h
parenta7961382833ba83c614aa435060ebc50280f359d (diff)
Add new encoding names for seconds/{micro,nano}second time stamps.
Add ENC_TIME_SECS_NSECS and ENC_TIME_SECS_USECS; they make it more explicit (especially to those not familiar with UN*X data types) what the representation is, allow for ENC_TIME_SECS_MSECS etc. if they're needed, and match names such as ENC_TIME_SECS and ENC_TIME_MSECS. Change-Id: I6ab36fb4da70563587141cd65ffff8523477b0c4 Reviewed-on: https://code.wireshark.org/review/28564 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/proto.h')
-rw-r--r--epan/proto.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/epan/proto.h b/epan/proto.h
index b6b60af195..e1c612de2f 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -348,10 +348,10 @@ void proto_report_dissector_bug(const char *format, ...)
*
* We now support:
*
- * ENC_TIME_TIMESPEC - 8, 12, or 16 bytes. For 8 bytes, the first 4 bytes
- * are seconds and the next 4 bytes are nanoseconds; for 12 bytes, the
- * first 8 bytes are seconds and the next 4 bytes are nanoseconds; for
- * 16 bytes, the first 8 bytes are seconds and the next 8 bytes are
+ * ENC_TIME_SECS_NSECS - 8, 12, or 16 bytes. For 8 bytes, the first 4
+ * bytes are seconds and the next 4 bytes are nanoseconds; for 12 bytes,
+ * the first 8 bytes are seconds and the next 4 bytes are nanoseconds;
+ * for 16 bytes, the first 8 bytes are seconds and the next 8 bytes are
* nanoseconds. If the time is absolute, the seconds are seconds since
* the UN*X epoch (1970-01-01 00:00:00 UTC). (I.e., a UN*X struct
* timespec with a 4-byte or 8-byte time_t or a structure with an
@@ -372,7 +372,7 @@ void proto_report_dissector_bug(const char *format, ...)
* NTP time.) It's used by the Object Management Group's Real-Time
* Publish-Subscribe Wire Protocol for the Data Distribution Service.
*
- * ENC_TIME_TIMEVAL - 8 bytes; the first 4 bytes are seconds and the
+ * ENC_TIME_SECS_USECS - 8 bytes; the first 4 bytes are seconds and the
* next 4 bytes are microseconds. If the time is absolute, the seconds
* are seconds since the UN*X epoch. (I.e., a UN*X struct timeval with
* a 4-byte time_t.)
@@ -392,13 +392,19 @@ void proto_report_dissector_bug(const char *format, ...)
*
* ENC_TIME_MSEC_NTP - 4-8 bytes, representing a count of milliseconds since
* the NTP epoch. (I.e., milliseconds since the NTP epoch.)
+ *
+ * The backwards-compatibility names are defined as hex numbers so that
+ * the script to generate init.lua will add them as global variables,
+ * along with the new names.
*/
-#define ENC_TIME_TIMESPEC 0x00000000
+#define ENC_TIME_SECS_NSECS 0x00000000
+#define ENC_TIME_TIMESPEC 0x00000000 /* for backwards source compatibility */
#define ENC_TIME_NTP 0x00000002
#define ENC_TIME_TOD 0x00000004
#define ENC_TIME_RTPS 0x00000008
-#define ENC_TIME_NTP_BASE_ZERO ENC_TIME_RTPS /* for backwards source compatibility */
-#define ENC_TIME_TIMEVAL 0x00000010
+#define ENC_TIME_NTP_BASE_ZERO 0x00000008 /* for backwards source compatibility */
+#define ENC_TIME_SECS_USECS 0x00000010
+#define ENC_TIME_TIMEVAL 0x00000010 /* for backwards source compatibility */
#define ENC_TIME_SECS 0x00000012
#define ENC_TIME_MSECS 0x00000014
#define ENC_TIME_SECS_NTP 0x00000018