aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-12-19 03:17:44 +0000
committerGuy Harris <guy@alum.mit.edu>2009-12-19 03:17:44 +0000
commit8e236e55defb5555eb3dde620d49e3a67f74ad4b (patch)
tree5d4eb5c243515cc0bf128f763d68a574ac3b2f76 /epan/proto.c
parent220054bd43730e0a85ab04d9e3f495cefe08703f (diff)
For fields of type FT_ABSOLUTE_TIME, have the "display" value be one of
ABSOLUTE_TIME_LOCAL or ABSOLUTE_TIME_UTC, indicating whether to display the date/time in local time or UTC. (int)ABSOLUTE_TIME_LOCAL == (int)BASE_NONE, so there's no source or binary compatiblity issue, although we might want to eliminate BASE_NONE at some point and have the BASE_ values used with integral types start at 0, so that you can't specify BASE_NONE for an integral field. svn path=/trunk/; revision=31319
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 6256435af8..53c3ce4d46 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -3334,7 +3334,9 @@ proto_custom_set(proto_tree* tree, int field_id,
break;
case FT_ABSOLUTE_TIME:
- g_strlcpy(result, abs_time_to_str(fvalue_get(&finfo->value), FALSE), size);
+ g_strlcpy(result,
+ abs_time_to_str(fvalue_get(&finfo->value), (hfinfo->display == ABSOLUTE_TIME_UTC)),
+ size);
break;
case FT_RELATIVE_TIME:
@@ -4224,6 +4226,13 @@ static void tmp_fld_check_assert(header_field_info *hfinfo) {
case FT_BOOLEAN:
break;
+ case FT_ABSOLUTE_TIME:
+ DISSECTOR_ASSERT(hfinfo->display == ABSOLUTE_TIME_LOCAL ||
+ hfinfo->display == ABSOLUTE_TIME_UTC);
+ DISSECTOR_ASSERT(hfinfo->bitmask == 0);
+ DISSECTOR_ASSERT(hfinfo->strings == NULL);
+ break;
+
default:
DISSECTOR_ASSERT(hfinfo->display == BASE_NONE);
DISSECTOR_ASSERT(hfinfo->bitmask == 0);
@@ -4461,7 +4470,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str)
case FT_ABSOLUTE_TIME:
g_snprintf(label_str, ITEM_LABEL_LENGTH,
"%s: %s", hfinfo->name,
- abs_time_to_str(fvalue_get(&fi->value), FALSE));
+ abs_time_to_str(fvalue_get(&fi->value), (hfinfo->display == ABSOLUTE_TIME_UTC)));
break;
case FT_RELATIVE_TIME:
@@ -6534,4 +6543,3 @@ proto_check_field_name(const gchar *field_name)
{
return wrs_check_charset(fld_abbrev_chars, field_name);
}
-