Commit Graph

1643 Commits

Author SHA1 Message Date
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
Stig Bjørlykke 415533faaf Check return value from wtap_dump_file_write.
This fixes CID 1272.

svn path=/trunk/; revision=38876
2011-09-03 20:47:58 +00:00
Guy Harris 6ac265b512 Merge pcap_fill_in_pseudo_header() into pcap_read_post_process().
svn path=/trunk/; revision=38844
2011-09-01 19:58:25 +00:00
Guy Harris e9fc1b72aa Use guint8 rather than guchar for raw octets and pointers to arrays of
same.

Add to wiretap/pcap-common.c a routine to fill in the pseudo-header for
ATM (by looking at the VPI, VCI, and packet data, and guessing) and
Ethernet (setting the FCS length appropriately).  Use it for both pcap
and pcap-ng files.

svn path=/trunk/; revision=38840
2011-09-01 09:43:10 +00:00
Guy Harris f16a746c63 Set eth.fcs_len in the pseudo-header for Ethernet packets.
Set the pseudo-header when doing the sequential read as well as when
doing random reads.

When writing packets to a CommView file, use a slightly less contorted
way to get the year/month/day/hour/minute/second values.

commview_dump() uses the pseudo_header argument; don't mark it as
unused.

svn path=/trunk/; revision=38833
2011-09-01 04:14:54 +00:00
Guy Harris 30ec5387fa Not ideal, but OK for now - alignbytes, at that point, is < 8, so we
know it'll fit in a gint16.  (alignbytes really shouldn't need to be 64
bits, as if we have 2^63-1 bytes of alignment, We Have A Problem; fixing
that may involve calculating it differently earlier in that routine.)

svn path=/trunk/; revision=38828
2011-08-31 22:22:40 +00:00
Stig Bjørlykke ff32408b0a Try using gint64 for alignbytes.
svn path=/trunk/; revision=38827
2011-08-31 21:16:18 +00:00
Stig Bjørlykke 141a830b9f From Andrew Kampjes via bug 6260:
Added support for saving ERF files.

From me:
Use crc routines from libwsutil.

svn path=/trunk/; revision=38826
2011-08-31 20:50:15 +00:00
Guy Harris 9756ac2904 Handle multiple extension headers when calculating the pseudo-header
length, and actually write out the extension headers when writing out
the pseudo-header.

Fixes bug 6265.

svn path=/trunk/; revision=38792
2011-08-30 08:09:40 +00:00
Guy Harris 4486bb9d85 A zero snaplen means "snaplen unknown", as in "the file format from
which we read the data to be written doesn't record the snapshot
length".  A snapshot length of 0 in a pcap or pcap-ng file is not
handled well by many programs reading those files; for pcap files, we
write out WTAP_MAX_PACKET_SIZE as the snapshot length in that case, so
do so for pcap-ng files as well.

svn path=/trunk/; revision=38790
2011-08-30 06:01:44 +00:00
Jeff Morriss 339136d1d0 Based on patch from Denis Ovsienko via
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6244 :

Fix typo: s/unkown/unknown/

svn path=/trunk/; revision=38561
2011-08-16 13:16:33 +00:00
Jeff Morriss 613ddfa1cc From Hanspeter via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6229 :
If an EnhancedPacketBlock in a pcapng file contains a comment option the
content isn't displayed. Instead "Malformed packet" is displayed with the
reason Exception occurred.

The reason for the problem is a bug in the pcapng.c, where for enhanced packet
blocks, interface description blocks and interface statistics blocks the wrong
union members are used to set the comment. This way required fields in the
structures are overwritten.

The attached patch solves the problem.

svn path=/trunk/; revision=38491
2011-08-11 21:42:37 +00:00
Martin Mathieson fe28dc854a Speed up (slightly) reading of long text lines.
svn path=/trunk/; revision=37989
2011-07-12 10:49:22 +00:00
Guy Harris 4c4b8f8891 Move the definitions of LANalyzer records to lanalyzer.c.
Use LA_RecordHeaderSize rather than sizeof, to squelch some compiler
complaints.

svn path=/trunk/; revision=37956
2011-07-10 22:57:59 +00:00
Guy Harris 5e5b778a67 Define a structure for the record header, and read into that, and then
extract values from it.

svn path=/trunk/; revision=37954
2011-07-10 22:10:07 +00:00
Guy Harris 41d53a1635 At that point in the code, bytes_read isn't the total number of record
header bytes read, as we're reading the two header fields separately and
checking the byte count for each read.  We *do*, however, know that the
record header is 4 bytes long, so we can just seek back 4 bytes.

svn path=/trunk/; revision=37953
2011-07-10 21:05:19 +00:00
Martin Mathieson ece553d8d0 Change the way we scan past characters before the direction indicator.
svn path=/trunk/; revision=37940
2011-07-08 16:08:32 +00:00
Guy Harris e02cd7707d Explain a bit more what this does.
svn path=/trunk/; revision=37884
2011-07-04 01:39:13 +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
Gerald Combs 8d88f3a790 Make pcap-ng the default. Add a compile-time option to prefer pcap-ng or
pcap.  Add a "-P" capture option which tries to use pcap instead of
pcap-ng ("-P" seemed to be the best option but we may want to use a
different letter).

Update the documentation and release notes.

svn path=/trunk/; revision=37696
2011-06-17 17:52:31 +00:00
Alexis La Goutte 3384fdecc4 From Kevin Kayes via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6026
Enhance Snoop file reader to include 10Gbit datalink value

svn path=/trunk/; revision=37683
2011-06-16 08:04:31 +00:00
Guy Harris a8c363bd54 Try to squelch some compiler warnings.
svn path=/trunk/; revision=37673
2011-06-15 19:48:27 +00:00
Guy Harris 7758cd97f4 Squelch some compiler warnings.
svn path=/trunk/; revision=37672
2011-06-15 19:36:43 +00:00
Guy Harris 128216dfbe Strings are not writable, and the compiler warns that assigning a
pointer to a string to a non-const pointer discards qualifiers; make the
err_info member of the wtap_reader structure a const pointer.

svn path=/trunk/; revision=37671
2011-06-15 19:34:54 +00:00
Jakub Zawadzki c54afc05e7 Fix capinfo: ** ERROR **: Unknown capture file type 61
svn path=/trunk/; revision=37643
2011-06-10 07:16:10 +00:00
Guy Harris 06256dfe5b The only place where we care about zlib is file_wrappers.c; include
<zlib.h> there, rather than wtap-int.h.  That obviates the need to
include config.h earlier in ascend_scanner.l; revert the previous
change, so we don't require a version of Flex that supports %top.

svn path=/trunk/; revision=37640
2011-06-09 22:46:00 +00:00
Jakub Zawadzki 110f2c4ef7 Fix possible compilation errors.
svn path=/trunk/; revision=37638
2011-06-09 22:01:57 +00:00
Jakub Zawadzki 178def67b7 - Add something to columns when using mime-encap
- Replace decoders in wiretap/CMakeLists.txt

svn path=/trunk/; revision=37637
2011-06-09 21:37:19 +00:00
Jakub Zawadzki a723874490 - Replace jpeg_jfif decoder, with more generic mime_file (no more 64KB limit!).
- Add new dissector packet-mime-encap which understands mime_file fragmentation.

svn path=/trunk/; revision=37636
2011-06-09 21:21:06 +00:00
Gerald Combs a47485acd9 Move the copyright notice and the config.h include to the top of the
file so that we have the proper definitions in place for large file
support on Solaris (bug 6102).

svn path=/trunk/; revision=37635
2011-06-09 21:13:40 +00:00
Gerald Combs 04f147f4fa Make sure we don't write invalid record lengths.
svn path=/trunk/; revision=37634
2011-06-09 18:31:39 +00:00
Gerald Combs 2eff7bab66 Limit the lengths of some of our patterns. Fixes an infinite loop found
when trying to read a TPNCP data file.

svn path=/trunk/; revision=37625
2011-06-08 20:58:44 +00:00
Bill Meier 2841028cf2 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warning.
svn path=/trunk/; revision=37604
2011-06-07 23:05:53 +00:00
Anders Broman 1932ff6734 Add more missing files.
svn path=/trunk/; revision=37593
2011-06-07 15:05:45 +00:00
Gerald Combs 349273944d Add links to libtool's recommendations for library versions.
svn path=/trunk/; revision=37582
2011-06-06 21:40:40 +00:00