From RobiOneKenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9072
authoreapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 12 Sep 2013 16:56:37 +0000 (16:56 +0000)
committereapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 12 Sep 2013 16:56:37 +0000 (16:56 +0000)
Add support for Time-of-Day timestamp format from z/OS.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@51974 f5534014-38df-0310-8fa8-9805f1628bb7

AUTHORS
epan/proto.c
epan/proto.h

diff --git a/AUTHORS b/AUTHORS
index f4dc4139f1c3672fd68e6c9af081b8a0f58c2415..308c7580aa6a1d9c0f48462802c61846dac94df7 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -3767,6 +3767,7 @@ Karl Beldan               <karl.beldan[AT]gmail.com>
 Jiri Engelthaler       <engycz[AT]gmail.com>
 Stephen Ludin          <sludin[AT]ludin.org>
 Andreas Urke           <andurke[AT]gmail.com>
+RobiOneKenobi          <robionekenobi[AT]bluewin.ch>
 
 Dan Lasley <dlasley[AT]promus.com> gave permission for his
 dumpit() hex-dump routine to be used.
index d13a1789a2e7fb066440546ad8314bbfb030d9cc..867647cd2b2c570ad6901ffb93a72b538fb7cdc7 100644 (file)
@@ -1197,6 +1197,7 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree,
        const char *string;
        nstime_t    time_stamp;
        guint32     tmpsecs;
+       guint64     todsecs;
        gboolean    length_error;
 
        /* there is a possibility here that we might raise an exception
@@ -1592,6 +1593,27 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree,
                                        time_stamp.nsecs = 0;
                                break;
 
+                       case ENC_TIME_TOD|ENC_BIG_ENDIAN:
+                               /*
+                                * TOD time stamp, big-endian.
+                                */
+/* XXX - where should this go? */
+#define TOD_BASETIME 2208988800ul
+
+                               todsecs  = tvb_get_ntoh64(tvb, start) >> 12;
+                               time_stamp.secs = (todsecs  / 1000000) - TOD_BASETIME;
+                               time_stamp.nsecs = (todsecs  % 1000000) * 1000;
+                               break;
+
+                       case ENC_TIME_TOD|ENC_LITTLE_ENDIAN:
+                               /*
+                                * TOD time stamp, big-endian.
+                                */
+                               todsecs  = tvb_get_letoh64(tvb, start) >> 12 ;
+                               time_stamp.secs = (todsecs  / 1000000) - TOD_BASETIME;
+                               time_stamp.nsecs = (todsecs  % 1000000) * 1000;
+                               break;
+
                        case ENC_TIME_NTP|ENC_BIG_ENDIAN:
                                /*
                                 * NTP time stamp, big-endian.
index b7517faf932cce6ec0416aecf5c52b2af03e5748..9fe10adc414f005190f0ffe44228c38509cffb27 100644 (file)
@@ -250,6 +250,7 @@ typedef struct _protocol protocol_t;
  */
 #define ENC_TIME_TIMESPEC      0x00000000
 #define ENC_TIME_NTP           0x00000002
+#define ENC_TIME_TOD           0x00000004
 
 /*
  * Historically, the only place the representation mattered for strings