From 8e236e55defb5555eb3dde620d49e3a67f74ad4b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 19 Dec 2009 03:17:44 +0000 Subject: 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 --- rawshark.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'rawshark.c') diff --git a/rawshark.c b/rawshark.c index cefd204bad..9b99b3a92b 100644 --- a/rawshark.c +++ b/rawshark.c @@ -1189,7 +1189,19 @@ char* ftenum_to_string(header_field_info *hfi) }; } -char* base_display_e_to_string(base_display_e bd) +static char* absolute_time_display_e_to_string(absolute_time_display_e atd) +{ + switch(atd) { + case ABSOLUTE_TIME_LOCAL: + return "ABSOLUTE_TIME_LOCAL"; + case ABSOLUTE_TIME_UTC: + return "ABSOLUTE_TIME_UTC"; + default: + return "n.a."; + } +} + +static char* base_display_e_to_string(base_display_e bd) { switch(bd) { case BASE_NONE: @@ -1373,10 +1385,23 @@ protocolinfo_init(char *field) exit(1); } - printf("%u %s %s - ", - g_cmd_line_index, - ftenum_to_string(hfi), - base_display_e_to_string(hfi->display)); + switch (hfi->type) { + + case FT_ABSOLUTE_TIME: + printf("%u %s %s - ", + g_cmd_line_index, + ftenum_to_string(hfi), + absolute_time_display_e_to_string(hfi->display)); + break; + break; + + default: + printf("%u %s %s - ", + g_cmd_line_index, + ftenum_to_string(hfi), + base_display_e_to_string(hfi->display)); + break; + } rs=g_malloc(sizeof(pci_t)); rs->hf_index=hfi->id; -- cgit v1.2.1