Commit Graph

1716 Commits

Author SHA1 Message Date
Guy Harris 55001ef198 With the WTAP_ERR_UNSUPPORTED error, Wiretap supplies a string giving
the details of what in particular is unsupported; report it in TShark
and Wireshark.

Handle WTAP_ERR_RANDOM_OPEN_PIPE in TShark.

Handle WTAP_ERR_COMPRESSION_NOT_SUPPORTED in TShark, and have its error
message in Wireshark not speak of gzip, in case we support compressed
output in other formats in the future.

If we see a second section header block in a pcap-NG file, don't report
it as "the file is corrupted", report it as "the file uses a feature we
don't support", as that's the case - and don't free up the interface
data array, as the file remains open, and Wireshark might still try to
access the packets we were able to read.

svn path=/trunk/; revision=41041
2012-02-16 18:58:40 +00:00
Guy Harris 5e8d2c79f6 Again, turn off the debug logging; it messes up the fuzz-testing bot.
svn path=/trunk/; revision=41034
2012-02-16 02:06:48 +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
Guy Harris 197f7b9c02 TYPE_PAD records can have zero bytes of payload; don't treat them as
errors.

svn path=/trunk/; revision=41030
2012-02-14 22:31:33 +00:00
Michael Tüxen 68204c94a4 From Anders: Add support for options in the SHB.
From me: Some whitespace changes.

svn path=/trunk/; revision=41026
2012-02-14 17:07:52 +00:00
Anders Broman 1bc9a08e41 White space changes.
svn path=/trunk/; revision=41015
2012-02-13 17:34:56 +00:00
Anders Broman c7b1aeb5f5 Drop count is 64 bits
svn path=/trunk/; revision=41014
2012-02-13 17:34:15 +00:00
Jeff Morriss 670120c481 Fix the crash reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6804
For WTAP_ENCAP_ERF files if we find an Extension and/or Multi-Channel header,
ensure that the size of the full pseudoheader is smaller than the packet size
to avoid an underflow and subsequent attempt to allocate a rather large amount
of memory.

svn path=/trunk/; revision=41008
2012-02-13 03:03:03 +00:00
Guy Harris 61c2e0ea40 Do not assume tab stops are set every 4 spaces.
svn path=/trunk/; revision=41007
2012-02-12 23:50:13 +00:00
Michael Tüxen 13beca3bbf Fix debug output.
svn path=/trunk/; revision=41004
2012-02-12 21:56:00 +00:00
Anders Broman 74f2ef4f76 Store drop count if present.
svn path=/trunk/; revision=40974
2012-02-11 17:31:13 +00:00
Anders Broman 8aea738cda Add the abillity to read and write option comments unedited.
This is POC we may want to have more efficient use of the frame data
structure etc. But this allows for work to be done on the GUI to actually add comments.

svn path=/trunk/; revision=40969
2012-02-11 12:34:39 +00:00
Guy Harris 357a3e2837 Revert presumably-unintentional turning on of debug messages.
svn path=/trunk/; revision=40963
2012-02-11 02:41:04 +00:00
Anders Broman 7be6e75c13 Add pcapng variables to wtap_pkthdr.
svn path=/trunk/; revision=40947
2012-02-09 22:24:00 +00:00
Alexis La Goutte 64b511f5e7 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=40909
2012-02-06 22:20:29 +00:00
Alexis La Goutte 50fe66d265 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=40908
2012-02-06 22:19:07 +00:00
Alexis La Goutte 7424e362c6 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=40907
2012-02-06 22:18:45 +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
Anders Broman 0179b7dc50 Add *.sbr files to the clean target.
svn path=/trunk/; revision=40763
2012-01-29 20:33:58 +00:00
Anders Broman 997b768069 From Tom Brezinski:
includes radio data from the capture.

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

svn path=/trunk/; revision=40754
2012-01-28 17:10:50 +00:00
Anders Broman 6dbeabfc6f From Tobias Witek:
Allow dissectors to indicate that an ATM AAL5 frame contains SSCOP.

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

svn path=/trunk/; revision=40750
2012-01-28 16:34:22 +00:00
Guy Harris c8854a7a5f Add a routine to Wiretap that takes a file type value and an
encapsulation value and returns a GArray containing all the file types
that could be used to save a file of that file type and that
encapsulation value (which could be WTAP_ENCAP_PER_PACKET), with the
input file type first if that can be used and pcap or pcap-ng first if
not and if one of them can be used, and with pcap and pcap-ng clustered
together if they're among the file types that can be used.

Use that routine for the GTK+ file save dialog.

svn path=/trunk/; revision=40685
2012-01-24 04:33:23 +00:00
Jeff Morriss f7e1f76659 From njtaylor0101 [AT] gmail.com via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6740 :
Fix an out-of-array-bounds warning from OpenBSD's compiler.  (Note: this is
actually a false positive since adequate memory is allocated.)

From me: some additional code simplification.

svn path=/trunk/; revision=40680
2012-01-24 02:20:46 +00:00
Guy Harris 3b1f82d063 In the table of capture file types, have:
a field that gives the default extension for the file type,
	*without* a leading "." (i.e., just the extension, not the "."
	that separates it from the rest of the file name), which is NULL
	if there are no known extensions;

	a field that gives a semicolon-separated list of *other*
	extensions, without "*." or ".", which is NULL if there are no
	known extensions or there are no known extensions other than the
	default.

Rename wtap_file_extension_default_string() to
wtap_default_file_extension() (matches the name of the field).

svn path=/trunk/; revision=40678
2012-01-23 23:17:03 +00:00
Guy Harris bb98263aa4 Have wtap_file_extension_default_string() return the extension in the
sense of "what follows the last . in the file name", i.e. not including
the ".".

svn path=/trunk/; revision=40674
2012-01-23 21:57:45 +00:00
Guy Harris ef2bf47e32 Add default extension names for all file types for which we have
extensions at all.

For file types that are plain text and that don't already have
extensions, add "txt" as the extension.

svn path=/trunk/; revision=40657
2012-01-23 02:38:56 +00:00
Guy Harris e4a193fe5e Replace wtap_file_extensions_string() with a routine that returns a
GSList of extensions for a file type, including extensions for the
compressed versions of those file types that we can read.

svn path=/trunk/; revision=40623
2012-01-21 08:59:21 +00:00
Guy Harris 020d9491da It's the Xoraya file type, not the Xoraya encapsulation, that was bogus.
svn path=/trunk/; revision=40622
2012-01-21 04:00:43 +00:00
Guy Harris 97ad2f8177 "*.*" as a pattern for a given file type is pointless, as it doesn't
select only files of that type; you might as well use "All Files (*.*)"
for that.

The default suffix is a suffix, not a pattern, so it shouldn't be
"*.{something}".

We only use the patterns on Windows, where file names are
case-insensitive, so there's no point in capital letters in suffixes.

svn path=/trunk/; revision=40621
2012-01-21 03:55:40 +00:00
Guy Harris e3712a53da Get rid of an unused file type. If somebody wants it in the official
Wireshark distribution, give us code to read it.  If somebody wants it
in their private version of Wireshark, they can manage that themselves. 
(We should support plugins for file types at some point; I think we
already have support for Lua file readers.)

svn path=/trunk/; revision=40620
2012-01-21 03:52:19 +00:00
Guy Harris 9ca4193385 Line up #define values.
svn path=/trunk/; revision=40576
2012-01-18 22:05:47 +00:00
Guy Harris e13c87acc4 Tabs are not *ipso facto* 4 spaces.
svn path=/trunk/; revision=40575
2012-01-18 22:05:01 +00:00
Alexis La Goutte cb6644ea4b From Tom Brezinski via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6746
Adding support for Network Instruments 802.11 wireless captures

Attaching very simple change to allow reading of Network Instruments Observer 802.11 wireless capture files.

svn path=/trunk/; revision=40571
2012-01-18 21:23:30 +00:00
Guy Harris 6224e81b9f wth->phdr.pkt_encap isn't set on a seek-and-read; pass the encapsulation
directly to k12text_set_pseudo_header(), so that it's passed the right
encapsulation for seek-and-read as well as for read.  Fixes the
"malformed frames when reading some K12 text files" problem for which
we're using bug 6735.

svn path=/trunk/; revision=40508
2012-01-14 20:58:41 +00:00
Guy Harris 2db032c5d5 NetMon 1.x format does *not* support per-packet encapsulation.
svn path=/trunk/; revision=40495
2012-01-14 10:31:25 +00:00
Guy Harris eb5c7d64a4 Get rid of unused WTAP_FILE_WTAP file type.
Move pcap-NG right after standard pcap in the list of file types, so
that it shows up early in the list of output file types in the "Save
As..." dialog box (if, that is, it's supported; if not, neither is pcap,
as they use the same link-layer header type values).

svn path=/trunk/; revision=40493
2012-01-14 09:12:05 +00:00
Guy Harris 37ffde4018 WTAP_ENCAP_UNKNOWN should never appear as an actual encapsulation type,
and can't be supported as an output encapsulation in any case.

svn path=/trunk/; revision=40492
2012-01-14 09:00:37 +00:00
Jörg Mayer 9781eaf0f5 Sync filelists between autofoo and cmake.
Move some dissectors that throw warnings to DIRTY_
Whitespace cleanups

svn path=/trunk/; revision=40478
2012-01-13 19:29:58 +00:00
Gerald Combs cb9725ce2b Prepend the sita_phdr fields with "sita_" to make them less
collision-prone.

svn path=/trunk/; revision=40320
2011-12-28 23:39:14 +00:00
Bill Meier 727046dc35 Tighten up format string used for date/time parse;
Use 'static' in function definitions to match function declarations;
Do minor reformatting.

svn path=/trunk/; revision=40305
2011-12-27 18:54:32 +00:00
Guy Harris 7962edcf56 The encapsulation following WTAP_ENCAP_ARCNET is
WTAP_ENCAP_ARCNET_LINUX; update various tables mapping Wiretap
encapsulations to file-type encapsulations.  Get rid of some trailing
"sorry, that's not supported" entries while we're at it.

svn path=/trunk/; revision=40274
2011-12-22 09:22:35 +00:00
Guy Harris ab910e4cff If stuff above the Wiretap library can't handle packet reported lengths
> WTAP_MAX_PACKET_SIZE, either that should be caught above the
per-file-type layer in Wiretap or should be handled by the caller.

We've recently fixed at least one problem with reported lengths > 2^31 -
1 (by clamping the length to 2^31 - 1), so let's just remove the check
from the pcap-NG reader, to squelch some complaints we're getting from
the buildbot (bug 6673 and its duplicates).

(The pcap reader uses it to cope with some of the botched libpcap
formats that changed the per-packet header without changing the magic
number; I'll look at trying to preserve those heuristics while still
allowing reported lengths > WTAP_MAX_PACKET_SIZE.)

svn path=/trunk/; revision=40207
2011-12-15 08:22:06 +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
Guy Harris 1df4ee9109 Crank up the maximum frame table size to 512*2^20 packets, that being a
small amount bigger than the maximum possible number of packets in a
NetMon file.

svn path=/trunk/; revision=40174
2011-12-13 06:45:16 +00:00
Guy Harris c3da1f23d3 Add missing checks for a too-large packet, so we don't blow up trying to
allocate a huge buffer.

svn path=/trunk/; revision=40170
2011-12-13 02:42:42 +00:00
Guy Harris dd92029afa Check for a bogus record size. Fixes bug 6670.
svn path=/trunk/; revision=40169
2011-12-13 02:00:41 +00:00
Guy Harris 89303e99c4 Add an arbitrary limit on the maximum size of the frame table, so that
we don't crash.  Fixes bug 6669.

svn path=/trunk/; revision=40168
2011-12-13 01:49:27 +00:00
Guy Harris c8182253c8 Add missing checks for a too-large packet, so we don't blow up trying to
allocate a huge buffer; fixes bug 6668.

Also add some other checks for invalid records.

svn path=/trunk/; revision=40167
2011-12-13 01:24:12 +00:00
Guy Harris 73a808f9bc Add missing check for a too-large packet, so we don't blow up trying to
allocate a huge buffer; fixes bug 6667.

svn path=/trunk/; revision=40166
2011-12-13 01:05:52 +00:00
Guy Harris b669a11931 Add missing check for a too-large packet, so we don't blow up trying to
allocate a huge buffer; fixes bug 6666.

svn path=/trunk/; revision=40165
2011-12-13 00:57:09 +00:00