Commit Graph

26 Commits

Author SHA1 Message Date
Guy Harris e63a3f5d81 Don't use <wtap.h> to refer to the main libwiretap header file.
Either use "wtap.h", if it's only for files in the wiretap directory, or
<wiretap/wtap.h>, if it's also a header that stuff outside libwiretap
can include.

Change-Id: If1c71b3dae9a3c0d64661ae1734f925319e447d1
Reviewed-on: https://code.wireshark.org/review/14788
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-03 14:29:25 +00:00
Guy Harris 5947291294 Fix declared types of open routines.
Change-Id: Ifa38dfec31ec5b03f00d6e077902184a9ae2ee0e
Reviewed-on: https://code.wireshark.org/review/4583
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-10 01:04:43 +00:00
Guy Harris a1b1c8bed5 Revert "Refactor Wiretap"
This reverts commit 1abeb277f5.

This isn't building, and looks as if it requires significant work to fix.

Change-Id: I622b1bb243e353e874883a302ab419532b7601f2
Reviewed-on: https://code.wireshark.org/review/1568
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09 05:21:01 +00:00
Michael Mann 1abeb277f5 Refactor Wiretap
Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality.

The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes.

bug:9607
Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae
Reviewed-on: https://code.wireshark.org/review/1485
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-09 03:04:39 +00:00
Evan Huus e6a45008d3 One more fix from g2965913
Change-Id: I68d5bd33a44783c42a75e8244ef53c73a4f484f9
Reviewed-on: https://code.wireshark.org/review/503
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-04 17:21:42 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Bill Meier 5a0809c718 (Trivial) whitespace cleanup (mostly trailing whitespace).
svn path=/trunk/; revision=53172
2013-11-08 17:17:57 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Balint Reczey aa659985a5 Export libwiretap symbols using WS_DLL_PUBLIC define
TODO: hide flex-generated functions

svn path=/trunk/; revision=47948
2013-02-28 19:35:59 +00:00
Anders Broman 14ba8d892e From Network Instruments by Tom Brezinski When a Network Instruments wireless capture is decrypted a flag is set on the packet in the BFR file indicating that the packet is decrypted instead of modifying the protected flag in the frame control flags of the packet header. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7478
svn path=/trunk/; revision=43727
2012-07-15 16:37:25 +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
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
Guy Harris 9ca4193385 Line up #define values.
svn path=/trunk/; revision=40576
2012-01-18 22:05:47 +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
Balint Reczey 311f9acfd5 Fix wiretap headers to allow error-free ABI dumping.
svn path=/trunk/; revision=37543
2011-06-04 21:20:57 +00:00
Guy Harris c0dc916adc From Tom Brezinski - fix for bug 5869:
This patch incorporates the following fixes from the patch attached to
bug 5671 with changes as noted below:

1.) Files where the packet header and packet data are noncontiguous are
handled improperly, resulting in read misalignment and ultimately the
error message, "Observer: bad record: Invalid magic number 0xXXXXXXXX."
This bug is caused by not obeying the packet_entry_header.offset_to_frame
field.

2.) Daylight savings time is not properly accounted for in files using
local time encoding.

3.) As of Observer/GigaStor v13.10 (bug 5671 incorrectly stated v14),
timestamps in the file format changed from local time encoding to GMT
encoding.  Wiretap has been changed to support reading both formats. 
Patch submitted with bug 5671 added a separate file type to allow
writing local format.  This patch does not add the separate file type
and always writes GMT.

4.) The wtap_dumper.bytes_dumped field is not being properly incremented
as data is written to files.

This patch also incorporates the following additional enhancements /
fixes not in bug 5671:

1.) Support for reading BFR files which contain Fibre Channel captures. 
Test file Fibre_Channel_Capture.bfr attached.

2.) Support for modified file header used in upcoming v15.  New header
file format takes an unused byte from the version string to allow for a
larger offset to the first packet to be specified.  Test file
V15_Lrg_Hdr_Test.bfr is attached, it is also a fuzz test as the number
of TLV items given in the header is less then the actual.

3.) It was found that if the number of TLV items given in the header was
larger then present it would fail to open the file.  Test file
V9_Num_TLVs_Too_Big.bfr is attached.

svn path=/trunk/; revision=36970
2011-05-03 05:26:10 +00:00
Guy Harris 2b8ebd389b "This file format can't be written to a pipe" and "this file format
can't be saved in compress form" are both equivalent to "this file file
format requires seeking when writing it".  Change the "can compress"
Boolean in the file format table to "writing requires seeking", give all
the entries the proper value, and do the checks for attempting to write
a file format to a pipe or write it in compressed format to common code.

This means we don't need to pass the "can't seek" flag to the dump open
routines.

svn path=/trunk/; revision=36575
2011-04-12 00:44:44 +00:00
Guy Harris 87077ede81 The first item in the network load EIP appears to be the network
utilization, in units of .1%.

svn path=/trunk/; revision=17901
2006-04-19 03:42:06 +00:00
Guy Harris 749faec6a3 Move file format definitions to the header file.
Put the code to read the packet header and the packet data into routines
(which also fixes some places where observer_seek_read() was using the
sequential file handle rather than the random file handle), make the
packet header reader skip over the TLVs,

Do some additional sanity checking.

Wiretap supports nanosecond resolution; provide nanosecond resolution
time stamps.

Rename some structure members to match their purpose (they're TLV
counts, not flags).

Remove the TLV header from the TLV structures (and eliminate TLV
structures if we don't have the contents or they're just a string); if
we process them, we'll probably end up reading the header and data
separately.

Add some information about some of the TLVs in expert information packets.

svn path=/trunk/; revision=17870
2006-04-16 00:52:36 +00:00
Guy Harris 44aa78fe5e Skip non-data records. Fixes bug 767.
svn path=/trunk/; revision=17861
2006-04-14 10:22:29 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Guy Harris d6cd61061e Have the Wiretap open, read, and seek-and-read routines return, in
addition to an error code, an error info string, for
WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and
WTAP_ERR_BAD_RECORD errors.  Replace the error messages logged with
"g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed
strings returned as the error info string, and change the callers of
those routines to, for those errors, put the info string into the
printed message or alert box for the error.

Add messages for cases where those errors were returned without printing
an additional message.

Nobody uses the error code from "cf_read()" - "cf_read()" puts up the
alert box itself for failures; get rid of the error code, so it just
returns a success/failure indication.

Rename "file_read_error_message()" to "cf_read_error_message()", as it
handles read errors from Wiretap, and have it take an error info string
as an argument.  (That handles a lot of the work of putting the info
string into the error message.)

Make some variables in "ascend-grammar.y" static.

Check the return value of "erf_read_header()" in "erf_seek_read()".

Get rid of an unused #define in "i4btrace.c".

svn path=/trunk/; revision=9852
2004-01-25 21:55:17 +00:00
Guy Harris 0543fbd427 From Scott Emberley: support for writing Network Instruments Observer
files.

svn path=/trunk/; revision=8900
2003-11-06 22:45:28 +00:00
Guy Harris 1cfad682cb The time in Observer files is in nanoseconds since midnight, January 1,
2000, 00:00:00 *local* time.  The amount to add to that is just the UNIX
time stamp value for that point in time; get it with "mktime()".

svn path=/trunk/; revision=8854
2003-11-01 03:38:10 +00:00
Guy Harris 1131dafe62 Temporarily get rid of the "struct tm" in "struct observer_time", and
get rid of the reference to its "tm_gmtoff" member - there are platforms
on which Ethereal runs that don't have "tm_gmtoff" in "struct tm".  If
the time stamp in the packets is nanoseconds since midnight 2001-01-01
*local* time, we'd need to compute the offset between that and midnight
2000-01-01 GMT, and adjust the time with that.

svn path=/trunk/; revision=8842
2003-10-31 08:06:25 +00:00
Guy Harris 0247fbeb15 From Scott Emberley: support for reading Network Instruments version 9
capture files.

svn path=/trunk/; revision=8840
2003-10-31 00:43:21 +00:00