Allow for proto_tree_add_item() with FT_ABSOLUTE_TIME and FT_RELATIVE_TIME.
svn path=/trunk/; revision=32731
This commit is contained in:
parent
d6482e47fc
commit
c1b3cace53
14
epan/proto.c
14
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,
|
||||
|
|
Loading…
Reference in New Issue