aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2010-05-10 06:32:31 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2010-05-10 06:32:31 +0000
commitc1b3cace530c22c5f347ee9062bdebe78827166d (patch)
tree186e39b0c06aaf713a38f777bcf7ac6fdc235e5e /epan/proto.c
parentd6482e47fc105afb3ecbd36918af62148a190526 (diff)
Allow for proto_tree_add_item() with FT_ABSOLUTE_TIME and FT_RELATIVE_TIME.
svn path=/trunk/; revision=32731
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,