From b6ff142f60309faceb422e3d3689c7406aca9361 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 25 Feb 2012 23:24:34 +0000 Subject: 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 --- wiretap/etherpeek.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'wiretap/etherpeek.c') diff --git a/wiretap/etherpeek.c b/wiretap/etherpeek.c index e28b373f0e..b0cb8c12b3 100644 --- a/wiretap/etherpeek.c +++ b/wiretap/etherpeek.c @@ -402,6 +402,8 @@ static gboolean etherpeek_read_v7(wtap *wth, int *err, gchar **err_info, sliceLength = length; } + wth->phdr.presence_flags = WTAP_HAS_TS|WTAP_HAS_CAP_LEN; + /* fill in packet header length values before slicelength may be adjusted */ wth->phdr.len = length; -- cgit v1.2.3