Allow for proto_tree_add_item() with FT_ABSOLUTE_TIME and FT_RELATIVE_TIME.

svn path=/trunk/; revision=32731
This commit is contained in:
Jaap Keuter 2010-05-10 06:32:31 +00:00
parent d6482e47fc
commit c1b3cace53
1 changed files with 14 additions and 0 deletions

View File

@ -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,