aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-10 06:32:31 +0000
committerjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-10 06:32:31 +0000
commit61fc5065b7bc015b69976da2c0e2b07b56ce12b2 (patch)
tree186e39b0c06aaf713a38f777bcf7ac6fdc235e5e /epan/proto.c
parentd32dc4aa85e28c55de7dea0b7a5a415f216a5bf1 (diff)
Allow for proto_tree_add_item() with FT_ABSOLUTE_TIME and FT_RELATIVE_TIME.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32731 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 0a5b6cc47b..b6a418bc7c 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -1204,6 +1204,7 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree,
float floatval;
double doubleval;
char *string;
+ nstime_t time_stamp;
GPtrArray *ptrs;
/* there is a possibility here that we might raise an exception
@@ -1412,6 +1413,19 @@ proto_tree_new_item(field_info *new_fi, proto_tree *tree,
new_fi->length = n + length;
break;
+ case FT_ABSOLUTE_TIME:
+ case FT_RELATIVE_TIME:
+ DISSECTOR_ASSERT(length == 8);
+ if (little_endian) {
+ time_stamp.secs = tvb_get_letohl(tvb, start);
+ time_stamp.nsecs = tvb_get_letohl(tvb, start+4);
+ } else {
+ time_stamp.secs = tvb_get_ntohl(tvb, start);
+ time_stamp.nsecs = tvb_get_ntohl(tvb, start+4);
+ }
+ proto_tree_set_time(new_fi, &time_stamp);
+ break;
+
default:
g_error("new_fi->hfinfo->type %d (%s) not handled\n",
new_fi->hfinfo->type,