Commit Graph

202 Commits

Author SHA1 Message Date
Guy Harris cf6d9841e3 Keep track, in Wiretap, of whether the file is compressed, and provide
an API to fetch that.

When doing "Save" on a compressed file, write it out compressed.

In the Statistics -> Summary dialog and in capinfos, report whether the
file is gzip-compressed.

svn path=/trunk/; revision=42818
2012-05-24 05:05:29 +00:00
Guy Harris 0275247b97 Use WTAP_ENCAP_IEEE_802_11_xxx for all the "802.11 plus radio header"
encapsulations.

For pre-V9 AiroPeek captures, leave the radio information in the packet
data, just as we do with the Prism, AVS, radiotap, and NetMon headers. 
Add a dissector for it.

svn path=/trunk/; revision=42379
2012-05-02 03:11:00 +00:00
Martin Mathieson 45252c84e3 Patch for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5048
From Tom Cook and Tom Alexander.

1. A VWR encapsulation that reads VeriWave capture files (*.vwr)
generated from
WaveTest test hardware
2. Dissectors that display the VeriWave tap headers (both 802.11 and
Ethernet)
3. A dissector for the WaveAgent protocol.  The WaveAgent dissector is
heuristic and parses the WaveAgent packet (a UDP payload).

The WaveAgent dissector has been Fuzz tested.

The VWR ENCAP and dissectors have been used extensively by VeriWave
customers in a special version of WireSark compiled by VeriWave.

svn path=/trunk/; revision=42155
2012-04-20 12:08:31 +00:00
Guy Harris 4a8f46a5ac Call LAPD-with-Linux-pseudoheader "linux-lapd", and fix its description
to indicate the Linux pseudo-header.

Fix the description of LAPD-without-Linux-pseudoheader to be just
"LAPD".

svn path=/trunk/; revision=42018
2012-04-10 23:32:16 +00:00
Guy Harris 51e76d89eb Fix tpo.
svn path=/trunk/; revision=42017
2012-04-10 23:28:17 +00:00
Guy Harris 4db2d3443a It's "X.25", not "X25".
svn path=/trunk/; revision=42016
2012-04-10 23:27:39 +00:00
Guy Harris 154c0f37dd Indicate where BACnet MS/TP is specified.
Add a new WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR encapsulation type, for use
by the EyeSDN file reader; unlike the pcap-encapsulated MS/TP, it
includes a direction indicator.  Don't treat WTAP_ENCAP_BACNET_MS_TP as
if it has a direction indicator, as it doesn't; instead, do that for
WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR.

Add some missing entries to encap_table_base for WTAP_ENCAP_ values that
didn't get entries added.

svn path=/trunk/; revision=41969
2012-04-06 03:42:32 +00:00
Jeff Morriss 9c1bf7223e Don't mark the file as unsaved unless the capture or packet comments actually changed.
svn path=/trunk/; revision=41744
2012-03-23 01:41:59 +00:00
Jeff Morriss fb46cda196 When we're in a for(i=0,[...]) loop, don't reuse (and thus reset) 'i' in another for(i=0,[...]) loop. This fixes the capinfos double-free crashes that the fuzz bot has been experiencing.
svn path=/trunk/; revision=41610
2012-03-16 14:07:22 +00:00
Anders Broman dc674a6043 - Store ISB data.
- free IDB and ISB data when closing.

svn path=/trunk/; revision=41558
2012-03-15 13:46:42 +00:00
Anders Broman 7fba54762b From Mike Wakerly: Add wiretap suport for LINKTYPE_NFC_LLCP
svn path=/trunk/; revision=41368
2012-03-06 09:02:06 +00:00
Anders Broman 23ec82fae9 From Reinhard Speyerer: Adding support for LINKTYPE_PPP_ETHER/DLT_PPP_ETHER
svn path=/trunk/; revision=41256
2012-03-01 07:39:54 +00:00
Anders Broman d24fad6371 - Add a LED in the statusbar to indicate that capture comments exists,
clickable to open an edit window.
- Add checks for NULL pointers.

Help with a different color LED possibly with Jeff's (c) in it apreceated.
Should the LED be placed elsewhere or the whole thing done differently?

svn path=/trunk/; revision=41242
2012-02-29 16:51:32 +00:00
Anders Broman 38c69c8431 Make it possible to edit capture comments
svn path=/trunk/; revision=41193
2012-02-26 17:04:28 +00:00
Anders Broman 89758cdec8 From Jose Pedro Oliveira fix a typo
svn path=/trunk/; revision=41091
2012-02-20 22:40:17 +00:00
Anders Broman c7f1a431d2 Handle reading and writing of multiple IDB:s, write IDB options and use correct lengt for strings, handle more than 100 char comment
svn path=/trunk/; revision=41082
2012-02-20 20:15:51 +00:00
Anders Broman 0b6b3937ab Make it possible to get inforamtion from the read SHB to the one to write out.
svn path=/trunk/; revision=41032
2012-02-15 19:44:16 +00:00
Anders Broman 5f14cec8e2 From Guy Martin:
Add new linktype 243 for MPEG2-TS.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6796

svn path=/trunk/; revision=40884
2012-02-06 19:15:07 +00:00
Guy Harris d94bd07f99 Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports any
form of corruption/bogosity in a file, including in a file header as
well as in records in the file.  Change the error message
wtap_strerror() returns for it to reflect that.

Use it for some file header problems for which it wasn't already being
used - WTAP_ERR_UNSUPPORTED shouldn't be used for that, it should only
be used for files that we have no reason to believe are invalid but that
have a version number we don't know about or some other
non-link-layer-encapsulation-type value we don't know about.

svn path=/trunk/; revision=40175
2011-12-13 09:53:50 +00:00
Jaap Keuter 016bf3b0cf from Petr Sumbera:
Solaris 11 snoop files with IP over Infiniband data are not recognized.
Attached patch allows to view such data.

svn path=/trunk/; revision=40072
2011-12-02 22:23:07 +00:00
Bill Meier 3227cade47 Add entries for WTAP_ENCAP_NETANALYZER... to encap_table_base[]
svn path=/trunk/; revision=39810
2011-11-12 20:27:32 +00:00
Bill Meier d1d9cf61c7 Add (missing) "mime" entry to encap_table_base[].
svn path=/trunk/; revision=39796
2011-11-11 22:21:06 +00:00
Stig Bjørlykke 8443bbbf75 Replace all strerror() with g_strerror().
Remove our local strerror implementation.
Mark strerror as locale unsafe API.

This fixes bug 5715.

svn path=/trunk/; revision=37812
2011-06-28 09:00:11 +00:00
Chris Maynard 63b50fe2ee Declare the snapshot_length as unsigned.
svn path=/trunk/; revision=37479
2011-05-31 15:27:48 +00:00
Michael Tüxen a385b7c9f3 * Don't declare a used arg as unused.
* Really clear the EOF flag. This fixes a bug where
  tshark is not able to do a live capture from a pcapng
  file.

svn path=/trunk/; revision=37207
2011-05-17 19:51:55 +00:00
Guy Harris 3de2b1be74 Get rid of the fd member of a wth structure; the FILE_T's in that
structure include a file descriptor.  Add a wtap_fstat() for the file
readers that use file times to generate time stamps (we really need a
way to say "this file has no time stamps" or "this file has only
relative time stamps).

svn path=/trunk/; revision=37026
2011-05-09 08:12:26 +00:00
Guy Harris 88a1ed85e3 From Jakub Zawadzki: for file read progress bars, use the raw offset in
the file, rather than the offset in the uncompressed data stream.  That
way we don't get the "hey, we're more than 100% into the file, better
refigure this" surprise.

svn path=/trunk/; revision=37025
2011-05-09 05:30:59 +00:00
Anders Broman a663d91ca6 From Hans-Christoph Schemmel:
A variant of 3GPP TS 27.010 multiplexing protocol dissector.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5829

svn path=/trunk/; revision=36927
2011-04-28 05:36:26 +00:00
Guy Harris 140cc563c6 In file_wrappers.c, explicitly set err_info to null for all errors that
don't have an "additional information" string.

Get rid of WTAP_ERR_ZLIB; just report an internal error with
WTAP_ERR_INTERNAL instead.  (If they start happening, we can think about
supplying an "additional information" string for compression errors on
output.)

svn path=/trunk/; revision=36774
2011-04-21 17:51:19 +00:00
Guy Harris 6cbf6ce16c Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered
by the gunzipping code.  Have it also supply a err_info string, and
report it.  Have file_error() supply an err_info string.

Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to
suggest a decompression error - into the rawshark and tshark errors,
along the lines of what other programs print.

Fix a case in the Netscaler code where we weren't fetching the error
code on a read failure.

svn path=/trunk/; revision=36748
2011-04-21 09:41:52 +00:00
Guy Harris 92c974f2f7 Now that wtap_read() checks for delayed errors on EOF, there's no need
to check for it on close.

svn path=/trunk/; revision=36593
2011-04-12 17:37:05 +00:00
Guy Harris bbcb51276a If we hit an EOF - wth->subtype_read returns FALSE, but sets *err to 0 -
call file_error() to fetch any deferred error, so we report an error
rather than an "everything's OK" EOF.

svn path=/trunk/; revision=36578
2011-04-12 03:27:10 +00:00
Guy Harris b28ee8b331 From Jakub Zawadzki: speed up random access to gzipped files, as per the
zran.c example in the zlib source.

This means that problems in the file's contents might not be reported
when a packet is read, as long as there's no problem in the contents of
the file up to the last bit of compressed data for the packet; we now
check for errors after finishing the sequential read of the file, at
least in some programs, so that shouldn't be an issue (the other
programs need to be changed to do so as well).  This is necessary in
order to be able to read all the packets we saw in the sequential pass;
it also lets us get a few more packets from truncated files in some
cases.

svn path=/trunk/; revision=36577
2011-04-12 02:40:14 +00:00
Guy Harris e5fe0128d7 Allow wtap_sequential_close() and wtap_close() to return an error; this
may happen if, when reading a compressed file, we find an error in the
file's contents past the last packet (e.g., the file being cut short so
that we can't get a full buffer worth of compressed data), and that
reporting of that error is delayed (so that you can get all of the
packets that we *can* decompress).  Check for those errors, at least on
the sequential read pass (the only errors we should see when closing the
random stream are errors we've already seen in the sequential stream).

svn path=/trunk/; revision=36576
2011-04-12 01:36:12 +00:00
Guy Harris 0629b7399a Define ws_statb64 to be the appropriate "struct XXX" for a
64-bit-file-size-capable stat call, and use it for ws_fstat64().

svn path=/trunk/; revision=36545
2011-04-10 19:56:06 +00:00
Guy Harris 71d4caa5b9 Add ws_fstat64(), defined to be fstat on UN*X and _fstati64 on Windows.
Use it in some places where we're getting the file size.

svn path=/trunk/; revision=36544
2011-04-10 18:55:06 +00:00
Guy Harris c349caf925 Use AC_SYS_LARGEFILE to turn on large file support on platforms that
support it.

Rename ws_lseek to ws_lseek64, as it should be given a 64-bit offset,
and have it use _lseeki64 on Windows, to try to get 64-bit offset
support; AC_SYS_LARGEFILE should cause lseek() to support 64-bit offsets
on UN*X if possible.

svn path=/trunk/; revision=36542
2011-04-10 18:22:47 +00:00
Guy Harris ab261a3281 From Jakub Zawadzki:
Steal file_wrappers functions from zlib v2.

svn path=/trunk/; revision=36513
2011-04-08 00:28:37 +00:00
Guy Harris d00527f369 From Jakub Zawadzki:
Introduce file_clearerr

	I'm unsure of this patch, 

	gzclearerr() is used to clear the end-of-file mark, but for FILE
	there's function which do the same (clearerr).

	I created test program if clearerr() is needed for tailing file. 
	and it seems to work without it (at least on Linux, so for
	!HAVE_LIBZ I commented it out).

	For now this patch introduce file_clearerr macro, and define it
	only when EOF marking must be cleared (i.e.  when HAVE_LIBZ and
	HAVE_GZCLEARERR are defined).

	So everything works like before, patch just to keep same prefix
	for file interface :)

svn path=/trunk/; revision=36510
2011-04-07 21:53:31 +00:00
Gerald Combs fcf51fc73b Add initial pcapng name resolution record support. Wireshark has read
support; TShark has read+write support. Additionally TShark can read a
"hosts" file and write those records to a capture file.

This uses "struct addrinfo" in many places and probably won't compile on
some platforms.

svn path=/trunk/; revision=36318
2011-03-24 22:47:57 +00:00
Bill Meier 16b528aaf1 From Martin Kaiser: dissector for DVB-CI (Common Interface)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5654

From me:
- Entry for DVBCI added to wtap.c encap_table_base[];
- Some code simplification with respect to the use of col_...() for COL_INFO;
- Certain tests for "enough bytes available" not really needed;
- (Other minor tweaks);
- #include<stdio.h> not req'd;
- Minor reformatting and whitespace cleanup;


svn path=/trunk/; revision=36149
2011-03-07 02:22:48 +00:00
Jaap Keuter 9e367f5cff From njohnkev:
Add support for LAPD data link type.

svn path=/trunk/; revision=35771
2011-02-02 22:49:40 +00:00
Jaap Keuter 7e16ec5b99 Prepare for handling DLT_IPV4 and DLT_IPV6.
svn path=/trunk/; revision=35223
2010-12-19 18:46:08 +00:00
Bill Meier 9787a5734a From Hadriel Kaplan: IPFIX file format support.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5242

svn path=/trunk/; revision=34576
2010-10-20 00:36:53 +00:00
Jeff Morriss 80d78c6794 Very old versions of libz (such as the one that comes with Solaris 10) don't have gzclearerr(). Check for that function and only use it if we have it.
svn path=/trunk/; revision=34187
2010-09-22 21:51:53 +00:00
Guy Harris 11b9ed0426 Define WTAP_ENCAP_IEEE802_15_4_NOFCS, for use in file formats that don't
include the FCS, and use it for the Daintree SNA file format.  While
we're at it, explicitly check to make sure the purported packet length
gives it at least one byte of packet data, and fix some print formats to
use %u for unsigned values.

svn path=/trunk/; revision=33678
2010-07-30 02:30:50 +00:00
Guy Harris d1751061c8 Initial support for Network Monitor 802.11 radio header.
svn path=/trunk/; revision=33583
2010-07-19 18:00:20 +00:00
Guy Harris 8c19a3441f Add an entry in encap_table_base for SocketCAN.
svn path=/trunk/; revision=33578
2010-07-18 22:14:56 +00:00
Martin Mathieson 33dc9a3eb4 Fix non-libz build.
svn path=/trunk/; revision=32734
2010-05-10 12:56:01 +00:00
Gerald Combs 0a209d762e Zlib has an officially-sanctioned way of clearing EOF when we're tailing
a file.  Use it.

svn path=/trunk/; revision=32716
2010-05-07 21:15:24 +00:00