Commit Graph

605 Commits

Author SHA1 Message Date
Guy Harris e7e2f9c639 Make the OPEN_INFO_ values members of an enum.
Change-Id: I93dbd14f81492764bf5854ee40eebcd1e04f3e01
Reviewed-on: https://code.wireshark.org/review/4570
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-09 00:27:32 +00:00
Guy Harris 21e844bd82 Use WTAP_ERR_BAD_FILE for malformed compressed data in DOS Sniffer files.
Get rid of WTAP_ERR_UNC_TRUNCATED and WTAP_ERR_UNC_BAD_OFFSET, and lump
them under WTAP_ERR_BAD_FILE, with an error string; they're just another
form of "this file isn't a valid file of the type in question".

Change-Id: I0e9ac7c2ee66c8d789234a301c1dc2173aef1312
Reviewed-on: https://code.wireshark.org/review/4562
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-08 20:50:42 +00:00
Guy Harris a566f617d8 No need for WTAP_ERR_CANT_READ.
Unlike the standard I/O routines, the code we introduced that supports
fast random seeking on gzipped files will always supply some specific
error code for read errors, so we don't need WTAP_ERR_CANT_READ.

Add WTAP_ERR_CANT_WRITE for writing, as we're still using the standard
I/O routines for that.  Set errno to WTAP_ERR_CANT_WRITE before calling
fwrite() in wtap_dump_file_write(), so that it's used if fwrite() fails
without setting errno.

Change-Id: I6bf066a6838284a532737aa65fd0c9bb3639ad63
Reviewed-on: https://code.wireshark.org/review/4540
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-07 23:19:56 +00:00
Guy Harris 54b733ce9a Make the time stamp resolution per-packet.
Pcap-ng files don't have a per-file time stamp resolution, they have a
per-interface time stamp resolution.  Add new time stamp resolution
types of "unknown" and "per-packet", add the time stamp resolution to
struct wtap_pkthdr, have the libwiretap core initialize it to the
per-file time stamp resolution, and have pcap-ng do the same thing with
the resolution that it does with the packet encapsulation.

Get rid of the TS_PREC_AUTO_XXX values; just have TS_PREC_AUTO, which
means "use the packet's resolution to determine how many significant
digits to display".  Rename all the WTAP_FILE_TSPREC_XXX values to
WTAP_TSPREC_XXX, as they're also used for per-packet values.

Change-Id: If9fd8f799b19836a5104aaa0870a951498886c69
Reviewed-on: https://code.wireshark.org/review/4349
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-28 18:38:18 +00:00
Evan Huus 1db95f7e4d pcapng: don't leak block option strings
I *think* I got all the cases; I got most of them, at any rate, and enough to
shut up valgrind in all the test cases I ran.

Change-Id: I393bac0756f577b65e400b792f6719fa6ec4056a
Reviewed-on: https://code.wireshark.org/review/4244
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-22 20:41:28 +00:00
Bill Meier f3dd7fe1eb Fix whitespace/indentation to match editor modelines.
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca
Reviewed-on: https://code.wireshark.org/review/3452
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-05 20:42:21 +00:00
Guy Harris d4dab16a3f Only one buffer.c, please.
Otherwise, if you link with both libwiretap and libfiletap, it's
anybody's guess which one you get.  That means you're wasting memory
with two copies of its routines if they're identical, and means
surprising behavior if they're not (which showed up when I was debugging
a double-free crash - fixing libwiretap's buffer_free() didn't fix the
problem, because Wireshark happened to be calling libfiletap' unfixed
buffer_free()).

There's nothing *tap-specific about Buffers, anyway, so it really
belongs in wsutil.

Change-Id: I91537e46917e91277981f8f3365a2c0873152870
Reviewed-on: https://code.wireshark.org/review/3066
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-15 23:43:32 +00:00
Guy Harris 474b90e358 Boost the maximum snapshot length to 262144, for USBPcap.
Change-Id: I104bd9d1519298a0e4ff818f1cf821df594b3491
Reviewed-on: https://code.wireshark.org/review/2658
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-25 20:43:04 +00:00
Guy Harris 8cde7a72d6 Boost the maximum packet size to 131072.
Libpcap 1.6/tcpdump 4.6 will support up to 131072, as the MTU on the
Linux loopback device is 65536 on at least some versions of the kernel,
and that doesn't count the fake Ethernet header, so the maximum packet
size is 65549; they went to the next power of 2 up.

Change-Id: Ibfc66d01ef8ef7387887a75c2b567159bb78ac0f
Reviewed-on: https://code.wireshark.org/review/2655
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-25 20:27:11 +00:00
U-beauty\bdn 977a811217 IPMI trace dissector (without PCAP-dependent part).
Added KCS and TMode protocol dissectors.
Request/response logic has been revised.
Saved request data logic has been revised.
Added Get Message command response dissector.
Added missing PICMG command dissectors.
Added new PICMG command dissectors.
Added new PPS OEM command entries.
Added VITA 46.11 command dissectors.

From: Bill Meier:
- refs to value_strings/range_strings in hf[] entries, by convention, should use VALS/RVALS macros;
- refs to true_false_strings should use TFS(&...) macro.
  also: true_false_string definitions should not be defined as arrays.
- remove some unneeded #includes (packet-ipmi.c).
- Do some re-indentation.
- Add editor-modelines as needed.

bug: 10004
Change-Id: Ib269b35784c0b70892d1e0111bcfb483ea64092c
Reviewed-on: https://code.wireshark.org/review/1185
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-06 06:43:45 +00:00
Guy Harris 6dffc3b7e3 Distinguish between "events" and "reports".
Have two different classes of file-type-specific records - "events" and
"reports".  An "event" indicates something that happened in the capture
process, such as a status transition on the network; a "report" just
gives information not corresponding to something happening in the
capture process, such as capture statistics.

Note that both of those should be dissected and displayed like packets,
and leave open the possibility of file-type-specific records whose
contents should be processed and saved but not displayed in the packet
list.

Shorten "file_type_specific" to "ft_specific".

Change-Id: I2342d82ef992c794b76f354c057823dd5eb371e6
Reviewed-on: https://code.wireshark.org/review/1779
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24 21:54:45 +00:00
Guy Harris 1b6cc6320e Add support for plugins to handle pcap-ng block types.
We rename "file format" plugins to "libwiretap" plugins, as they can
register as read handlers for a new file type, read/write handlers for a
pcap-ng block type (or both).

To register as a pcap-ng block type handler, in the
register_wtap_module() routine of your plugin, call
register_pcapng_block_type_handler() with the pcap-ng block type and
pointers to your routines to read and write those blocks.  Those
routines should read and write REC_TYPE_FILE_TYPE_SPECIFIC records, with
the block type in the pseudo-header for the record in the struct
wtap_pkthdr structure, with time stamps stored in that structure, and
with a blob of data for the rest of the record.

This is for bug 8590.

Change-Id: I71847d834854a29ceb85894fd094c2ae91a04273
Reviewed-on: https://code.wireshark.org/review/1775
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24 20:57:57 +00:00
Guy Harris 6db77b000f Allow wtap_read() and wtap_seek_read() to return records other than packets.
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be
REC_TYPE_PACKET, for a record containing a packet, or
REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific
data.

Modify code that reads packets to be able to handle non-packet records,
even if that just means ignoring them.

Rename some routines to indicate that they handle more than just
packets.

We don't yet have any libwiretap code that supplies records other than
REC_TYPE_PACKET or that supporting writing records other than
REC_TYPE_PACKET, or any code to support plugins for handling
REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug
8590.

Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813
Reviewed-on: https://code.wireshark.org/review/1773
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24 18:31:25 +00:00
Guy Harris a344c9736e Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."
This reverts commit c0c480d08c.

A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes.  That is in-progress.

Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6
Reviewed-on: https://code.wireshark.org/review/1741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 10:50:10 +00:00
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
Michael Mann 078daeb27f Populate heuristic extension list during initialization and not during each call to heuristic_uses_extension.
Change-Id: I7e484de65c49060793a91cc11cb211effa2006db
Reviewed-on: https://code.wireshark.org/review/1494
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-08 00:31:29 +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 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
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
Michal Labedzki a68e3a410c Wiretap: Add support for Android Logcat
Now Androit Logcat (Logger) binary logs are supported.
Try "adb logcat -Bf /sdcard/log.logcat; adb pull /sdcard/log.logcat".
Also there is possibility to save logs to text format like by "adb".

Change-Id: If7bfc53d3fbd549a0978d1dbf96f3fff671fd601
Reviewed-on: https://code.wireshark.org/review/235
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-19 17:01:09 +00:00
Michael Mann 04d9501306 Add capture file reader/writer support for Lua so scripts can implement new capture file formats.
This enables a Lua script to implement a brand new capture file format reader/writer, so that for example one could write a script to read from vendor-specific "logs" of packets, and show them as normal packets in wireshark.

Change-Id: Id394edfffa94529f39789844c382b7ab6cc2d814
Reviewed-on: https://code.wireshark.org/review/431
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-19 05:04:54 +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
Hadriel Kaplan 041f844d72 Add command-line arg for input file format for tshark/wireshark
Now that we have the ability to choose input file format type
in the GUI, we might as well have it in the command-line too.
Plus it would help me in test-stuies if we had a commandline.
So I've added a '-X read_format:Foo' for this.  Using just
'-X read_format:', or with a bad name, will make it print out
the full list (in tshark); just like the '-F' does for output
file formats.

Note: I am *not* putting in code for Win32 GUI,
because I can't compile that and I wouldn't have even
done the GTK one if I could compile Qt originally. (I don't think we need
to add any more features to GTK or Win32, just Qt from now on,
right?)

Change-Id: I2fe6481d186f63bd2303b9e591edf397a2e14b64
Reviewed-on: https://code.wireshark.org/review/493
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-05 18:38:05 +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
Michal Labedzki 579e7e19ce Wireshark: Add option to choose format type of capture file
The best heuristic can fail, so add possibility to manually choose
capture file format type, so not correctly recognize file format can be
loaded in Wireshark.

On the other side now it is possible to open capture file
as file format to be dissected.

Change-Id: I5a9f662b32ff7e042f753a92eaaa86c6e41f400a
Reviewed-on: https://code.wireshark.org/review/16
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-25 17:43:13 +00:00
Michal Labedzki d574fd89f4 Add support for Bluetooth Linux Monitor
BlueZ 5/Linux Kernel introduced new way to sniffing Bluetooth interfaces.
We are ready to use it. Libpcap provide new interface called
"bluetooth-monior".

Also fix trivial typos.

Change-Id: Ic608a3d8553bbebbb21f2733ec92c758cbf8f707
Reviewed-on: https://code.wireshark.org/review/253
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-20 18:35:29 +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 e1ea055c79 Clean up white space.
svn path=/trunk/; revision=54504
2013-12-30 23:44:42 +00:00
Guy Harris 53cba3e3b9 Add an "ATM reassembly failed" flag for capture file readers to provide,
and set it in NetXRay/Windows Sniffer files if the putative "ATM
reassembly failed" flag is set and, if reassembly failed, don't attempt
to dissect the packet.

svn path=/trunk/; revision=54503
2013-12-30 23:37:12 +00:00
Guy Harris 5946c5236b For file formats that don't have magic numbers, so they're recognized by
heuristics, but do have a file extension that files of that format are
likely to have, use the extension of the file we're opening, if it has
one, as a hint for which heuristics to try first.

svn path=/trunk/; revision=54495
2013-12-30 06:43:19 +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
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
Anders Broman 98bc5eedbc Export the right function name.
svn path=/trunk/; revision=53255
2013-11-11 19:50:17 +00:00
Jakub Zawadzki 38edae1c71 Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.
After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy. 

svn path=/trunk/; revision=53184
2013-11-09 10:38:02 +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
Guy Harris bf4e84aba6 For open dialogs, offer a list of sets of extensions, not of file types;
.cap, for example, doesn't refer to a particular file type - a whole
bunch of file types use .cap.

Also offer, in addition to "All Files", "All Capture Files", which
matches all the extensions we know about.

svn path=/trunk/; revision=53156
2013-11-08 01:08:42 +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
Anders Broman 20108d7950 Get rid of struct addrinfo, use the hastables for name resolution instead.
svn path=/trunk/; revision=52176
2013-09-22 19:40:02 +00:00
Guy Harris a505518e01 Have a separate list of extension sets to use in the Open dialog;
include only extensions used mostly by capture files (i.e., not ".txt"
or ".xml"), and list each extension set only once (it's silly to have,
for example, separate entries for NetMon, Shomiti Surveyor, and
NetScaler with ".cap" when you get all those types no matter which entry
you choose).

svn path=/trunk/; revision=51547
2013-08-27 20:46:47 +00:00
Guy Harris 32e1523bb2 For the Windows Open dialog for capture files, get rid of the "(*.*)" in
the "All Files" entry (the current UI guidelines from Microsoft say to
do so, and that's what Paint does, at least), and add an "All Capture
Files" entry with all the file extensions for the file types we support
(it'll pick up all text files, but there's not much we can do about
that, and it won't pick up files with *no* extension or weird
extensions, such as you might get from UN*X systems or from WinDump
commands, but at least it'll filter out some other crud).

Fix what appear to be memory leaks; that should be backported unless
I've missed something and they aren't leaks.

Fix an out-of-date comment, and add an additional comment.

svn path=/trunk/; revision=51481
2013-08-23 00:06:26 +00:00
Evan Huus 0b796e53cf From Linas Vepstas via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8962
Enhancement: Add STANAG 4607 file format

svn path=/trunk/; revision=50996
2013-07-28 23:41:18 +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
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
Evan Huus 930d0c1ed6 From Ravi Kondamuru via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8637
Add support for version 2.6 of netscaler capture format.

svn path=/trunk/; revision=49250
2013-05-11 18:43:53 +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
Guy Harris d517ab3698 In the Lua dumper code, don't bother checking whether the encapsulation
is supported before trying to open for writing - the attempt to open for
writing will do the check for you.  Instead, check for specific errors
if the attempt to open for writing fails, and use somewhat more specific
error messages for certain error codes.  (We should perhaps check for
even more error codes in those cases.)

That gets rid of all external calls to wtap_dump_can_write_encap(), so
remove it from wtap.h and make it static.

svn path=/trunk/; revision=48691
2013-04-01 21:39:28 +00:00
Guy Harris b1ecd8d217 Add a wtap_dump_can_write() routine that indicates whether Wiretap
supports writing files with a given set of encapsulations and comment
types.  Use it, rather than asking for a list of file formats that
support the given set of encapsulation and comment types and checking
whether we got back such a list, or duplicating its logic.

Having file.c use it means that nobody's using
wtap_dump_can_write_encaps() any more; get rid of it.  Instead, have a
private routine that checks whether a given file format supports a given
set of encapsulations *and* comment types, and use that internally.

svn path=/trunk/; revision=48690
2013-04-01 21:17:50 +00:00
Guy Harris 82a602d697 Define a collection of bits for different types of capture file comments.
For each capture file type, have a bitset of comment types supported by
that capture file type.

Add a Wiretap routine that, for a given file type, returns the bitset of
comment types it supports.

Have wtap_get_savable_file_types() take a bitset of comment types that
need to be supported by the file types it returns.

Replace cf_has_comments() with a routine that returns a bitset of
capture file comment types in the capture file.

Use those routines in the capture file dialogs; don't wire in the notion
that pcap-NG supports all comment types and no other file formats
support any comment types.  (That's currently true, but we don't want to
wire that in as being forever true.)

svn path=/trunk/; revision=48689
2013-04-01 20:36:42 +00:00
Martin Kaiser 7a2bdedff6 wiretap support for the CAM Inspector file format
svn path=/trunk/; revision=48647
2013-03-30 09:56:57 +00:00
Evan Huus b8ae49755d From Prafulla Harpanhalli via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8513
Add support for encapsulation 136, Juniper service PIC cookie.

svn path=/trunk/; revision=48494
2013-03-23 02:42:12 +00:00
Anders Broman 05a8c94ddf From beroset:
implemented wtap_dump_file_seek() and _tell()

implemented the previously declared but unimplemented wtap_dump_file_seek() and wtap_dump_file_tell() functions and used them in the seven files that had previously used a plain ftell or fseek and added error checking as appropriate.  I also added a new error WTAP_ERR_CANT_SEEK_COMPRESSED and put it next to WTAP_ERR_CANT_SEEK causing renumbering of two of the existing error codes.

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

svn path=/trunk/; revision=48348
2013-03-17 09:20:13 +00:00
Bill Meier db6243a180 Use consistent indentation (4 spaces);
Reformat  long single line comments for readability;
Add editor modelines.

svn path=/trunk/; revision=48086
2013-03-05 15:28:10 +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
Gilbert Ramirez 10dd94fa0b Add support for HFI and infiniband interfaces in AIX iptrace files.
svn path=/trunk/; revision=47258
2013-01-24 18:08:25 +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
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +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 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
Anders Broman 19f6a77cee From Nikhil Kalu:
Enhancement to add more trace record fields in Citrix NetScaler capture file format.

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

svn path=/trunk/; revision=44895
2012-09-14 11:11:37 +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
Guy Harris 633de5c7d1 Add a routine that, given a set of packet encapsulation types, returns
the per-file encapsulation type needed to write out a set of packets
with all those encapsulation types.  If there's only one such
encapsulation type, that's the type, otherwise WTAP_ENCAP_PER_PACKET is
needed.  Use that in wtap_dump_can_write_encaps().

Also use it in cf_save_packets() and cf_export_specified_packets(), so
that we can write out files with WTAP_ENCAP_PER_PACKET as the file
encapsulation type and only one actual per-packet encapsulation type in
some cases where that failed before.  This fixes the case that showed up
in bug 7505, although there are other cases where we *could* write out a
capture in a given file format but won't be able to do so; fixing those
will take more work.

#BACKPORT

(Note: this adds a routine to libwiretap, so, when backported, the
*minor* version of the library should be increased.  Code that worked
with the version of the library prior to this change will continue to
work, so there's no need to change the *major* version of the library.)

svn path=/trunk/; revision=43847
2012-07-20 04:00:29 +00:00
Michael Mann 7184dac548 Addresses https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3895. Note that this doesn't write a Nokia file type properly, it just doesn't corrupt an existing one (read in by Wireshark) if resaved.
svn path=/trunk/; revision=43815
2012-07-19 01:00:49 +00:00
Guy Harris b40db9cf4c Add to the 802.11 pseudo-header a "this is already decrypted" flag, set
it as appropriate in the code to read Network Instruments Observer
captures (rather than tweaking the "protected" flag in the packet data),
and use that flag in the 802.11 dissector.

Fix indentation while we're at it (tabs are not *ipso facto* 4 spaces).

svn path=/trunk/; revision=43795
2012-07-18 22:10:34 +00:00
Guy Harris 9fcbc2377f The names "etherpeek" and "airopeek" are a bit misleading, as the
"etherpeek.c" file format is used by AiroPeek and the "airopeek9.c" file
format is used by EtherPeek.

Instead, use the names that WildPackets apparently uses for those
formats - "classic" and "tagged".

svn path=/trunk/; revision=43630
2012-07-09 23:07: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
Guy Harris 2bd813507a Export a wtap_dump_can_write_encaps() routine from Wiretap; it takes a
file type and a GArray of encapsulation types and returns TRUE if a
capture with all those encapsulation types can be written to a file in
that file type and FALSE otherwise.  Use it where appropriate.

svn path=/trunk/; revision=43315
2012-06-17 16:44:09 +00:00
Guy Harris c63aa61658 Have wtap_get_savable_file_types() take an array of encapsulations and
only return file types that could handle a single file with all those
encapsulations - this means that

	1) if there's more then one encapsulation, the file format has
to handle per-packet encapsulation;

	2) just because a file format handles per-packet encapsulation,
that doesn't mean that it can handle the *particular* encapsulations
being handed to it.

This fixes some cases where we were claiming that a file could be saved
in a format that doesn't actually support it (e.g., ISDN files being
reported as savable in pcap-NG format - there's no LINKTYPE_ value for
ISDN including B and D channels).

svn path=/trunk/; revision=43300
2012-06-17 01:32:50 +00:00
Anders Broman 5bd0c263f2 From Andrew Kampjes:
SDH support for wireshark.

- Added GPL license.
- Removed not needed includes.
- Skipped th .h file as it wasn't used.

svn path=/trunk/; revision=43106
2012-06-05 10:42:38 +00:00
Guy Harris e51c05a836 TShark doesn't need wtap_fdreopen(), as it doesn't do saves and thus
doesn't do safe saves, so wtap_fdreopen() always needs to reopen the
random file descriptor.

At the point where a safe save is done, the sequential read is done, so
the sequential stream is closed; there's no need to reopen it.

(The former fourth argument to wtap_fdreopen() wasn't an indication of
whether the file was compressed, it was an indicationof whether the
random stream should be reopened.)

svn path=/trunk/; revision=42977
2012-06-01 16:55:10 +00:00
Guy Harris 129c881fcf Sigh. There appears to be no way to get Windows to allow us to rename a
file that we ourselves have open.  In the "safe save" code path for
capture files, on Windows temporarily close the file descriptors for the
currently-open capture before doing the rename and then, if the rename
failed, reopen them, leaving the rest of the wtap and capture_file
structures intact.

Rename filed_open() to file_fdopen(), to make its name match what it
does a bit better (it's an fdopen()-style routine, i.e. do the
equivalent of an open with an already-open file descriptor rather than a
pathname, in the file_wrappers.c set of routines).

Remove the file_ routines from the .def file for Wiretap - they should
only be called by code inside Wiretap.

Closing a descriptor open for input has no reason to fail (closing a
descriptor open for *writing* could fail if the file is on a server and
dirty pages are pushed asynchronously to the server and synchronously on
a close), so just have file_close() return void.

svn path=/trunk/; revision=42961
2012-06-01 08:05:12 +00:00
Guy Harris a66097145d Clean up indentation (remove tabs from one structure definition).
svn path=/trunk/; revision=42869
2012-05-27 23:41:03 +00:00
Guy Harris cf6d9841e3 Keep track, in Wiretap, of whether the file is compressed, and provide
an API to fetch that.

When doing "Save" on a compressed file, write it out compressed.

In the Statistics -> Summary dialog and in capinfos, report whether the
file is gzip-compressed.

svn path=/trunk/; revision=42818
2012-05-24 05:05:29 +00:00
Guy Harris e6a57c8e93 In Windows, in the Save As and Export Selected Packets dialog, append
the default extension for the file type iff

	the file type we're using has a list of extensions;

	the file has no extension or it has one but it's not one of the
	ones in the list.

*Don't* expect a file extension to be at most 5 characters plus the dot
- the extension for pcap-ng, our default capture file type, is "pcapng",
and that's 6 characters!

svn path=/trunk/; revision=42800
2012-05-23 03:05:17 +00:00
Guy Harris 0275247b97 Use WTAP_ENCAP_IEEE_802_11_xxx for all the "802.11 plus radio header"
encapsulations.

For pre-V9 AiroPeek captures, leave the radio information in the packet
data, just as we do with the Prism, AVS, radiotap, and NetMon headers. 
Add a dissector for it.

svn path=/trunk/; revision=42379
2012-05-02 03:11:00 +00:00
Anders Broman 102991bf0f Handle wtap_dump_fdopen() as wtap_dump_open() eg call
wtap_dump_fdopen_ng() and add a dummy IDB to be able to write pcapng files.
Solves https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6969
mergecap: Can't open or create <FILENAME>: Internal error.

We might want to add a SHB comment from mergecap giving the merged filenames or something like that, Merging of pcapng files
is a different issue, idealy we should probably start using several SHB:s in that case.

svn path=/trunk/; revision=42230
2012-04-25 12:33:23 +00:00
Martin Mathieson 45252c84e3 Patch for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5048
From Tom Cook and Tom Alexander.

1. A VWR encapsulation that reads VeriWave capture files (*.vwr)
generated from
WaveTest test hardware
2. Dissectors that display the VeriWave tap headers (both 802.11 and
Ethernet)
3. A dissector for the WaveAgent protocol.  The WaveAgent dissector is
heuristic and parses the WaveAgent packet (a UDP payload).

The WaveAgent dissector has been Fuzz tested.

The VWR ENCAP and dissectors have been used extensively by VeriWave
customers in a special version of WireSark compiled by VeriWave.

svn path=/trunk/; revision=42155
2012-04-20 12:08:31 +00:00
Alexis La Goutte 6aedbbaf35 From Colus Tang via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7134
Unable to display the correct IEEE802.11 MCS data rates due to header definition

The problem is due to the ieee_802_11_phdr.data_rate is defined as guint8,
since this variable is counting number of 0.5Mbps units, any datarates which is
higher than 255Mbps would get wrapped up.  In the above example, only the lower
8bit value will be put into the ieee_802_11_phdr which is 0x04 and result in
the incorrect 2Mbps display.

There are 802.11n WLAN product is capable to transmit @450Mbps, we should fix
this data_rate from guint8 to guint16.

#BACKPORT

svn path=/trunk/; revision=42123
2012-04-18 07:22:12 +00:00
Guy Harris 154c0f37dd Indicate where BACnet MS/TP is specified.
Add a new WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR encapsulation type, for use
by the EyeSDN file reader; unlike the pcap-encapsulated MS/TP, it
includes a direction indicator.  Don't treat WTAP_ENCAP_BACNET_MS_TP as
if it has a direction indicator, as it doesn't; instead, do that for
WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR.

Add some missing entries to encap_table_base for WTAP_ENCAP_ values that
didn't get entries added.

svn path=/trunk/; revision=41969
2012-04-06 03:42:32 +00:00
Anders Broman 77b67c7456 From Rolf Fiedler:
Patch to add V5.2 tracing capability on E1 links using EyeSDN probes.

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

Removed preference related stufff as it's not needed.

svn path=/trunk/; revision=41915
2012-04-04 07:33:39 +00:00
Jakub Zawadzki bb8afe3f68 Add initial support for dissecting packets encapsulated in Netfilter LOG (DLT_NFLOG=239).
svn path=/trunk/; revision=41872
2012-03-31 17:29:41 +00:00
Anders Broman efa9387886 From Krishna:
Enhancement to add more trace record fields in Citrix NetScaler capture file format.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?

svn path=/trunk/; revision=41740
2012-03-22 15:36:37 +00:00
Anders Broman bb611755e9 Add data structure to hold information from ISB:s
svn path=/trunk/; revision=41522
2012-03-13 08:36:52 +00:00
Anders Broman 7fba54762b From Mike Wakerly: Add wiretap suport for LINKTYPE_NFC_LLCP
svn path=/trunk/; revision=41368
2012-03-06 09:02:06 +00:00
Anders Broman 971cb84877 if_filter isn't a string per se,The first byte of the Option Data keeps a code of the filter used
svn path=/trunk/; revision=41339
2012-03-04 19:01:14 +00:00
Anders Broman e82ad19e58 From Weston Schmidt: Add mpeg-ts capture file format support. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6894
svn path=/trunk/; revision=41286
2012-03-02 06:02:28 +00:00
Anders Broman 23ec82fae9 From Reinhard Speyerer: Adding support for LINKTYPE_PPP_ETHER/DLT_PPP_ETHER
svn path=/trunk/; revision=41256
2012-03-01 07:39:54 +00:00
Anders Broman 38c69c8431 Make it possible to edit capture comments
svn path=/trunk/; revision=41193
2012-02-26 17:04:28 +00:00
Guy Harris b6ff142f60 Add a presence flag field to the packet information structure filled in
by Wiretap, to indicate whether certain fields in that structure
actually have data in them.

Use the "time stamp present" flag to omit showing time stamp information
for packets (and "packets") that don't have time stamps; don't bother
working very hard to "fake" a time stamp for data files.

Use the "interface ID present" flag to omit the interface ID for packets
that don't have an interface ID.

We don't use the "captured length, separate from packet length, present"
flag to omit the captured length; that flag might be present but equal
to the packet length, and if you want to know if a packet was cut short
by a snapshot length, comparing the values would be the way to do that.

More work is needed to have wiretap/pcapng.c properly report the flags,
e.g. reporting no time stamp being present for a Simple Packet Block.

svn path=/trunk/; revision=41185
2012-02-25 23:24:34 +00:00
Anders Broman 89758cdec8 From Jose Pedro Oliveira fix a typo
svn path=/trunk/; revision=41091
2012-02-20 22:40:17 +00:00
Anders Broman c7f1a431d2 Handle reading and writing of multiple IDB:s, write IDB options and use correct lengt for strings, handle more than 100 char comment
svn path=/trunk/; revision=41082
2012-02-20 20:15:51 +00:00
Anders Broman 0b6b3937ab Make it possible to get inforamtion from the read SHB to the one to write out.
svn path=/trunk/; revision=41032
2012-02-15 19:44:16 +00:00
Anders Broman 8aea738cda Add the abillity to read and write option comments unedited.
This is POC we may want to have more efficient use of the frame data
structure etc. But this allows for work to be done on the GUI to actually add comments.

svn path=/trunk/; revision=40969
2012-02-11 12:34:39 +00:00
Anders Broman 7be6e75c13 Add pcapng variables to wtap_pkthdr.
svn path=/trunk/; revision=40947
2012-02-09 22:24:00 +00:00
Anders Broman 5f14cec8e2 From Guy Martin:
Add new linktype 243 for MPEG2-TS.

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

svn path=/trunk/; revision=40884
2012-02-06 19:15:07 +00:00
Anders Broman 6dbeabfc6f From Tobias Witek:
Allow dissectors to indicate that an ATM AAL5 frame contains SSCOP.

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

svn path=/trunk/; revision=40750
2012-01-28 16:34:22 +00:00
Guy Harris c8854a7a5f Add a routine to Wiretap that takes a file type value and an
encapsulation value and returns a GArray containing all the file types
that could be used to save a file of that file type and that
encapsulation value (which could be WTAP_ENCAP_PER_PACKET), with the
input file type first if that can be used and pcap or pcap-ng first if
not and if one of them can be used, and with pcap and pcap-ng clustered
together if they're among the file types that can be used.

Use that routine for the GTK+ file save dialog.

svn path=/trunk/; revision=40685
2012-01-24 04:33:23 +00:00
Guy Harris 3b1f82d063 In the table of capture file types, have:
a field that gives the default extension for the file type,
	*without* a leading "." (i.e., just the extension, not the "."
	that separates it from the rest of the file name), which is NULL
	if there are no known extensions;

	a field that gives a semicolon-separated list of *other*
	extensions, without "*." or ".", which is NULL if there are no
	known extensions or there are no known extensions other than the
	default.

Rename wtap_file_extension_default_string() to
wtap_default_file_extension() (matches the name of the field).

svn path=/trunk/; revision=40678
2012-01-23 23:17:03 +00:00
Guy Harris e4a193fe5e Replace wtap_file_extensions_string() with a routine that returns a
GSList of extensions for a file type, including extensions for the
compressed versions of those file types that we can read.

svn path=/trunk/; revision=40623
2012-01-21 08:59:21 +00:00
Guy Harris 020d9491da It's the Xoraya file type, not the Xoraya encapsulation, that was bogus.
svn path=/trunk/; revision=40622
2012-01-21 04:00:43 +00:00
Guy Harris e3712a53da Get rid of an unused file type. If somebody wants it in the official
Wireshark distribution, give us code to read it.  If somebody wants it
in their private version of Wireshark, they can manage that themselves. 
(We should support plugins for file types at some point; I think we
already have support for Lua file readers.)

svn path=/trunk/; revision=40620
2012-01-21 03:52:19 +00:00
Guy Harris eb5c7d64a4 Get rid of unused WTAP_FILE_WTAP file type.
Move pcap-NG right after standard pcap in the list of file types, so
that it shows up early in the list of output file types in the "Save
As..." dialog box (if, that is, it's supported; if not, neither is pcap,
as they use the same link-layer header type values).

svn path=/trunk/; revision=40493
2012-01-14 09:12:05 +00:00
Gerald Combs cb9725ce2b Prepend the sita_phdr fields with "sita_" to make them less
collision-prone.

svn path=/trunk/; revision=40320
2011-12-28 23:39:14 +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
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
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
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
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
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
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
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
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
Chris Maynard 63b50fe2ee Declare the snapshot_length as unsigned.
svn path=/trunk/; revision=37479
2011-05-31 15:27:48 +00:00
Guy Harris 592f0ba6da Declare wtap_dump_has_name_resolution().
svn path=/trunk/; revision=37215
2011-05-17 22:17:04 +00:00
Guy Harris 88a1ed85e3 From Jakub Zawadzki: for file read progress bars, use the raw offset in
the file, rather than the offset in the uncompressed data stream.  That
way we don't get the "hey, we're more than 100% into the file, better
refigure this" surprise.

svn path=/trunk/; revision=37025
2011-05-09 05:30:59 +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
Anders Broman a663d91ca6 From Hans-Christoph Schemmel:
A variant of 3GPP TS 27.010 multiplexing protocol dissector.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5829

svn path=/trunk/; revision=36927
2011-04-28 05:36:26 +00:00
Guy Harris 140cc563c6 In file_wrappers.c, explicitly set err_info to null for all errors that
don't have an "additional information" string.

Get rid of WTAP_ERR_ZLIB; just report an internal error with
WTAP_ERR_INTERNAL instead.  (If they start happening, we can think about
supplying an "additional information" string for compression errors on
output.)

svn path=/trunk/; revision=36774
2011-04-21 17:51:19 +00:00
Guy Harris 6cbf6ce16c Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered
by the gunzipping code.  Have it also supply a err_info string, and
report it.  Have file_error() supply an err_info string.

Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to
suggest a decompression error - into the rawshark and tshark errors,
along the lines of what other programs print.

Fix a case in the Netscaler code where we weren't fetching the error
code on a read failure.

svn path=/trunk/; revision=36748
2011-04-21 09:41:52 +00:00
Guy Harris 92c974f2f7 Now that wtap_read() checks for delayed errors on EOF, there's no need
to check for it on close.

svn path=/trunk/; revision=36593
2011-04-12 17:37:05 +00:00
Guy Harris e5fe0128d7 Allow wtap_sequential_close() and wtap_close() to return an error; this
may happen if, when reading a compressed file, we find an error in the
file's contents past the last packet (e.g., the file being cut short so
that we can't get a full buffer worth of compressed data), and that
reporting of that error is delayed (so that you can get all of the
packets that we *can* decompress).  Check for those errors, at least on
the sequential read pass (the only errors we should see when closing the
random stream are errors we've already seen in the sequential stream).

svn path=/trunk/; revision=36576
2011-04-12 01:36:12 +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 173708364c More updates to the wtap_open_offline() comment.
svn path=/trunk/; revision=36384
2011-03-28 17:23:06 +00:00
Anders Broman 08f71f1232 Update a comment.
svn path=/trunk/; revision=36376
2011-03-28 13:09:47 +00:00
Gerald Combs fcf51fc73b Add initial pcapng name resolution record support. Wireshark has read
support; TShark has read+write support. Additionally TShark can read a
"hosts" file and write those records to a capture file.

This uses "struct addrinfo" in many places and probably won't compile on
some platforms.

svn path=/trunk/; revision=36318
2011-03-24 22:47:57 +00:00
Bill Meier 16b528aaf1 From Martin Kaiser: dissector for DVB-CI (Common Interface)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5654

From me:
- Entry for DVBCI added to wtap.c encap_table_base[];
- Some code simplification with respect to the use of col_...() for COL_INFO;
- Certain tests for "enough bytes available" not really needed;
- (Other minor tweaks);
- #include<stdio.h> not req'd;
- Minor reformatting and whitespace cleanup;


svn path=/trunk/; revision=36149
2011-03-07 02:22:48 +00:00
Jaap Keuter 9e367f5cff From njohnkev:
Add support for LAPD data link type.

svn path=/trunk/; revision=35771
2011-02-02 22:49:40 +00:00
Jaap Keuter 7e16ec5b99 Prepare for handling DLT_IPV4 and DLT_IPV6.
svn path=/trunk/; revision=35223
2010-12-19 18:46:08 +00:00
Bill Meier 9787a5734a From Hadriel Kaplan: IPFIX file format support.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5242

svn path=/trunk/; revision=34576
2010-10-20 00:36:53 +00:00
Guy Harris 11b9ed0426 Define WTAP_ENCAP_IEEE802_15_4_NOFCS, for use in file formats that don't
include the FCS, and use it for the Daintree SNA file format.  While
we're at it, explicitly check to make sure the purported packet length
gives it at least one byte of packet data, and fix some print formats to
use %u for unsigned values.

svn path=/trunk/; revision=33678
2010-07-30 02:30:50 +00:00
Guy Harris d1751061c8 Initial support for Network Monitor 802.11 radio header.
svn path=/trunk/; revision=33583
2010-07-19 18:00:20 +00:00
Guy Harris a88d19d961 Clean up indentation.
svn path=/trunk/; revision=33118
2010-06-06 22:35:33 +00:00
Guy Harris 149ccb3b68 Attempt to handle isochronous descriptors between the 64-byte header and
the payload.  Should fix bug 4401.

svn path=/trunk/; revision=32828
2010-05-16 03:19:40 +00:00
Gerald Combs 0a209d762e Zlib has an officially-sanctioned way of clearing EOF when we're tailing
a file.  Use it.

svn path=/trunk/; revision=32716
2010-05-07 21:15:24 +00:00
Guy Harris ea392ce83d A bit more information.
svn path=/trunk/; revision=32537
2010-04-22 04:50:55 +00:00
Guy Harris 53850f189a More updates to reflect all the hairy details of Linux USB capture.
svn path=/trunk/; revision=32536
2010-04-22 04:38:48 +00:00
Guy Harris c6e453d090 Update a comment to reflect recent changes and to reflect behavior of
later Linux kernels.

svn path=/trunk/; revision=32535
2010-04-22 00:10:17 +00:00
Guy Harris 21a210b777 From Chris Maynard:
Support PPP-over-USB.

	Don't remove the USB pseudo-header from the packet data for
	Linux USB packets, just byte-swap it if necessary and have the
	USB dissector fetch the pseudo-header from the raw packet data.

	Update USB language ID values.

svn path=/trunk/; revision=32534
2010-04-21 20:51:22 +00:00
Anders Broman 6dfde68911 From Stephen Donnelly:
Endace ATM and AAL2 enhancements.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4447

svn path=/trunk/; revision=31766
2010-02-02 04:56:39 +00:00
Anders Broman 2f6f1e48af From Tobias Witek:
Replace ERF dissector with ATM dissector for protocols 'FP Hint' and 'META'
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4384

svn path=/trunk/; revision=31761
2010-02-01 20:27:16 +00:00
Stephen Fisher 09a4f2af2f From Felix Obenhuber via bug #4299: SocketCAN dissector patch
From me: Remove changes related to the ARP protocol because it doesn't
appear to be necessary for SocketCAN.  Will add later if Felix says it is
needed.


svn path=/trunk/; revision=31196
2009-12-08 07:21:33 +00:00
Stig Bjørlykke 11ba06366d Renamed some wtap defines:
WTAP_GCOM_TIE1 => WTAP_ENCAP_GCOM_TIE1
WTAP_GCOM_SERIAL => WTAP_ENCAP_GCOM_SERIAL

svn path=/trunk/; revision=31161
2009-12-03 15:47:52 +00:00
Stig Bjørlykke e592902393 From Petr Sumbera via bug 4284:
Added support for Solaris IPNET layer

From me:
Some code cleanup in packet-ipnet.c
Added packet-ipnet.c to CMakeFiles.txt
Added WTAP_ENCAP_IPNET to encap_table_base[]

svn path=/trunk/; revision=31159
2009-12-03 15:27:39 +00:00
Stig Bjørlykke b7d116667f From Marton Nemeth:
Add the ability to open JPEG/JFIF files directly.

From me:
Some code cleanup + add new file to cmake.

svn path=/trunk/; revision=30588
2009-10-17 20:56:06 +00:00
Bill Meier acd415ca9b #include <stdio.h> no longer req'd.
svn path=/trunk/; revision=29569
2009-08-26 19:28:20 +00:00
Jaap Keuter 58dedc3872 From kahou:
Add Fibre Channel Delimiter Dissector for Fibre Channel FC2.

svn path=/trunk/; revision=29531
2009-08-23 19:16:35 +00:00
Guy Harris be2a84c231 Note that libpcap fails if it tries to read a file with a snapshot
length > 65535, so we shouldn't use a larger value.

svn path=/trunk/; revision=29194
2009-07-26 00:32:22 +00:00
Stig Bjørlykke e9066532cf From Kahou via bug 3739:
New DLT value is added for Fibre Channel FC2.

svn path=/trunk/; revision=29115
2009-07-16 10:45:14 +00:00
Michael Tüxen 634a80b610 Add support for DLT_PPP_WITH_DIR. This fixes bug 3619.
Thanks for Tyson Key for reporting the issue.

svn path=/trunk/; revision=28877
2009-06-28 18:22:15 +00:00
Stig Bjørlykke c9b492a422 From Ravi Kondamuru via bug 3457:
Add support to read citrix netscaler capture file format.

From me:
- Renamed packet-ns.c to packet-nstrace.c
- Rewrote to not use "goto" in netscaler.c
- Moved dissecting of coreid

svn path=/trunk/; revision=28564
2009-06-01 17:23:38 +00:00
Stig Bjørlykke 5fa6b90f6b From Fred Fierling (bug 3486):
Added support for Daintree's Sensor Network Analyzer capture files.

svn path=/trunk/; revision=28463
2009-05-24 22:49:36 +00:00
Gerald Combs a37191cb07 From Kovarththanan Rajaratnam via bug 2676:
If a PCAP file containing WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR packets is saved,
it gets corrupted because the direction pseudo header isn't included.

svn path=/trunk/; revision=28441
2009-05-21 23:16:49 +00:00
Stig Bjørlykke 98f592713c Improved reading Apple's PacketLogger files:
- Send last byte of header (type) and data to a packetlogger dissector
- Rewrite type to ACI channel in the dissector
- Direction is indirectly given from the PL type
- Dissect PacketLogger NewC and Info as text

svn path=/trunk/; revision=28141
2009-04-24 08:14:36 +00:00
Stephen Fisher 18f3436e85 Add support for reading Apple's Bluetooth PacketLogger capture files to
wiretap.  Modify various other locations to accommodate the fact that
PacketLogger files do not specify the direction of packets. 


svn path=/trunk/; revision=27463
2009-02-16 07:24:04 +00:00
Anders Broman a8c964cd44 From Rolf Fiedler:
Add DPNSS link layer dissector, support EyeSDN Trace files with DPNSS.
(Removed a couple of c++ style comments).
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3224

svn path=/trunk/; revision=27312
2009-01-27 21:13:26 +00:00
Jaap Keuter 322d89cf15 From Duncan Salerno:
Added LAPDm protocol dissector, GSM Um layer, and wiretap support for dct3trace
captures, generated by gammu (many available at http://wiki.thc.org/gsm).

svn path=/trunk/; revision=27176
2009-01-07 07:21:31 +00:00
Guy Harris f6f84ae1dc Name changes to match libpcap name change of the corresponding DLT_
value.

svn path=/trunk/; revision=27113
2008-12-24 20:18:01 +00:00
Guy Harris d2cbbe0a2a Handle the new DLT_USB_LINUX_MMAP link-layer type.
svn path=/trunk/; revision=27099
2008-12-23 19:50:21 +00:00
Guy Harris 916e8fc1bb Clarify that, in the Linux USB capture format, the header is always
followed by 8 bytes of "struct usb_device_setup_hdr", even if there's no
setup information, but it should be interpreted only if setup_flag is 0.
(That's what those mysterious 8 bytes are.)

svn path=/trunk/; revision=27043
2008-12-17 23:24:51 +00:00
Stig Bjørlykke 078e09692a Added support for open TNEF files directly.
No we can decode those winmail.dat files.

svn path=/trunk/; revision=26864
2008-11-27 16:40:45 +00:00
Anders Broman 95451b54f8 From Max Filippov:
patch to support IEE802.15.4 non-ASK PHY.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2906

svn path=/trunk/; revision=26792
2008-11-16 17:15:49 +00:00
Bill Meier 8afa208ffb Windows build: #include winsock2.h only when needed.
#include winsock2.h pulls in about 90 distinct .h files
and about 140 total .h files. 
Currently winsock2.h is (mostly unnecessarily) included
for each dissector via packet.h/wtap.h.
This patch removes #include winsock2.h from wtap.h and 
then includes winsock2.h (or windows.h) in the 
few specific places required. 
With this patch, my Windows Wireshark build takes 
about 30% less time.


svn path=/trunk/; revision=26535
2008-10-24 00:42:09 +00:00
Anders Broman 637761d295 From Francesco Fusco:
Endace ERFII (extension header) support.

svn path=/trunk/; revision=26287
2008-09-29 16:20:24 +00:00
Anders Broman c1e67bc6d0 From Márton Németh:
Clean up the Linux USB pseudoheader dissection.

svn path=/trunk/; revision=25990
2008-08-12 20:24:50 +00:00
Anders Broman 3eadb385c3 From Alexey Neyman:
Implement dissector for IPMB (DLT_IPMB_LINUX, 209).

svn path=/trunk/; revision=25986
2008-08-12 04:44:35 +00:00
Jeff Morriss ccd5751c19 packet-k12.c expects pseudo_header->k12.extra_info to be guchar so make it a unsigned
svn path=/trunk/; revision=25705
2008-07-11 16:37:21 +00:00
Guy Harris 5738a44654 Clean up indentation. There is no guarantee that tabs will appear
every 4 spaces or every 8 spaces, so just use spaces.

svn path=/trunk/; revision=25162
2008-04-24 00:08:19 +00:00
Anders Broman 155cb22957 From Hannes Kälber:
new WTAP_ENCAP files(X2E Xoraya serial frame and X2E Xoraya frame )
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2418

svn path=/trunk/; revision=25154
2008-04-23 20:23:09 +00:00
Stig Bjørlykke 7925fd5f2a From Rolf Fiedler (bug 2408):
This extends the EyeSDN wiretap module to be able to support:
- DSS1/Q.931
- PPP
- LAPB/X.25
- ATM raw cells
- SS7 MTP2

svn path=/trunk/; revision=25123
2008-04-20 11:53:31 +00:00
Gerald Combs 335927f46f From Hannes Kalber:
This patch adds some new ENCAP and FILE types for wiretap. It also adds new
entries to pcap_to_wtap_map[] to provide a mapping of the new types to some
pcap DLTs.

svn path=/trunk/; revision=24622
2008-03-14 00:01:51 +00:00
Anders Broman f9ad87dd7c From Owen Kirby :
IEEE 802.15.4 dissector and DLT_ type.

svn path=/trunk/; revision=24564
2008-03-05 20:30:03 +00:00
Jeff Morriss 810979a0b4 Add support for DLT_IPMB (199). The dissector for these packets is in http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1970 (pending review)
svn path=/trunk/; revision=24463
2008-02-25 21:55:41 +00:00
Stig Bjørlykke ef625890aa From Shane Kearns (bug 2237):
Added support for Symbian OS btsnoop.

The bluetooth HCI layer in Symbian OS can be configured to log all packets to a
file.  The log format, "btsnoop" is based on the RFC1761 "snoop" format - but
differences in the header make it incompatible.

The btsnoop format supports logging of these formats:
"H1" (raw HCI packets without framing)
"H4" (HCI UART packets including packet type header)
"H5" (HCI 3 wire UART packets including framing)
"BCSP" (HCI bluecore serial protocol including framing)

"H1" and "H4" are section numbers in the original v1 bluetooth specifications,
but still used colloquially - wireshark's existing support for Linux bluez HCI
logs uses the "H4" name.

In practice, the "H1" format is used for H5,BCSP and USB HCI logs, as the HCI
packet logs are mainly useful for debugging higher layers, bluetooth profiles
and bluetooth applications.

From me:
Deleted some unused prototypes.
Mark an unused parameter.

svn path=/trunk/; revision=24263
2008-02-03 21:11:53 +00:00
Jeff Morriss ed88c589b0 Add support for DLT_SCCP (SCCP without MTP2, MTP3, or any pseudo-header).
svn path=/trunk/; revision=24119
2008-01-17 17:55:38 +00:00
Ulf Lamping 4f565d1a4d add very experimental support for pcapng "PCAP Next Generation Dump File Format" - this is incomplete and buggy, be careful!
svn path=/trunk/; revision=24079
2008-01-13 20:05:07 +00:00
Stig Bjørlykke fa34d46851 From Fulko Hew:
1/ patches to support the libpcap/SITA format 'WTAP_ENCAP_SITA'.
2/ patches to the LAPB dissector to accept MLP (Multi-link protocol)
   (although MLP dissection has _not_ been added (yet)).
3/ New protocol dissectors for:
   a) SITA's WAN layer 0 status header,
   b) An airline protocol ALC,
   c) An airline (and other industry) protocol UTS.

These patches are submitted as a set since the new protocol dissectors are not
useful without the libpcap/SITA related changes, and there is no point in
having those changes without the additional dissectors.

This fixes bug/enhancement 2016.

svn path=/trunk/; revision=23885
2007-12-16 14:21:37 +00:00
Stephen Fisher 8c0f4111ea Initial checkin of support to read TamoSoft's CommView packet capture files
per enhancement bug #1795.


svn path=/trunk/; revision=23558
2007-11-24 03:33:18 +00:00
Jeff Morriss 0f82a3e7e8 From Paolo Abeni via bug 1751:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1751

The patch adds support to wiretap for a new libpcap DLT for bluetooth captures.
This DLT carries the direction information, which now can be displayed
correctly.
The hci H4 dissector is updated to handle also the newly introduced wtap encap.

svn path=/trunk/; revision=23208
2007-10-16 17:19:16 +00:00
Anders Broman b9f9b33e0e From Florent DROUIN:
This is a replacement of the existing decoding of ERF files (Extensible Record
Format from Endace). 
For the decoding of the ERF files, according to the "type of record" given in
the ERF header, several decoders can be used. Up to now, the decoder is
determined according to an environment variable, or with a kind of heuristic.
And, all the treatment is done during the file extraction.

The new architecture, will separate the ERF file decoding, and the ERF record
decoding. The ERF records will be decoded with a specific dissector. This
dissector can be configured with options, to replace the environment variable.

http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1839

svn path=/trunk/; revision=23092
2007-10-08 11:41:21 +00:00
Ulf Lamping 474bdf9687 fix some comments and sort functions by functionality
svn path=/trunk/; revision=23063
2007-10-03 17:59:33 +00:00
Sake Blok 47ec0bead9 (http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1717)
This patch adds support for the Juniper NetScreen snoop output format. 
It takes a text-dump op the captured packets and parses the headers 
and hex-data. Since the snoop files on a Junpiper NetScreen can be saved 
to a tftp-server, this patch makes it quite easy to use the snoop 
function of the Juniper NetScreen firewalls.

/* XXX TODO:
 *
 * o  Create a wiki-page with instruction on how to make tracefiles
 *    on Juniper NetScreen devices. Also put a few examples up
 *    on the wiki (Done: wiki-page added 2007-08-03)
 *
 * o  Use the interface names to properly detect the encapsulation
 *    type (ie adsl packets are now not properly dissected)
 *    (Done: adsl packets are now correctly seen as PPP, 2007-08-03)
 *
 * o  Pass the interface names and the traffic direction to either
 *    the frame-structure, a pseudo-header or use PPI. This needs
 *    to be discussed on the dev-list first
 *    (Posted a message to wireshark-dev abou this 2007-08-03)
 *
 */


svn path=/trunk/; revision=22533
2007-08-17 08:03:32 +00:00
Gerald Combs d1a745f27b Add support for PPI (the Per-Packet Information header), described at
http://www.cacetech.com/documents/PPI_Header_format_1.0.pdf .

svn path=/trunk/; revision=22094
2007-06-13 22:36:58 +00:00
Guy Harris 230c951306 From Stephen Donnelly of Endace:
The code for reading ERF files has not been significantly
	updated since 2004.  This patch brings it up to date with a
	number of changes.

	1) Increase number of decodable ERF types from 7 to 12. This
	   covers newer DAG card models and firmware updates.

	2) Fix timestamp conversion. Was calculating only microsecond
	   precision, now displaying with nanosecond resolution.  Hardware
	   precision is 7.5 to 30 ns depending on model.

	3) Allow the user to specify HDLC encapsulation as 'chdlc',
	   'ppp_serial', 'frelay' or 'mtp2'.  This is needed because the
	   ERF HDLC capture formats do not include information on what
	   protocol is used at the next level.  This is currently done via
	   an environment variable 'ERF_HDLC_ENCAP' and is analagous to the
	   existing 'ERF_ATM_ENCAP' variable.

	   If the user does not specify an HDLC encapsulation it tries to
	   guess, and falls back to MTP2 for backwards compatibility with
	   Florent's existing behaviour.

	   I know environment variables are ugly, suggestions are welcome.

	4) When reading HDLC captures as MTP2, use
	   WTAP_ENCAP_MTP2_WITH_PHDR rather than WTAP_ENCAP_MTP2.  This
	   allows us to put the 'Multi-Channel ERF' record 'channel
	   number' field into the MTP2 pseudo header > 'link_number'
	   field.  This is then displayed in Frame information, and can
	   be filtered on.  (Would be nice if it could be made a display
	   column?)

	Because the ERF record does not specify whether Annex A is used
	or not, we pass MTP2_ANNEX_A_USED_UNKNOWN and allow the existing
	user preference to decide.

Move the MTP2_ANNEX_A_ definitions into Wiretap, make the annex_a_used
field a guint8, and change MTP2_ANNEX_A_USED_UNKNOWN to 2 so it fits in
a guint8.  (This means that if you can save an ERF MTP2 file as a
libpcap file, the pseudo-header will have MTP2_ANNEX_A_USED_UNKNOWN in
it.)

svn path=/trunk/; revision=22067
2007-06-08 17:06:13 +00:00
Luis Ontanon 475916db3c Actually implement wtap_register_file_type() and have it returning the ID of the new file type.
Add few functions to wiretap's exported API.



svn path=/trunk/; revision=22060
2007-06-06 20:56:38 +00:00
Luis Ontanon 9e7615967b remove the never used wiretap/wtap-plugins.c
svn path=/trunk/; revision=21936
2007-05-25 17:23:46 +00:00
Ulf Lamping 3c2089e582 fix win32 build by using wtap_get_num_file_types() instead of direct variable access
svn path=/trunk/; revision=21689
2007-05-05 10:47:35 +00:00
Luis Ontanon 131cecd1e8 Add a plugin interface to wiretap.
So far I've done only regression testing (the new functionality and what's in wtap-plugins.c has not yet being tested).

it is a first step in the way to have lua opening files.



svn path=/trunk/; revision=21686
2007-05-04 21:10:55 +00:00
Luis Ontanon d4fd968d50 add support for the text export format of textronix k1[25]
svn path=/trunk/; revision=21651
2007-05-02 20:09:42 +00:00
Ronnie Sahlberg 430eef27fe From Shaun Jackman
Wiretap support to read MPEG files


svn path=/trunk/; revision=21112
2007-03-22 10:44:33 +00:00
Luis Ontanon 7432291121 From: Kriang Lerdsuwanakij
In the attached patch, the K12 wiretap now saves the content of record
after captured packet data. The K12 dissector then could extract them and provide
useful information to properly dissect FP frames (user plane of UTRAN Iub
interface).



svn path=/trunk/; revision=20749
2007-02-08 17:35:03 +00:00
Guy Harris 9633ac8fee From Paolo Abeni: update to support the new DLT_USB_LINUX format header.
Modified to support the header as a pseudo_header rather than as part of
the packet data.

Fixed some calls that fetch data from the USB packet to fetch it in
little-endian byte order.

Got rid of redundant code to get conversation-specific data (the
get_usb_conv_info() call already does that).

For control packets, only parse the setup information if setup_flag is
0.

Don't interpret a control packet as a standard request unless the setup
type is "Standard".

svn path=/trunk/; revision=20632
2007-01-30 20:07:55 +00:00
Guy Harris dd54b08eda Put in some information about RSSI.
svn path=/trunk/; revision=20498
2007-01-19 05:22:43 +00:00
Guy Harris 0fb0fa8794 Put
#ifdef __cplusplus
	extern "C" {
	#endif /* __cplusplus */

		...

	#ifdef __cplusplus
	}
	#endif /* __cplusplus */

wrappers into some header files, for the benefit of C++ plugins.  Also,
add multiple-include protections.

svn path=/trunk/; revision=20485
2007-01-18 18:43:30 +00:00
Jaap Keuter 224a21ecfe From Mark C. Brown:
HP-UX 11.31 will add a new nettl trace subsystem, NS_LS_TELNET (ID=267).
NS_LS_TELNET is just raw telnet data.  There is no layer 2/3/4 headers, so
there's just the HP-UX nettl record header followed directly by the TCP payload
for a telnet connection.  Thus the need for a new wiretap encapsulation type...

svn path=/trunk/; revision=20253
2007-01-01 14:48:18 +00:00
Guy Harris 252230934a Add Wiretap encapsulation type for IEEE 802.16 MAC Common Part Sublayer,
for which a DLT_ value and LINKTYPE_ value have just been assigned.

svn path=/trunk/; revision=20003
2006-11-27 18:10:12 +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
Ronnie Sahlberg 26f642778f From Paolo Abeni
USB dissector


svn path=/trunk/; revision=19480
2006-10-10 21:00:35 +00:00
Martin Mathieson 2e1177c328 For DCT2000, show better transport info:
- for FP over AAL2, add CID to AAL tree
- for IPPRIM protocols, show IPV4 addresses in src & dst columns

svn path=/trunk/; revision=19156
2006-09-05 16:05:23 +00:00
Martin Mathieson 76192b1c6c Partial implementation of UMTS FP. Currently only works with Catapult DCT2000 format files, as need extra information about packet when decoding. There are a few TODOs (notably E-DCH channels), but the current version gives OK coverage.
svn path=/trunk/; revision=19130
2006-09-04 11:04:14 +00:00
Anders Broman d221d6f2fc From Hannes Gredler:
A patch that adds support for dissection of
libpcap DLT_JUNIPER_VP frames. In addition i have fixed
also the indent for DLT_JUNIPER_GGSN.

svn path=/trunk/; revision=18940
2006-08-17 20:24:05 +00:00
Ulf Lamping 0e1a8a8023 add file extension information (filter "*.pcap;*.cap" and default extension ".pcap") to wiretap
sort file types in alphabetical order, but keep the libpcap like entries at the start

svn path=/trunk/; revision=18562
2006-06-23 18:20:34 +00:00
Graeme Lunt abefaf32bf Basic Encoding Rules (BER) encoded file reading. Not really a packet trace format but still useful for dissecting arbitrary BER/DER ASN.1.
svn path=/trunk/; revision=18110
2006-05-08 19:56:36 +00:00
Anders Broman 375ba77274 From Martin Mathieson:
These patches:
- fix the bounds errors reported by coverity in bug 879
- fix a couple of other potential bounds errors (length checking 1st & 2nd lines in file)
- reorder catapult_dct2000_phdr so that normal protocol pseudo-header info is at the start.  This means that the stub dissector can avoid the nasty
(overlapped) memcpy
- a little whitespace fixing

svn path=/trunk/; revision=17886
2006-04-17 18:46:14 +00:00
Guy Harris 701b569104 Get rid of the unused WTAP_ENCAP value - holes in the number space cause
ugly printouts for "editcap -T".

svn path=/trunk/; revision=17873
2006-04-16 10:38:47 +00:00
Anders Broman af554c2f75 From Martin Mathieson:
patch and new files provide support for Catapult DCT2000 
.out files to wiretap and ethereal.

This wiretap support (catapult_dct2000.c+h) appends a short header to 
each packet giving some context, and a corresponding ethereal dissector 
(packet-catapult-dct2000.c) parses this before passing the real payload 
onto an existing ethereal dissector (for ethernet, ip, lapd, ppp, 
frame-relay,...).

For now, there is only support for saving dct2000 files in their own 
format, although I may add support for converting between dct2000 and 
libpcap later.

updated version of these files and patch, now with support 
for MTP2.  Olivier's trace used the ANSI variant - the MTP2 and MTP3 
decode fine with the right preferences set (although the ISUP dissector 
reports a reserved/retired message type).

Witha a change to NOT to declare gboolean catapult_dct2000_board_ports_only;
as extern as MSVC choked on it.

svn path=/trunk/; revision=17862
2006-04-14 12:41:06 +00:00
Anders Broman 497e0ec775 From Daniele Orlandi:
The attached patch adds support for LAPD frames captured using vISDN thru 
libpcap. The support has already been included in libpcap.

The patch adds a new wiretap encapsulation, the necessary glue to decode 
SLL-encapsulated frames, and some minor change in the LAPD dissector in order 
to support the remote-to-remote frames captured on the ISDN E-Channel.

Please apply ethereal-encap-table.diff before, as it fixes a misalignment in 
the encapsulation names table.

svn path=/trunk/; revision=17450
2006-03-02 21:28:05 +00:00
Luis Ontanon 5113ab4d4a Add support for Juniper GGSN generated pcap files.
svn path=/trunk/; revision=16857
2005-12-19 19:18:20 +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
Anders Broman 973bdcb507 From Mark C Brown,
Small patch correcting nettl.uid to unsigned and adding pduin/pduout as nettl.kind values...

svn path=/trunk/; revision=16320
2005-10-26 19:01:29 +00:00
Luis Ontanon 74d1997f40 forgot this from the last commit
svn path=/trunk/; revision=16297
2005-10-24 21:52:14 +00:00
Anders Broman df21536710 From Hannes Gredler:
patch to support 4 additional juniper DLTs.

all those are wrappers for exisiting media types augmented with meta-information which gets also displayed using this patch;

svn path=/trunk/; revision=15908
2005-09-20 20:25:55 +00:00
Ulf Lamping 84cf7ce767 added compression support for capture file output. The Save/As dialog now has a checkbox "Compress with gzip"
currently limited to Ethereal and all the variants of libpcap filetypes only.

We might want to add output compression support to the other tools as well (tethereal, mergecap, ...).

We might also want to add support for the other filetypes, but this is only possible if the filetype functions doesn't use special output operations like fseek.

One bug is still left: if the input and output filetypes while saving are the same, Ethereal currently optimizes this by simply copy the binary file instead of using wiretap (so it will be faster but it will ignore the compress setting). 

Don't know a good workaround for this, as I don't know a way to find out if the input file is currently compressed or not. One idea might be to use a heuristic on the filesize (compared to the packet size summmary). Another workaround I see is to remove this optimization, which is of course not the way I like to do it ...

svn path=/trunk/; revision=15804
2005-09-14 21:57:30 +00:00
Ulf Lamping 4cd4f9a669 Add support for slightly modified libpcap file format with nanosecond resolution (currently supported by Ethereal only). Support for both read and write was added.
The file format stays the same as the common libpcap format, only the lower part of the timestamp field uses nanoseconds instead of microseconds.

This file format uses the libpcap magic number 0xa1b23c4d.

svn path=/trunk/; revision=15623
2005-08-30 09:43:47 +00:00
Ulf Lamping 723c80ea90 timestamp display precision:
- automatic adjustment depending on file format
- manual adjustment through menu items

save the setting in the recent file

svn path=/trunk/; revision=15534
2005-08-25 21:29:54 +00:00
Ulf Lamping 6f43fbb2f0 EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ...

What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere.

As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon.

Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way...

As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number...

svn path=/trunk/; revision=15520
2005-08-24 21:31:56 +00:00
Guy Harris 38ec1644e6 Add APIs to Wiretap to return the file of the size as supplied by the OS
(so if the file's gzipped, it's *NOT* the size of the file after
uncompressing), and an approximation of the amount of that data read
sequentially so far.

Use those for various progress bars and the like.

Make the fstat() in the Ascend trace reader directly use wth->fd, as
it's inside Wiretap; that gets rid of the last caller of wtap_fd() (as
we're no longer directly using fstat() or lseek() in Ethereal), so get
rid of wtap_fd().

svn path=/trunk/; revision=15437
2005-08-19 19:40:00 +00:00
Anders Broman 8b0ed89155 From Hannes Gredler
- add support for Multi-Link Frame-Relay (FRF.15) captures
  taken on Juniper ML-, LS-, AS- PICs.

- rework of the common juniper header dissector:
    test the extension flag (0x80) which indicates that there are
    meta-information like interface-index, interface-name etc.
    present

- minor bugfix (LSQ L3-proto masks, direction masks were broken)

svn path=/trunk/; revision=15316
2005-08-12 21:08:02 +00:00
Jörg Mayer e1c6d9ac3d Fix some warnings (and one of my previous 'fixes')
svn path=/trunk/; revision=14997
2005-07-22 17:57:40 +00:00
Anders Broman bd12fbef7f From Hannes Gredler:
support for support for DLT_JUNIPER_MLPPP

svn path=/trunk/; revision=14994
2005-07-22 15:55:06 +00:00
Luis Ontanon 6aead4f02c third and last(?) iteration on the import routines for tektronix 32bit rf5 files.
Now the import is correct even for large files.
I found out when and where the "junk" was inserted.


svn path=/trunk/; revision=14646
2005-06-16 02:27:30 +00:00
Luis Ontanon 851d6b9a5e use a helper dissector to show k12 files.
svn path=/trunk/; revision=14621
2005-06-13 19:45:21 +00:00
Luis Ontanon e0dc2b2a9a Initial checkin of the 32 bit tektronix k12 binary format (rf5)
There is still much to do, but at the very least it can import files allowing the user to choose which protocols handle the diferent sources.


svn path=/trunk/; revision=14606
2005-06-10 16:01:16 +00:00
Anders Broman 8e48f993ae From Mark C Brown,:
Fixes for LAP-B (SX25L2) and X.25 (SX25L3) nettl trace records.

svn path=/trunk/; revision=14385
2005-05-17 19:50:38 +00:00
Gilbert Ramirez 25dd1ce767 Add WTAP_GCOM_TIE1 and WTAP_GCOM_SERIAL for
Oolan Zimmer <ethereal@gcom.com>

svn path=/trunk/; revision=14362
2005-05-13 19:44:25 +00:00
Ronnie Sahlberg 4e3c7cc716 From Hannes Gredler
support for Juniper PPPOE encapsulation


svn path=/trunk/; revision=14346
2005-05-11 11:24:17 +00:00
Michael Tüxen 23d022349d - Add support for libpcap files for MTP2 with a per packet header
indicating the direction, narrowband/broadband, and interface number.
- Add support to display the direction and interface number.
- Add support to packet-mtp2.c to use the broadband/narrowband indication.

svn path=/trunk/; revision=14265
2005-05-02 14:07:33 +00:00
Guy Harris 466c3e9c8d Make editcap use wtap_read(); that eliminates the last user of
wtap_loop(), so eliminate wtap_loop().

svn path=/trunk/; revision=14006
2005-04-03 11:00:49 +00:00
Ronnie Sahlberg 3b435e70a3 From Mark C Brown NETTL updates
svn path=/trunk/; revision=13999
2005-04-01 10:17:05 +00:00
Gerald Combs 9e93bf4747 From Josh Bailey:
Attached is an update to Lucent/Ascend trace parsing: fix a few bugs,
add support for ISDN and Ethernet captures - diffs to 0.10.9.


svn path=/trunk/; revision=13311
2005-02-05 17:39:12 +00:00
Guy Harris 467ece8920 From Florian Lohoff: Redback SmartEdge SE400/800 tcpdump disassembly.
svn path=/trunk/; revision=13212
2005-01-31 03:03:02 +00:00
Guy Harris c29e427533 From Yoshihiro Oyama: support "-" as a file name, referring to the
standard input.  Opening it for random access isn't supported; we add a
new error for that.

svn path=/trunk/; revision=13189
2005-01-28 11:31:19 +00:00
Guy Harris 36e8efcbca From Hannes Gredler: support for Juniper's DLT_JUNIPER_ATM{1,2} values.
svn path=/trunk/; revision=13130
2005-01-20 05:40:56 +00:00
Guy Harris 2f01986159 Add an entry for the new DLT_GPRS_LLC (so that nobody working on
Ethereal, unaware that the Ethereal team does *NOT* control libpcap
format, thinks they can just grab 169 and use it for their own
purposes).

svn path=/trunk/; revision=12678
2004-12-07 17:54:08 +00:00
Guy Harris 1e6a5d408c As Sam Leffler notes, the radiotap header isn't BSD-only, it's also used
by his madwifi Atheros driver on Linux; rename
WTAP_ENCAP_IEEE_802_11_WLAN_BSD to WTAP_ENCAP_IEEE_802_11_WLAN_RADIOTAP,
and change its text name from "ieee-802-11-bsd" to
"ieee-802-11-radiotap".

svn path=/trunk/; revision=12429
2004-10-29 02:40:01 +00:00
Guy Harris 3cdebd31db From Mark C. Brown: fix support for nettl NETTL_SUBSYS_NS_LS_ICMP and
NETTL_SUBSYS_NS_LS_ICMPV6 - they don't even have IP headers, so we need
to directly call the ICMP and ICMPv6 dissectors.

svn path=/trunk/; revision=12047
2004-09-19 07:13:52 +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