aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-08-25 21:29:54 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-08-25 21:29:54 +0000
commit723c80ea90a3c56c069a0a99e22edd43b00cf357 (patch)
treea0bd0c2272cf5b8f96e1364c0e2f7be960df4f69 /wiretap
parentbd42437262d885f24cbf0fc96e4b2235aac695a3 (diff)
timestamp display precision:
- automatic adjustment depending on file format - manual adjustment through menu items save the setting in the recent file svn path=/trunk/; revision=15534
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/5views.c1
-rw-r--r--wiretap/airopeek9.c1
-rw-r--r--wiretap/ascend.c1
-rw-r--r--wiretap/cosine.c1
-rw-r--r--wiretap/csids.c1
-rw-r--r--wiretap/dbs-etherwatch.c1
-rw-r--r--wiretap/erf.c1
-rw-r--r--wiretap/etherpeek.c1
-rw-r--r--wiretap/eyesdn.c1
-rw-r--r--wiretap/hcidump.c1
-rw-r--r--wiretap/i4btrace.c1
-rw-r--r--wiretap/iptrace.c2
-rw-r--r--wiretap/k12.c1
-rw-r--r--wiretap/lanalyzer.c1
-rw-r--r--wiretap/libpcap.c7
-rw-r--r--wiretap/netmon.c1
-rw-r--r--wiretap/nettl.c1
-rw-r--r--wiretap/network_instruments.c1
-rw-r--r--wiretap/netxray.c8
-rw-r--r--wiretap/ngsniffer.c2
-rw-r--r--wiretap/pppdump.c1
-rw-r--r--wiretap/radcom.c1
-rw-r--r--wiretap/snoop.c1
-rw-r--r--wiretap/toshiba.c1
-rw-r--r--wiretap/visual.c1
-rw-r--r--wiretap/vms.c1
-rw-r--r--wiretap/wtap-int.h2
-rw-r--r--wiretap/wtap.h6
28 files changed, 44 insertions, 5 deletions
diff --git a/wiretap/5views.c b/wiretap/5views.c
index 38fc251ef9..e44969fe4f 100644
--- a/wiretap/5views.c
+++ b/wiretap/5views.c
@@ -197,6 +197,7 @@ int _5views_open(wtap *wth, int *err, gchar **err_info)
wth->subtype_seek_read = _5views_seek_read;
wth->file_encap = encap;
wth->snapshot_length = 0; /* not available in header */
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC;
return 1;
}
diff --git a/wiretap/airopeek9.c b/wiretap/airopeek9.c
index 2eee7f5f76..30aa098008 100644
--- a/wiretap/airopeek9.c
+++ b/wiretap/airopeek9.c
@@ -301,6 +301,7 @@ int airopeek9_open(wtap *wth, int *err, gchar **err_info)
wth->subtype_read = airopeekv9_read;
wth->subtype_seek_read = airopeekv9_seek_read;
wth->subtype_close = airopeekv9_close;
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC;
wth->capture.airopeek9 = g_malloc(sizeof(airopeek9_t));
switch (mediaSubType) {
diff --git a/wiretap/ascend.c b/wiretap/ascend.c
index 0145aec796..2ff4794a01 100644
--- a/wiretap/ascend.c
+++ b/wiretap/ascend.c
@@ -225,6 +225,7 @@ int ascend_open(wtap *wth, int *err, gchar **err_info _U_)
}
wth->capture.ascend->inittime = statbuf.st_ctime;
wth->capture.ascend->adjusted = 0;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
init_parse_ascend();
diff --git a/wiretap/cosine.c b/wiretap/cosine.c
index e185ea9f7f..841d80bac9 100644
--- a/wiretap/cosine.c
+++ b/wiretap/cosine.c
@@ -299,6 +299,7 @@ int cosine_open(wtap *wth, int *err, gchar **err_info _U_)
wth->snapshot_length = 0; /* not known */
wth->subtype_read = cosine_read;
wth->subtype_seek_read = cosine_seek_read;
+ wth->tsprecision = WTAP_FILE_TSPREC_CSEC;
return 1;
}
diff --git a/wiretap/csids.c b/wiretap/csids.c
index ff7c55c687..28ea047c71 100644
--- a/wiretap/csids.c
+++ b/wiretap/csids.c
@@ -138,6 +138,7 @@ int csids_open(wtap *wth, int *err, gchar **err_info _U_)
wth->subtype_read = csids_read;
wth->subtype_seek_read = csids_seek_read;
wth->subtype_close = csids_close;
+ wth->tsprecision = WTAP_FILE_TSPREC_SEC;
return 1;
}
diff --git a/wiretap/dbs-etherwatch.c b/wiretap/dbs-etherwatch.c
index 7331b694c1..39f41494e2 100644
--- a/wiretap/dbs-etherwatch.c
+++ b/wiretap/dbs-etherwatch.c
@@ -199,6 +199,7 @@ int dbs_etherwatch_open(wtap *wth, int *err, gchar **err_info _U_)
wth->snapshot_length = 0; /* not known */
wth->subtype_read = dbs_etherwatch_read;
wth->subtype_seek_read = dbs_etherwatch_seek_read;
+ wth->tsprecision = WTAP_FILE_TSPREC_CSEC;
return 1;
}
diff --git a/wiretap/erf.c b/wiretap/erf.c
index 0937e9004b..a71424eed6 100644
--- a/wiretap/erf.c
+++ b/wiretap/erf.c
@@ -214,6 +214,7 @@ int erf_open(wtap *wth, int *err, gchar **err_info _U_)
wth->subtype_read = erf_read;
wth->subtype_seek_read = erf_seek_read;
wth->subtype_close = erf_close;
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC;
return 1;
}
diff --git a/wiretap/etherpeek.c b/wiretap/etherpeek.c
index afa8044f90..6aea88515b 100644
--- a/wiretap/etherpeek.c
+++ b/wiretap/etherpeek.c
@@ -353,6 +353,7 @@ int etherpeek_open(wtap *wth, int *err, gchar **err_info _U_)
}
wth->snapshot_length = 0; /* not available in header */
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
return 1;
}
diff --git a/wiretap/eyesdn.c b/wiretap/eyesdn.c
index 277a4684ec..6c47523d2c 100644
--- a/wiretap/eyesdn.c
+++ b/wiretap/eyesdn.c
@@ -155,6 +155,7 @@ int eyesdn_open(wtap *wth, int *err, gchar **err_info _U_)
wth->snapshot_length = 0; /* not known */
wth->subtype_read = eyesdn_read;
wth->subtype_seek_read = eyesdn_seek_read;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
return 1;
}
diff --git a/wiretap/hcidump.c b/wiretap/hcidump.c
index ccca83ce8f..7aeadeab70 100644
--- a/wiretap/hcidump.c
+++ b/wiretap/hcidump.c
@@ -154,6 +154,7 @@ int hcidump_open(wtap *wth, int *err, gchar **err_info _U_)
wth->subtype_read = hcidump_read;
wth->subtype_seek_read = hcidump_seek_read;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
return 1;
}
diff --git a/wiretap/i4btrace.c b/wiretap/i4btrace.c
index 11dc2cc2fd..9b9d2d6a7c 100644
--- a/wiretap/i4btrace.c
+++ b/wiretap/i4btrace.c
@@ -109,6 +109,7 @@ int i4btrace_open(wtap *wth, int *err, gchar **err_info _U_)
wth->capture.i4btrace->byte_swapped = byte_swapped;
wth->file_encap = WTAP_ENCAP_ISDN;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
return 1;
}
diff --git a/wiretap/iptrace.c b/wiretap/iptrace.c
index 9281b6b80c..a78323d96c 100644
--- a/wiretap/iptrace.c
+++ b/wiretap/iptrace.c
@@ -72,11 +72,13 @@ int iptrace_open(wtap *wth, int *err, gchar **err_info _U_)
wth->file_type = WTAP_FILE_IPTRACE_1_0;
wth->subtype_read = iptrace_read_1_0;
wth->subtype_seek_read = iptrace_seek_read_1_0;
+ wth->tsprecision = WTAP_FILE_TSPREC_SEC;
}
else if (strcmp(name, "iptrace 2.0") == 0) {
wth->file_type = WTAP_FILE_IPTRACE_2_0;
wth->subtype_read = iptrace_read_2_0;
wth->subtype_seek_read = iptrace_seek_read_2_0;
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC;
}
else {
return 0;
diff --git a/wiretap/k12.c b/wiretap/k12.c
index ecd9b75185..3df194516e 100644
--- a/wiretap/k12.c
+++ b/wiretap/k12.c
@@ -419,6 +419,7 @@ int k12_open(wtap *wth, int *err, gchar **err_info _U_) {
wth->subtype_seek_read = k12_seek_read;
wth->subtype_close = k12_close;
wth->capture.k12 = file_data;
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC;
/* if we use just one encapsulation for all the file
we will use that for the whole file so we can
diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c
index a6553ecc60..006dc4a538 100644
--- a/wiretap/lanalyzer.c
+++ b/wiretap/lanalyzer.c
@@ -163,6 +163,7 @@ int lanalyzer_open(wtap *wth, int *err, gchar **err_info)
wth->subtype_seek_read = lanalyzer_seek_read;
wth->subtype_close = lanalyzer_close;
wth->snapshot_length = 0;
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC;
/* Read records until we find the start of packets */
while (1) {
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c
index 86bf798a6f..b1bccc7541 100644
--- a/wiretap/libpcap.c
+++ b/wiretap/libpcap.c
@@ -602,9 +602,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
int file_encap;
- /* XXX - this must be done depending on the magic number */
- /*wth->tsrecision = WTAP_FILE_TSPREC_NSEC;*/
-
/* Read in the number that should be at the start of a "libpcap" file */
errno = WTAP_ERR_CANT_READ;
bytes_read = file_read(&magic, 1, sizeof magic, wth->fh);
@@ -623,6 +620,7 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
a program using either standard or ss990417 libpcap. */
byte_swapped = FALSE;
modified = FALSE;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
break;
case PCAP_MODIFIED_MAGIC:
@@ -630,6 +628,7 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
a program using either ss990915 or ss991029 libpcap. */
byte_swapped = FALSE;
modified = TRUE;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
break;
case PCAP_SWAPPED_MAGIC:
@@ -638,6 +637,7 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
ss990417 libpcap. */
byte_swapped = TRUE;
modified = FALSE;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
break;
case PCAP_SWAPPED_MODIFIED_MAGIC:
@@ -646,6 +646,7 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
or ss991029 libpcap. */
byte_swapped = TRUE;
modified = TRUE;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
break;
default:
diff --git a/wiretap/netmon.c b/wiretap/netmon.c
index c3c552d2d0..19eb125bcd 100644
--- a/wiretap/netmon.c
+++ b/wiretap/netmon.c
@@ -299,6 +299,7 @@ int netmon_open(wtap *wth, int *err, gchar **err_info)
/* Set up to start reading at the first frame. */
wth->capture.netmon->current_frame = 0;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
return 1;
}
diff --git a/wiretap/nettl.c b/wiretap/nettl.c
index 75ffb9e1ca..e24e30ec7f 100644
--- a/wiretap/nettl.c
+++ b/wiretap/nettl.c
@@ -263,6 +263,7 @@ int nettl_open(wtap *wth, int *err, gchar **err_info _U_)
return -1;
}
wth->data_offset = FILE_HDR_SIZE;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
return 1;
}
diff --git a/wiretap/network_instruments.c b/wiretap/network_instruments.c
index 0e226e6e48..7d723c4804 100644
--- a/wiretap/network_instruments.c
+++ b/wiretap/network_instruments.c
@@ -178,6 +178,7 @@ int network_instruments_open(wtap *wth, int *err, gchar **err_info)
wth->subtype_close = NULL;
wth->subtype_sequential_close = NULL;
wth->snapshot_length = 0;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
/* reset the pointer to the first packet */
if (file_seek(wth->fh, file_header.offset_to_first_packet, SEEK_SET,
diff --git a/wiretap/netxray.c b/wiretap/netxray.c
index f5164a0615..f477ef70fc 100644
--- a/wiretap/netxray.c
+++ b/wiretap/netxray.c
@@ -404,10 +404,12 @@ int netxray_open(wtap *wth, int *err, gchar **err_info)
case WTAP_FILE_NETXRAY_OLD:
timeunit = 1000.0;
+ wth->tsprecision = WTAP_FILE_TSPREC_MSEC;
break;
case WTAP_FILE_NETXRAY_1_0:
timeunit = 1000.0;
+ wth->tsprecision = WTAP_FILE_TSPREC_MSEC;
break;
case WTAP_FILE_NETXRAY_1_1:
@@ -418,6 +420,7 @@ int netxray_open(wtap *wth, int *err, gchar **err_info)
* and older versions of Windows Sniffer.
*/
timeunit = 1000000.0;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
break;
case WTAP_FILE_NETXRAY_2_00x:
@@ -443,6 +446,7 @@ int netxray_open(wtap *wth, int *err, gchar **err_info)
return -1;
}
timeunit = TpS[hdr.timeunit];
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC; /* XXX */
break;
case ETH_CAPTYPE_GIGPOD:
@@ -455,6 +459,7 @@ int netxray_open(wtap *wth, int *err, gchar **err_info)
return -1;
}
timeunit = TpS_gigpod[hdr.timeunit];
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC; /* XXX */
/*
* At least for 002.002 and 002.003
@@ -475,6 +480,7 @@ int netxray_open(wtap *wth, int *err, gchar **err_info)
return -1;
}
timeunit = TpS_otherpod[hdr.timeunit];
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC; /* XXX */
/*
* At least for 002.002 and 002.003
@@ -495,6 +501,7 @@ int netxray_open(wtap *wth, int *err, gchar **err_info)
return -1;
}
timeunit = TpS_gigpod2[hdr.timeunit];
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC; /* XXX */
break;
default:
@@ -516,6 +523,7 @@ int netxray_open(wtap *wth, int *err, gchar **err_info)
return -1;
}
timeunit = TpS[hdr.timeunit];
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC; /* XXX */
break;
}
break;
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
index 04bcb78e89..d219c29c30 100644
--- a/wiretap/ngsniffer.c
+++ b/wiretap/ngsniffer.c
@@ -628,6 +628,8 @@ int ngsniffer_open(wtap *wth, int *err, gchar **err_info)
* isn't stored in the capture file.
*/
+ wth->tsprecision = WTAP_FILE_TSPREC_NSEC; /* XXX */
+
return 1;
}
diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c
index 8913cd8c4a..9513d6ab8f 100644
--- a/wiretap/pppdump.c
+++ b/wiretap/pppdump.c
@@ -295,6 +295,7 @@ pppdump_open(wtap *wth, int *err, gchar **err_info _U_)
wth->subtype_read = pppdump_read;
wth->subtype_seek_read = pppdump_seek_read;
wth->subtype_close = pppdump_close;
+ wth->tsprecision = WTAP_FILE_TSPREC_DSEC;
state->seek_state = g_malloc(sizeof(pppdump_t));
diff --git a/wiretap/radcom.c b/wiretap/radcom.c
index 9c3934504a..c32bfbaa3b 100644
--- a/wiretap/radcom.c
+++ b/wiretap/radcom.c
@@ -172,6 +172,7 @@ int radcom_open(wtap *wth, int *err, gchar **err_info)
wth->subtype_read = radcom_read;
wth->subtype_seek_read = radcom_seek_read;
wth->snapshot_length = 0; /* not available in header, only in frame */
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
tm.tm_year = pletohs(&start_date.year)-1900;
tm.tm_mon = start_date.month-1;
diff --git a/wiretap/snoop.c b/wiretap/snoop.c
index 5dc0c2a27d..c0aa19e0ee 100644
--- a/wiretap/snoop.c
+++ b/wiretap/snoop.c
@@ -398,6 +398,7 @@ int snoop_open(wtap *wth, int *err, gchar **err_info)
wth->subtype_seek_read = snoop_seek_read;
wth->file_encap = file_encap;
wth->snapshot_length = 0; /* not available in header */
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
return 1;
}
diff --git a/wiretap/toshiba.c b/wiretap/toshiba.c
index a9cc44d503..824b0a1591 100644
--- a/wiretap/toshiba.c
+++ b/wiretap/toshiba.c
@@ -226,6 +226,7 @@ int toshiba_open(wtap *wth, int *err, gchar **err_info _U_)
wth->snapshot_length = 0; /* not known */
wth->subtype_read = toshiba_read;
wth->subtype_seek_read = toshiba_seek_read;
+ wth->tsprecision = WTAP_FILE_TSPREC_CSEC;
return 1;
}
diff --git a/wiretap/visual.c b/wiretap/visual.c
index b270d508fa..34f4ab52b6 100644
--- a/wiretap/visual.c
+++ b/wiretap/visual.c
@@ -215,6 +215,7 @@ int visual_open(wtap *wth, int *err, gchar **err_info)
wth->subtype_read = visual_read;
wth->subtype_seek_read = visual_seek_read;
wth->subtype_close = visual_close;
+ wth->tsprecision = WTAP_FILE_TSPREC_USEC;
/* Add Visual-specific information to the wiretap struct for later use. */
visual = g_malloc(sizeof(struct visual_read_info));
diff --git a/wiretap/vms.c b/wiretap/vms.c
index 02d0e6cc8a..81b00986dc 100644
--- a/wiretap/vms.c
+++ b/wiretap/vms.c
@@ -271,6 +271,7 @@ int vms_open(wtap *wth, int *err, gchar **err_info _U_)
wth->snapshot_length = 0; /* not known */
wth->subtype_read = vms_read;
wth->subtype_seek_read = vms_seek_read;
+ wth->tsprecision = WTAP_FILE_TSPREC_CSEC;
return 1;
}
diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h
index 91a7456a84..91d1c6f685 100644
--- a/wiretap/wtap-int.h
+++ b/wiretap/wtap-int.h
@@ -177,7 +177,7 @@ struct wtap {
per-file encapsulation
types */
int tsprecision; /* timestamp precision of the lower 32bits
- * 6 is microseconds, 9 is nanoseconds */
+ * e.g. WTAP_FILE_TSPREC_USEC */
};
struct wtap_dumper;
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 44da7e5c6a..6a852ef16e 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -224,7 +224,11 @@
/* last WTAP_FILE_ value + 1 */
#define WTAP_NUM_FILE_TYPES 41
-/* timestamp accuracy (currently only these values are supported) */
+/* timestamp precision (currently only these values are supported) */
+#define WTAP_FILE_TSPREC_SEC 0
+#define WTAP_FILE_TSPREC_DSEC 1
+#define WTAP_FILE_TSPREC_CSEC 2
+#define WTAP_FILE_TSPREC_MSEC 3
#define WTAP_FILE_TSPREC_USEC 6
#define WTAP_FILE_TSPREC_NSEC 9