Commit Graph

255 Commits

Author SHA1 Message Date
Guy Harris c0c480d08c Allow wtap_read() and wtap_seek_read() to return non-packet records.
This is the first step towards implementing the mechanisms requestd in
bug 8590; currently, we don't return any records other than packet
records from libwiretap, and just ignore non-packet records in the rest
of Wireshark, but this at least gets the ball rolling.

Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574
Reviewed-on: https://code.wireshark.org/review/1736
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 03:02:32 +00:00
Peter Wu 3aee917058 wiretap: remove unused code, drop number_of_interfaces
While investigating an ASAN issue (fixed in
commit dcdd076ab0), I got greatly confused
by three different types having the same "interface_data" field name:

 * pcapng_t *pn stores an array of interface_data_t objects.
 * wtap *wth stores an array of wtapng_if_descr_t objects.
 * pcapng_dump_t should store an array of interface_data_t objects.

pcapng_dump_t and friends are unused since
commit c7f1a431d2, so drop it.

To fix the confusion, rename the interface_data_t type to
interface_info_t type and use the local variable "iface_info"
everywhere. Rename interface_data of pcapng_t to "interfaces" and
add a comment what this exactly means (interfaces listed in the capture
file).

Drop the number_of_interfaces field for interfaces as the array
length is already available from GArray. Now interface_data is always
initialized for wth (which also gets copied to idb).

s/int/guint/g and replace cast at some places.

There are no regressions for the in-tree test suite.

Change-Id: I2d5985c9f1e43f8230dbb4a73bd1e243c4858170
Reviewed-on: https://code.wireshark.org/review/1656
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-17 12:41:50 +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
Philip Rosenberg-Watt cd68b4744c Add dissector for LINKTYPE_EPON
See IEEE Standard 802.3-2012 Section 5, Clause 65 and CableLabs DPoE
Security and Certificate Specification 1.0, Section 6.

Currently dissects 1G mode. 10G mode will be added when hardware is
available.

Change-Id: I6232af9bf6807644ef66a120d97e5fa5927988fe
Reviewed-on: https://code.wireshark.org/review/1284
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-28 15:26:32 +00:00
Guy Harris 6d6094e349 Don't fail if a pcap-NG PB or EPB has caplen > actual len.
We don't fail for other file types; there's no point in failing for
pcap-NG.  wtap_read() will ensure that caplen <= len.

Make wtap_seek_read() ensure that caplen <= len as well.

Fixes bug 10037.

Change-Id: I41fbcf54341ea0429cef875442ea1f1377177a5f
Reviewed-on: https://code.wireshark.org/review/1353
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 17:44:47 +00:00
Michal Labedzki 5d51a8dc08 Fix wtap displayable names
Also fix indentions.

Change-Id: I5440859aaf3ec1dbf416d9da6c1dab71bec803d8
Reviewed-on: https://code.wireshark.org/review/1094
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-14 06:27:34 +00:00
Guy Harris fc48f57214 Add a dissector for Apple's PKTAP headers.
It automatically works for LINKTYPE_PKTAP and, by default, for
LINKTYPE_USER2; if any other dissector is specified for LINKTYPE_USER2,
that dissector overrides PKTAP.

Change-Id: Ic00ac8a81c6101e45d638d337aef42df3920da12
Reviewed-on: https://code.wireshark.org/review/903
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-01 17:03:29 +00:00
Guy Harris dc4c26cbb8 Update encap_table_base.
As the comment after the WTAP_ENCAP_ list says, "After adding new item
here, please also add new item to encap_table_base array".

Change-Id: I918603fa271978b3a81525466c5f4067efc7a783
Reviewed-on: https://code.wireshark.org/review/897
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-01 05:59:30 +00:00
Anders Broman 0513b29b8b Revert "Allow pcapng interface options to be available to dissectors."
This patch causes Wireshark/tshark to segfault if the file is reread(open a file and press reload).
The test suite also fails on 
2.1.1 Step: Exit status for existing file: "/home/wireshark/builders/trunk/sol10sparc/build/test/captures/dhcp.pcap" must be 0/home/wireshark/builders/trunk/sol10sparc/build/test/suite-clopts.sh: line 149:  6646 Segmentation Fault      (core dumped) $TSHARK -r "${CAPTURE_DIR}dhcp.pcap" > ./testout.txt 2>&1

OSX build bot chokes on
pcapng.c: In function 'pcapng_destroy_option_value':
pcapng.c:377: warning: implicit declaration of function 'g_byte_array_unref'
pcapng.c:379: warning: implicit declaration of function 'g_array_unref'
pcapng.c: In function 'pcapng_collect_block_option':
pcapng.c:419: warning: implicit declaration of function 'g_byte_array_new_take'
pcapng.c:419: warning: initialization makes pointer from integer without a cast

these functions are glib 2.22
This reverts commit 7b13a3b0f6.

Change-Id: Ia82fdb2d08287bc2cd2841e1e941ae68cbc2e009
Reviewed-on: https://code.wireshark.org/review/749
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-20 12:25:21 +00:00
Christopher Kilgour 7b13a3b0f6 Allow pcapng interface options to be available to dissectors.
Interface options[1], and more generally pcapng options[2], are useful
information that can provide improved dissector output.

Prior to this change, only certain pcapng interface options were interpreted
and made available to dissectors, e.g. the interface name or description.
This change augments the situation by providing epan_get_interface_option( ),
which returns an array of byte arrays if the option code exists
(otherwise NULL).  Each element of the array is a byte buffer containing
the raw data of the option.  An array-of-buffers is used because pcapng
allows for multiple instances of the same option to be present in the file.
All interface options found in a pcapng file are thus made available to the
dissector.

The implementation also provides infrastructure to collect options from
other pcapng blocks such as the section header.  Currently these options
are discarded, but could be retained in the future to support more features.

[1] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionidb
[2] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionopt

Change-Id: I944b6f0f03dde9b8e7d1348b76acde6f9d312f37
Reviewed-on: https://code.wireshark.org/review/331
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-20 09:54:01 +00:00
Guy Harris 4342323c08 Support to version 3.0 of netscaler packet wire format.
From shekhar.chandra@citrix.com.  See bug 9280.

Change-Id: If3abbc653bb1f127b151976d4183af4c4f1e71eb
Reviewed-on: https://code.wireshark.org/review/658
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-16 03:04:13 +00:00
Christopher Kilgour ef94a80bfa Introduces two new Bluetooth DLTs for RF-based captures.
Adds support for BLUETOOTH_LE_LL_WITH_PHDR, dissector integrates with existing
BTLE dissector.

Fixes BTLE dissector to correctly extract packet CRC.

Adds CRC checking to BTLE dissector.

Provides optional context to BTLE dissector that allows RF captures to provide
link-layer hints for dissection details.  Significantly, parameters for
determining CRC correctness are provided, as well as Access Address validity
information.

Change-Id: I7d4936b053353a7f9c524021c01f67f5828253fb
Reviewed-on: https://code.wireshark.org/review/310
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-07 05:20:17 +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 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Guy Harris 90d7c5f59b Don't write out packets that have a "captured length" bigger than we're
willing to read or that's bigger than will fit in the file format;
instead, report an error.

For the "I can't write a packet of that type in that file type" error,
report the file type in question.

svn path=/trunk/; revision=54882
2014-01-22 00:26:36 +00:00
Michael Mann c071a1c728 Bluetooth/Ubertooth improvements. Bug 9606 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9606)
From Michal Labedski

1. add support for new btsnoop "format" introduced by BlueZ team in "btmon" tool
2. Bluetooth: Make EIR, AD and COD more generic
3. Bluetooth: HCI/LL: Update Error Codes to Core 4.1  Specification
4. Ubertooth: Fix response command handling
5. Ubertooth: Update to support firmware version
6. Ubertooth: Dissect by Vendor Id/Product Id

svn path=/trunk/; revision=54699
2014-01-12 00:50:41 +00:00
Guy Harris 9d41c658fe No seek-read routines use the length argument, so eliminate it from
wtap_seek_read().

svn path=/trunk/; revision=54570
2014-01-02 20:47:21 +00:00
Guy Harris 9628624867 Get rid of trailing periods in some error messages for consistency; the
others don't have trailing periods, and the caller adds a period as
desired.

svn path=/trunk/; revision=54199
2013-12-17 21:51:45 +00:00
Jakub Zawadzki 4904620661 Add WTAP_ENCAP_NETLINK which maps to DLT_NETLINK /253/
svn path=/trunk/; revision=53834
2013-12-07 23:25:36 +00:00
Guy Harris 203ecca6da Space between STANAG and the standard number.
svn path=/trunk/; revision=53739
2013-12-02 23:09:08 +00:00
Jakub Zawadzki a4c78939b2 Fix encap_table_base[] array.
svn path=/trunk/; revision=53738
2013-12-02 22:38:00 +00:00
Guy Harris 0cc1545d05 Move most of the plugin code from epan to wsutil and remove all
knowledge of particular types of plugins.  Instead, let particular types
of plugins register with the common plugin code, giving a name and a
routine to recognize that type of plugin.

In particular applications, only process the relevant plugin types.

Add a Makefile.common to the codecs directory.

svn path=/trunk/; revision=53710
2013-12-02 08:30:29 +00:00
Michael Mann 6d3d1556dc STANAG 5066 DTS Layer dissector. Bug 9217 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9217)
From İbrahim Can Yüce

From me: Update to new tcp_dissect_pdus format, minor whitespace issues noticed in wiretap files.

svn path=/trunk/; revision=53669
2013-11-30 01:18:22 +00:00
Bill Meier 5a0809c718 (Trivial) whitespace cleanup (mostly trailing whitespace).
svn path=/trunk/; revision=53172
2013-11-08 17:17:57 +00:00
Guy Harris 853da2eb9b The "file types" we have are actually combinations of types and
subtypes, e.g. Network Monitor version 1 and Network Monitor version 2
are separate "file types", even though they both come from Network
Monitor.

Rename various functions, #defines, and variables appropriately.

svn path=/trunk/; revision=53166
2013-11-08 09:53:01 +00:00
Bill Meier 6697d30b72 Revert SVN #52914;
OSX-10.6-x64 buildbot still givs an error
(At least we now know which line of code gives the error).

svn path=/trunk/; revision=52915
2013-10-28 04:07:52 +00:00
Bill Meier 2c3ec284db From Shekhar Chandra: support for version 3.0 of netscaler packet wire format.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9280

(Revised patch: let's see if this version compiles w/o error
                on all the buildbots)


svn path=/trunk/; revision=52914
2013-10-28 03:16:31 +00:00
Bill Meier 2197f291e5 Revert SVN #52665.
Compilation fails on (only the ?) OSX-10.6-x64 buildbot with error:

netscaler.c: In function 'nstrace_read_v30':
netscaler.c:1295: warning: implicit conversion shortens 64-bit value into a 32-bit value

(Life is too short for me to dig multiple levels deep into a set of macros to try to see which
 actual line of code is causing the problem.  Maybe the patch submitter can identify the problem).


svn path=/trunk/; revision=52666
2013-10-18 04:31:08 +00:00
Bill Meier c50b988807 From Shekhar Chandra: support for version 3.0 of netscaler packet wire format.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9280

From me: fix indentation(tabs->spaces) and trailing whitespace.


svn path=/trunk/; revision=52665
2013-10-18 03:36:04 +00:00
Pascal Quantin b5187b496b Use newly assigned DLT for PDU export functionality
svn path=/trunk/; revision=50212
2013-06-28 13:05:12 +00:00
Guy Harris 8c9edf1280 Have the seek-read routines take a Buffer rather than a guint8 pointer
as the "where to put the packet data" argument.

This lets more of the libwiretap code be common between the read and
seek-read code paths, and also allows for more flexibility in the "fill
in the data" path - we can expand the buffer as needed in both cases.

svn path=/trunk/; revision=49949
2013-06-16 00:20:00 +00:00
Anders Broman 878e89885b Allign the error messages.
svn path=/trunk/; revision=49870
2013-06-10 17:13:49 +00:00
Pascal Quantin 55da3a2254 From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8644 :
SEL RTAC (Real Time Automation Controller) EIA-232 Serial-Line Dissection

svn path=/trunk/; revision=49635
2013-05-30 20:51:18 +00:00
Guy Harris 055ff08c2f Use g_array_index() to get at elements of the encapsulation table array;
this avoids some compiler warnings from clang about alignment.

svn path=/trunk/; revision=49398
2013-05-18 00:41:30 +00:00
Pascal Quantin 6910f9428f From Tomasz Mon via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8503 :
Add USBPcap support

svn path=/trunk/; revision=48847
2013-04-14 16:00:34 +00:00
Anders Broman 089dfcd108 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48424
2013-03-19 19:02:25 +00:00
Balint Reczey 4cf12b41be Revert "Fix MSVC build errors related to symbol visibility"
This reverts commit r47952.
The problem was different from what I originally thought, thus
the commit was obsolete.

svn path=/trunk/; revision=47954
2013-02-28 22:17:06 +00:00
Balint Reczey ccc76ff07f Fix MSVC build errors related to symbol visibility
svn path=/trunk/; revision=47952
2013-02-28 21:11:32 +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 f6d8712284 Use const char in wtap_register_encap_type() just as in proto_register_protocol().
svn path=/trunk/; revision=46990
2013-01-07 21:02:56 +00:00
Michael Tüxen 99d406059f Add native SCTP encapsulation.
svn path=/trunk/; revision=46244
2012-11-28 12:16:12 +00:00
Jakub Zawadzki 6b5045dd7b Fill some phdr values also when doing random read
svn path=/trunk/; revision=45619
2012-10-17 20:28:22 +00:00
Jakub Zawadzki 78631020b8 Add wtap_pseudo_header union to wtap_pkthdr structure.
Use pkthdr instead of pseudo_header as argument for dissecting.

svn path=/trunk/; revision=45601
2012-10-16 21:50:57 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Guy Harris 835111692f From Richard Stearn: support for AX.25, including support for
LINKTYPE_AX25.

svn path=/trunk/; revision=44211
2012-08-02 16:54:43 +00:00
Guy Harris 4fc130af79 From Richard Stearn: AX.25 KISS protocol support.
Part 1 of the fix for bug 7529.

svn path=/trunk/; revision=44202
2012-08-02 06:45:51 +00:00
Stig Bjørlykke 5affa94d1e Added missing entry for WTAP_ENCAP_SDH.
svn path=/trunk/; revision=44138
2012-07-30 13:54:28 +00:00
Jakub Zawadzki 33bfa85452 Initial support for D-Bus dissection (bug #5502)
svn path=/trunk/; revision=43542
2012-06-29 15:23:21 +00:00
Anders Broman 7881fe8493 From Stephen Donnelly: Correct ERF name, add WTAP_ENCAP string display https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7313
svn path=/trunk/; revision=43141
2012-06-06 20:35:37 +00:00