path: root/wiretap/tnef.c
diff options
authorGuy Harris <guy@alum.mit.edu>2012-02-25 23:24:34 +0000
committerGuy Harris <guy@alum.mit.edu>2012-02-25 23:24:34 +0000
commitb6ff142f60309faceb422e3d3689c7406aca9361 (patch)
treefc06d6f47b4bc726709812f14f7576d1945af5c0 /wiretap/tnef.c
parente994e7841299a7eb15783ef24f0b1de46218a1b1 (diff)
Add a presence flag field to the packet information structure filled in
by Wiretap, to indicate whether certain fields in that structure actually have data in them. Use the "time stamp present" flag to omit showing time stamp information for packets (and "packets") that don't have time stamps; don't bother working very hard to "fake" a time stamp for data files. Use the "interface ID present" flag to omit the interface ID for packets that don't have an interface ID. We don't use the "captured length, separate from packet length, present" flag to omit the captured length; that flag might be present but equal to the packet length, and if you want to know if a packet was cut short by a snapshot length, comparing the values would be the way to do that. More work is needed to have wiretap/pcapng.c properly report the flags, e.g. reporting no time stamp being present for a Simple Packet Block. svn path=/trunk/; revision=41185
Diffstat (limited to 'wiretap/tnef.c')
1 files changed, 3 insertions, 5 deletions
diff --git a/wiretap/tnef.c b/wiretap/tnef.c
index d43ffc9270..f7772509d0 100644
--- a/wiretap/tnef.c
+++ b/wiretap/tnef.c
@@ -40,7 +40,6 @@ static gboolean tnef_read(wtap *wth, int *err, gchar **err_info, gint64 *data_of
guint8 *buf;
gint64 file_size;
int packet_size;
- ws_statb64 statb;
*err = 0;
@@ -72,13 +71,12 @@ static gboolean tnef_read(wtap *wth, int *err, gchar **err_info, gint64 *data_of
wth->data_offset += packet_size;
+ wth->phdr.presence_flags = 0; /* no time stamp, no "real length" */
wth->phdr.caplen = packet_size;
wth->phdr.len = packet_size;
- if (wtap_fstat(wth, &statb, err) == -1)
- return FALSE;
- wth->phdr.ts.secs = statb.st_mtime;
+ wth->phdr.ts.secs = 0;
wth->phdr.ts.nsecs = 0;
return TRUE;