diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-28 11:37:06 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-28 18:38:18 +0000 |
commit | 54b733ce9a0d1cd4ab9b142479368a5e696360be (patch) | |
tree | 1c98ec83c70ba99b383105516048d0254168d855 /epan/column.c | |
parent | efea8ce1c6a4331bc2ff7090dd3dadd2a80f6d86 (diff) |
Make the time stamp resolution per-packet.
Pcap-ng files don't have a per-file time stamp resolution, they have a
per-interface time stamp resolution. Add new time stamp resolution
types of "unknown" and "per-packet", add the time stamp resolution to
struct wtap_pkthdr, have the libwiretap core initialize it to the
per-file time stamp resolution, and have pcap-ng do the same thing with
the resolution that it does with the packet encapsulation.
Get rid of the TS_PREC_AUTO_XXX values; just have TS_PREC_AUTO, which
means "use the packet's resolution to determine how many significant
digits to display". Rename all the WTAP_FILE_TSPREC_XXX values to
WTAP_TSPREC_XXX, as they're also used for per-packet values.
Change-Id: If9fd8f799b19836a5104aaa0870a951498886c69
Reviewed-on: https://code.wireshark.org/review/4349
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/column.c')
-rw-r--r-- | epan/column.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/epan/column.c b/epan/column.c index 4d23d9e5bc..8544f84b21 100644 --- a/epan/column.c +++ b/epan/column.c @@ -286,28 +286,23 @@ get_timestamp_column_longest_string(const gint type, const gint precision) case(TS_ABSOLUTE_WITH_YMD): case(TS_UTC_WITH_YMD): switch(precision) { - case(TS_PREC_AUTO_SEC): case(TS_PREC_FIXED_SEC): return "0000-00-00 00:00:00"; break; - case(TS_PREC_AUTO_DSEC): case(TS_PREC_FIXED_DSEC): return "0000-00-00 00:00:00.0"; break; - case(TS_PREC_AUTO_CSEC): case(TS_PREC_FIXED_CSEC): return "0000-00-00 00:00:00.00"; break; - case(TS_PREC_AUTO_MSEC): case(TS_PREC_FIXED_MSEC): return "0000-00-00 00:00:00.000"; break; - case(TS_PREC_AUTO_USEC): case(TS_PREC_FIXED_USEC): return "0000-00-00 00:00:00.000000"; break; - case(TS_PREC_AUTO_NSEC): case(TS_PREC_FIXED_NSEC): + case(TS_PREC_AUTO): /* Leave enough room for the maximum */ return "0000-00-00 00:00:00.000000000"; break; default: @@ -317,28 +312,23 @@ get_timestamp_column_longest_string(const gint type, const gint precision) case(TS_ABSOLUTE_WITH_YDOY): case(TS_UTC_WITH_YDOY): switch(precision) { - case(TS_PREC_AUTO_SEC): case(TS_PREC_FIXED_SEC): return "0000/000 00:00:00"; break; - case(TS_PREC_AUTO_DSEC): case(TS_PREC_FIXED_DSEC): return "0000/000 00:00:00.0"; break; - case(TS_PREC_AUTO_CSEC): case(TS_PREC_FIXED_CSEC): return "0000/000 00:00:00.00"; break; - case(TS_PREC_AUTO_MSEC): case(TS_PREC_FIXED_MSEC): return "0000/000 00:00:00.000"; break; - case(TS_PREC_AUTO_USEC): case(TS_PREC_FIXED_USEC): return "0000/000 00:00:00.000000"; break; - case(TS_PREC_AUTO_NSEC): case(TS_PREC_FIXED_NSEC): + case(TS_PREC_AUTO): /* Leave enough room for the maximum */ return "0000/000 00:00:00.000000000"; break; default: @@ -348,28 +338,23 @@ get_timestamp_column_longest_string(const gint type, const gint precision) case(TS_ABSOLUTE): case(TS_UTC): switch(precision) { - case(TS_PREC_AUTO_SEC): case(TS_PREC_FIXED_SEC): return "00:00:00"; break; - case(TS_PREC_AUTO_DSEC): case(TS_PREC_FIXED_DSEC): return "00:00:00.0"; break; - case(TS_PREC_AUTO_CSEC): case(TS_PREC_FIXED_CSEC): return "00:00:00.00"; break; - case(TS_PREC_AUTO_MSEC): case(TS_PREC_FIXED_MSEC): return "00:00:00.000"; break; - case(TS_PREC_AUTO_USEC): case(TS_PREC_FIXED_USEC): return "00:00:00.000000"; break; - case(TS_PREC_AUTO_NSEC): case(TS_PREC_FIXED_NSEC): + case(TS_PREC_AUTO): /* Leave enough room for the maximum */ return "00:00:00.000000000"; break; default: @@ -380,28 +365,23 @@ get_timestamp_column_longest_string(const gint type, const gint precision) case(TS_DELTA): case(TS_DELTA_DIS): switch(precision) { - case(TS_PREC_AUTO_SEC): case(TS_PREC_FIXED_SEC): return "0000"; break; - case(TS_PREC_AUTO_DSEC): case(TS_PREC_FIXED_DSEC): return "0000.0"; break; - case(TS_PREC_AUTO_CSEC): case(TS_PREC_FIXED_CSEC): return "0000.00"; break; - case(TS_PREC_AUTO_MSEC): case(TS_PREC_FIXED_MSEC): return "0000.000"; break; - case(TS_PREC_AUTO_USEC): case(TS_PREC_FIXED_USEC): return "0000.000000"; break; - case(TS_PREC_AUTO_NSEC): case(TS_PREC_FIXED_NSEC): + case(TS_PREC_AUTO): /* Leave enough room for the maximum */ return "0000.000000000"; break; default: @@ -411,28 +391,23 @@ get_timestamp_column_longest_string(const gint type, const gint precision) case(TS_EPOCH): /* This is enough to represent 2^63 (signed 64-bit integer) + fractions */ switch(precision) { - case(TS_PREC_AUTO_SEC): case(TS_PREC_FIXED_SEC): return "0000000000000000000"; break; - case(TS_PREC_AUTO_DSEC): case(TS_PREC_FIXED_DSEC): return "0000000000000000000.0"; break; - case(TS_PREC_AUTO_CSEC): case(TS_PREC_FIXED_CSEC): return "0000000000000000000.00"; break; - case(TS_PREC_AUTO_MSEC): case(TS_PREC_FIXED_MSEC): return "0000000000000000000.000"; break; - case(TS_PREC_AUTO_USEC): case(TS_PREC_FIXED_USEC): return "0000000000000000000.000000"; break; - case(TS_PREC_AUTO_NSEC): case(TS_PREC_FIXED_NSEC): + case(TS_PREC_AUTO): /* Leave enough room for the maximum */ return "0000000000000000000.000000000"; break; default: |