Commit Graph

1677 Commits

Author SHA1 Message Date
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
Guy Harris a1fe0c746d Update some comments to reflect current reality (as in "a lot of stuff
is no longer available, but there's an IETF list of snoop datalink
types, at least").

svn path=/trunk/; revision=40080
2011-12-03 07:16:56 +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
Guy Harris 7694a8659d Fail if somebody tries to write out a packet with an unsupported
encapsulation.

svn path=/trunk/; revision=39944
2011-11-18 21:39:18 +00:00
Guy Harris 680b3d3a86 Make sure pcap-ng supports a particular encapsulation type before
trying to write out an interface description block for an interface with
that type.

svn path=/trunk/; revision=39930
2011-11-18 07:13:33 +00:00
Guy Harris 9b9bd6d27b Add checks to make sure we don't overflow the maximum 32-bit file
offset.

svn path=/trunk/; revision=39915
2011-11-17 20:17:36 +00:00
Guy Harris e4658ced93 Rename pletonll() to reflect what it actually does, namely convert a
host-byte-order 64-bit integral quantity to little-endian byte order.

svn path=/trunk/; revision=39900
2011-11-17 09:24:15 +00:00
Guy Harris 31f61b75b2 A new macro needed by the WTAP_ENCAP_PER_PACKET support for writing
NetMon files.

svn path=/trunk/; revision=39899
2011-11-17 09:04:54 +00:00
Guy Harris 9dc26776e4 Add support for writing WTAP_ENCAP_PER_PACKET files; they are written
out in version 2.1 of the file format (the minimum version to support
that).

Change some data types to avoid having file offsets that are before the
beginning of the file.

Clean up some other data types and some comments.

svn path=/trunk/; revision=39898
2011-11-17 09:03:09 +00:00
Guy Harris f3a88d4084 Return *some* error if we end up trying to seek before the beginning of
the file, so you don't get weird random errors.  EINVAL is as good as
anything.

svn path=/trunk/; revision=39896
2011-11-17 06:36:32 +00:00
Guy Harris eacdf1d46f Put back the check for dates that can be represented in DOS format the
way it was *supposed* to be done, rather than backwards.

svn path=/trunk/; revision=39895
2011-11-17 02:29:26 +00:00
Chris Maynard 6f2dc712b9 Revert part of r39883 to avoid dereferencing a NULL pointer. Thanks Clang.
svn path=/trunk/; revision=39894
2011-11-17 02:17:57 +00:00
Guy Harris 8281a7d28e Support nanosecond-resolution time for NetMon 2.x format (it's only
100-nanosecond resolution, but that's still better than microsecond
resolution).

For NetMon 1.x format, only claim to support millisecond resolution, as
that's all you get.

Fix handling of negative time deltas in NetMon 2.x format.

When writing a NetMon file, trim the time of the first packet to
millisecond precision to get the capture start time, so that the start
time written to the file (which has millisecond precision) is the same
as the start time used to calculate the deltas written to the packet
headers.

svn path=/trunk/; revision=39886
2011-11-16 17:54:44 +00:00
Guy Harris 234d0b9614 OK, this should do it.
svn path=/trunk/; revision=39885
2011-11-16 17:13:37 +00:00
Guy Harris 8be474f776 Fix build on Windows.
svn path=/trunk/; revision=39884
2011-11-16 17:12:47 +00:00
Guy Harris 163edbb507 Another place where we have to protect against MSVC's time-conversion
routines blowing up if handed a too-large time_t.

While we're at it, also check for dates that can't be represented in DOS
format (pre-1980 dates).

svn path=/trunk/; revision=39883
2011-11-16 17:08:00 +00:00
Guy Harris 5ceeb22529 Another place where we have to protect against MSVC's time-conversion
routines blowing up if handed a too-large time_t.

svn path=/trunk/; revision=39882
2011-11-16 16:48:02 +00:00
Guy Harris f5d4a4c7ba Clean up white space.
Note that we don't need to set the FCS length, but might as well do so
anyway.

svn path=/trunk/; revision=39816
2011-11-13 00:04:49 +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
Anders Broman af25c3e77b From Holger Pfrommer:
Enhancement of Hilscher Analyzer Dissector.

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

svn path=/trunk/; revision=39804
2011-11-12 18:01:38 +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
Guy Harris bc3796b7ac Updates based on stuff seen in a new capture.
I'm leaving debug messages in, but #if 0'ed out, for now.

svn path=/trunk/; revision=39736
2011-11-04 23:59:07 +00:00
Guy Harris 42c2e1c57b It appears that the "packet" records are actually "stuff from the ISDN
link" records, including stuff that's from a G.704 PRI frame but not
from a D or H channel in that frame.  Handle them (currently, we ignore
them).

The low-order bit of the flags field for "packet" records" is "network
to user" (NT->TE), not "user to network" (TE->NT).

svn path=/trunk/; revision=39663
2011-10-28 22:57:33 +00:00
Guy Harris 83aed00fac The version string field isn't followed by 20 bytes of stuff; the last 8
bytes of what we thought was a version string appears to be an 8-byte
record of some sort in the captures we originally looked at, and appears
to be a non-8-byte record in another capture.  If we treat that as a
record, the version string field appears to be null-padded and 41 bytes
long.

svn path=/trunk/; revision=39645
2011-10-28 02:48:52 +00:00
Guy Harris c0db24bf4d Fix cut-and-pasteo that happened not to cause a problem on *P64
platforms but failed on *P32 platforms.

Remove the debugging code (the above was the problem in question).

svn path=/trunk/; revision=39628
2011-10-27 03:00:03 +00:00
Guy Harris a4e597b545 Add some debugging code; the current code doesn't work when compiled
with MSVC on Win32, and the fix will remove the debugging code as well.

svn path=/trunk/; revision=39624
2011-10-26 23:41:15 +00:00
Guy Harris 05269a7178 Put the magic number into the aethra_hdr structure, to avoid compiler
padding of the structure getting in the way (it should now not require
padding).

svn path=/trunk/; revision=39619
2011-10-26 20:53:27 +00:00
Guy Harris d7515bff87 Add the code to read Aethra files.
svn path=/trunk/; revision=39592
2011-10-26 04:31:06 +00:00
Guy Harris b4415758bf Ok, we found what appears to be the capture start time. Use it.
Also mark what appear to be strings in the file header.

svn path=/trunk/; revision=39591
2011-10-26 04:05:17 +00:00
Guy Harris 12e95e2cda It appears that the octet in the record header after the record length
might be a record type, with 0 being a "Stop Monitor" record and 1 being
a packet.  Ignore records other than packet records.

svn path=/trunk/; revision=39590
2011-10-26 03:14:21 +00:00
Guy Harris 72a96fc6a6 Avoid warnings.
svn path=/trunk/; revision=39589
2011-10-26 02:37:45 +00:00
Guy Harris e9ae3a0fd6 Initial support for .aps files from Aethra Telecommunications' PC108
software.  More work is needed:

	we don't know where the capture start time is yet;

	we aren't handling the "stop capture" record;

	we don't know where the ISDN channel is;

	there might be non-ISDN file formats;

but this at least is easier than trying to text2pcap hex dumps from that
software into pcap files.

svn path=/trunk/; revision=39588
2011-10-26 02:18:55 +00:00
Gerald Combs 666b58d408 From Huzaifa Sidhpurwala of Red Hat Security Response Team:
I found a heap-based buffer overflow, when parsing ERF file format.
The overflow seems to be controlled by the values read from the file, 
and hence seems exploitable to me.

svn path=/trunk/; revision=39508
2011-10-21 19:07:42 +00:00
Stig Bjørlykke 967b9086aa Removed newencap as it's unused.
svn path=/trunk/; revision=39419
2011-10-14 08:22:16 +00:00
Anders Broman 62ba07a8fc From Tobias Witek:
This patch extends the ATM parser so as to allow GPRS NS traffic encapsulated
in ATM AAL5.

Additionally, added support for this into the 'Meta' dissector.

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

svn path=/trunk/; revision=39394
2011-10-12 18:57:50 +00:00
Bill Meier 59e64cff77 From Robert Bullen: Fix for: Two minor bugs in Wiretap library:
First bug: The Network Instruments Observer file format abbreviation is
incorrect. It is "niobserverv" instead of "niobserver", which is probably a
vestige from 1.4 when the abbreviation was "niobserverv9".

Second bug: The packet header magic number field is correctly swapped the first
time when reading the entire packet header. It is incorrectly swapped yet again
when reporting an invalid value. Both swaps use GUINT_FROM_LE, which is a no-op
on little-endian platforms. But the error message that is displayed to users of
big-endian platforms will contain a byte-reversed value.

svn path=/trunk/; revision=39392
2011-10-12 18:04:58 +00:00
Anders Broman 6a847b1f30 From Andrew Kampjes:
Allows the saving of packets with snapped length to ERF. Prevents the adding of
automatic CRC and rounds down to the nearest 8 bytes instead of up, adding
zeros.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6409

svn path=/trunk/; revision=39247
2011-10-04 05:27:14 +00:00
Bill Meier 781129806f Fix ex "modeline" so it works;
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748

svn path=/trunk/; revision=39081
2011-09-21 17:49:11 +00:00
Martin Mathieson c5cfc416a1 Skip extra info if present (IP with LTE PDCP threading info).
svn path=/trunk/; revision=38983
2011-09-13 12:14:24 +00:00
Guy Harris d7af4e2037 Don't synthesize a CRC if the packet already has one.
svn path=/trunk/; revision=38905
2011-09-06 23:36:18 +00:00