From 54b733ce9a0d1cd4ab9b142479368a5e696360be Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 28 Sep 2014 11:37:06 -0700 Subject: 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 --- wiretap/netxray.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'wiretap/netxray.c') diff --git a/wiretap/netxray.c b/wiretap/netxray.c index d8704d9fa0..5bb9732bde 100644 --- a/wiretap/netxray.c +++ b/wiretap/netxray.c @@ -576,12 +576,12 @@ netxray_open(wtap *wth, int *err, gchar **err_info) case WTAP_FILE_TYPE_SUBTYPE_NETXRAY_OLD: ticks_per_sec = 1000.0; - wth->tsprecision = WTAP_FILE_TSPREC_MSEC; + wth->file_tsprec = WTAP_TSPREC_MSEC; break; case WTAP_FILE_TYPE_SUBTYPE_NETXRAY_1_0: ticks_per_sec = 1000.0; - wth->tsprecision = WTAP_FILE_TSPREC_MSEC; + wth->file_tsprec = WTAP_TSPREC_MSEC; break; case WTAP_FILE_TYPE_SUBTYPE_NETXRAY_1_1: @@ -592,7 +592,7 @@ netxray_open(wtap *wth, int *err, gchar **err_info) * and older versions of Windows Sniffer. */ ticks_per_sec = 1000000.0; - wth->tsprecision = WTAP_FILE_TSPREC_USEC; + wth->file_tsprec = WTAP_TSPREC_USEC; break; case WTAP_FILE_TYPE_SUBTYPE_NETXRAY_2_00x: @@ -749,9 +749,9 @@ netxray_open(wtap *wth, int *err, gchar **err_info) * XXX - Seems reasonable to use nanosecs only if TPS >= 10M */ if (ticks_per_sec >= 1e7) - wth->tsprecision = WTAP_FILE_TSPREC_NSEC; + wth->file_tsprec = WTAP_TSPREC_NSEC; else - wth->tsprecision = WTAP_FILE_TSPREC_USEC; + wth->file_tsprec = WTAP_TSPREC_USEC; break; default: -- cgit v1.2.1