Commit Graph

29 Commits

Author SHA1 Message Date
Guy Harris 4c93827e34 From Jakub Zawadzki:
file_read(buf, bsize, count, file) macro is compilant with fread
function and takes elements count+ size of each element, however to make
it compilant with gzread() it always returns number of bytes.

In wiretap file_read() this is not really used, file_read is called
either with bsize set to 1 or count to 1.

Attached patch remove bsize argument from macro.

svn path=/trunk/; revision=36491
2011-04-06 06:51:19 +00:00
Gerald Combs 8af7080001 Fix errors found by the Visual C++ analyzer.
svn path=/trunk/; revision=35954
2011-02-16 00:44:12 +00:00
Guy Harris 17392a865a Move the definitions of all the private data structures out of
wtap-int.h, and change the unions of pointers to those private data
structures into just void *'s.

Have the generic wtap close routine free up the private data, rather
than the type-specific close routine, just as the wtap_dumper close
routine does for its private data.  Get rid of close routines that don't
do anything any more.

svn path=/trunk/; revision=32015
2010-02-26 07:59:54 +00:00
Guy Harris 756bf60020 Move the definition of the private data structure from wtap-int.h to the
iSeries capture processor.  Parse the start date into year/month/day at
the time we see it, rather than for every packet; that means we don't
need to allocate a buffer to hold the date as a string (a buffer which
we weren't ever freeing).

svn path=/trunk/; revision=31981
2010-02-24 08:39:19 +00:00
Stig Bjørlykke de88ead3bc Fixed data type for asciibuf.
svn path=/trunk/; revision=30608
2009-10-18 21:29:17 +00:00
Gerald Combs cc739fecb0 P64 fixes.
svn path=/trunk/; revision=27683
2009-03-09 21:18:55 +00:00
Stig Bjørlykke 80b62e6728 Fixed a datatype to avoid a warning.
svn path=/trunk/; revision=26479
2008-10-16 13:36:37 +00:00
Guy Harris 9d1b5335ac g_ascii_strdown() and g_ascii_strup(), unlike g_strdown() and g_strup(),
do *not* modify the string handed to them - they g_mallocate a new
string and return it.

Create routines that *do* ASCII-only case mapping in place, and use them
instead.

Clean up indentation.

svn path=/trunk/; revision=26131
2008-09-03 19:14:52 +00:00
Guy Harris 9ab8f5a907 Have iseries_parse_hex_string() take a "const char *" as its first
argument, as

	1) it doesn't modify the string that argument points to

and

	2) it's a buffer of "char".

Use g_ascii_xdigit_value() and put the values of the two bytes together
ourselves; strtoul() is a bit of overkill for two-hex-digit pairs. 
While we're at it, check for invalid hex digits, and for bytes where
only one hex digit is present.

svn path=/trunk/; revision=25392
2008-05-29 23:30:51 +00:00
Jeff Morriss 3251c05742 Always set pkt_encap, not just when we have the start date. This bug, around
since rev 17756, meant that attempts to read iSeries files would fail in the
"Make sure it [pkt_encap] is not WTAP_ENCAP_PER_PACKET" assertion in
wtap_read().

Also set file_encap to WTAP_ENCAP_ETHERNET (instead of WTAP_ENCAP_PER_PACKET)
since it seems that all the packets in iSeries files are Ethernet (or at least
this module currently only supports Ethernet).

svn path=/trunk/; revision=25388
2008-05-28 15:01:16 +00:00
Martin Mathieson 7e40100fb3 From Anders: Checkapi enabled for wiretap and more functions converted.
svn path=/trunk/; revision=25257
2008-05-08 09:37:11 +00:00
Anders Broman 6d91aae2e1 strncpy -> g_strlcpy
svn path=/trunk/; revision=25254
2008-05-08 05:16:33 +00:00
Bill Meier bad9f18d33 Fix (Sun) compiler warnings as reported by David Kirkby: Part 1
svn path=/trunk/; revision=24295
2008-02-09 23:35:28 +00:00
Stig Bjørlykke d5d2e97b47 Fixed some more malloc -> g_malloc, free -> g_free, strdup -> g_strdup.
svn path=/trunk/; revision=24180
2008-01-24 19:30:43 +00:00
Stephen Fisher 721e353447 Fix bug #1926: buffer overflow when parsing iseries files
svn path=/trunk/; revision=23232
2007-10-19 22:40:42 +00:00
Sake Blok 0e4ae39920 From Martin Warnes:
Attached is a small patch that correct an issue with reading certain IBM
iSeries Comms traces.

Traces where data has been dropped for whatever reason now have the
packet number suffixed with an asterix "*", this causes the current
iSeries wiretap routine to report a "bad" header. The attached patch
simply scans the packet number field and removes any "* characters prior
to scanning, the fact that data may be missing is more than adequately
reported later by current wireshark packet processing.

Regards .. Martin


svn path=/trunk/; revision=23000
2007-09-27 18:36:17 +00:00
Guy Harris 3b120c2491 Match "%4x" with an unsigned value in sscanf.
Check for a case where, conceivably, the on-the-wire packet length (from
the IP header) could be shorter than the captured data length (due to
Ethernet padding), and handle it by making sure the on-the-wire length
is always >= the captured data length.

svn path=/trunk/; revision=21490
2007-04-21 22:59:52 +00:00
Jaap Keuter c150904c6a Fix for bug 1526. Compare to uppercased strings.
svn path=/trunk/; revision=21361
2007-04-10 05:38:57 +00:00
Stephen Fisher 8fd3ee0560 Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it.


svn path=/trunk/; revision=21253
2007-03-28 21:55:11 +00:00
Stephen Fisher 2896811274 Fix about 150 warnings new to gcc 4.0 in the error on warning directories.
Comment out -Werror in plugins/asn1/ until warnings can be fixed.


svn path=/trunk/; revision=21158
2007-03-23 22:49:23 +00:00
Gerald Combs b7d30175c0 Fix a couple of off-by-one overflows reported in bug 1415. Update the
release notes accordingly.

svn path=/trunk/; revision=20990
2007-03-07 01:17:24 +00:00
Ulf Lamping 59d6c8ea33 change all file offsets from long to gint64 so we can - theoretically - handle files > 2GB correct.
Please distclean Win32 builds!

svn path=/trunk/; revision=19814
2006-11-05 22:46:44 +00:00
Anders Broman ca8bc2b83a From Martin Warnes:
The patch addresses issues with higher precision packet
timings on top end iSeries hardware and should enable the iseries wiretap to handle timings in both micro and nano seconds.

svn path=/trunk/; revision=19428
2006-10-04 17:36:40 +00:00
Jaap Keuter 9daa63d451 The header will be there, just make sure the date is put in.
Coverity bug 148

svn path=/trunk/; revision=17756
2006-03-29 16:06:57 +00:00
Anders Broman 2502e30bc1 From Martin Warnes:
> I've attached a fix that cleans up this code, actually since my last 
> update of this module the particular call in question was fairly 
> redundant so I just went ahead and removed it and updated the constant 
> that specifies the maximum possible line length instead.
>
> Thanks for bring this to my attention.

svn path=/trunk/; revision=17737
2006-03-27 18:24:26 +00:00
Gerald Combs 480818a431 Fix a possible NULL dereference (bug 827 / CID 145). Add an SVN
ID.  Fix up whitespace.

svn path=/trunk/; revision=17732
2006-03-27 16:09:47 +00:00
Anders Broman 70a045d772 From Mertin Wrnes:
Following my last submitted patch I did some further investigation on the different types of iSeries  Comms Traces, although the field formats are constant, things such as page throws and line spacing vary depending on the tool used to pull the trace form the iSeries spool.

This patch should better handle the different formats and more importantly exit in a graceful manner if an unknown format is encountered.


svn path=/trunk/; revision=17699
2006-03-22 17:37:04 +00:00
Jaap Keuter a346237ffd From Martin Warnes:
Attached is a fix that addresses a problem reading certain IBM iSeries
Communications traces.


svn path=/trunk/; revision=17655
2006-03-17 06:59:27 +00:00
Anders Broman 00728fb587 From Martin Warnes:
Add Support for reading of IBM iSeries (AS/400) Comms traces

svn path=/trunk/; revision=16588
2005-11-25 20:30:42 +00:00