aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-02-27 19:01:27 +0000
committerGuy Harris <guy@alum.mit.edu>2010-02-27 19:01:27 +0000
commit500eb99cd9ae9503344998b811e4856a2bb6bfb2 (patch)
treef1ed4387361e37904198aac2f5e80833d74011b0 /epan/proto.c
parent9dd11bb90eb4bca3f03f0f547da9be901a56f996 (diff)
Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
date as YYYY/DDD, where DDD is a 1-origin day of year. Move the formats to a "time_fmt.h" file, included by the headers that use it. Have abs_time_to_str() and abs_time_secs_to_str() take the date format value, rather than a Boolean "show this as UTC" flag, as an argument. Document the ABSOLUTE_TIME_ formats a bit better. Use that format in the CCSDS and VCDU dissectors, rather than having those dissectors do the formatting themselves. svn path=/trunk/; revision=32034
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 5c904b47eb..5c6a8f370b 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -3336,7 +3336,7 @@ proto_custom_set(proto_tree* tree, int field_id,
case FT_ABSOLUTE_TIME:
g_strlcpy(result,
- abs_time_to_str(fvalue_get(&finfo->value), (hfinfo->display == ABSOLUTE_TIME_UTC)),
+ abs_time_to_str(fvalue_get(&finfo->value), hfinfo->display),
size);
break;
@@ -4229,7 +4229,8 @@ static void tmp_fld_check_assert(header_field_info *hfinfo) {
case FT_ABSOLUTE_TIME:
DISSECTOR_ASSERT(hfinfo->display == ABSOLUTE_TIME_LOCAL ||
- hfinfo->display == ABSOLUTE_TIME_UTC);
+ hfinfo->display == ABSOLUTE_TIME_UTC ||
+ hfinfo->display == ABSOLUTE_TIME_DOY_UTC);
DISSECTOR_ASSERT(hfinfo->bitmask == 0);
DISSECTOR_ASSERT(hfinfo->strings == NULL);
break;
@@ -4471,7 +4472,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), (hfinfo->display == ABSOLUTE_TIME_UTC)));
+ abs_time_to_str(fvalue_get(&fi->value), hfinfo->display));
break;
case FT_RELATIVE_TIME: