Commit Graph

501 Commits

Author SHA1 Message Date
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
Guy Harris c16562407d Add an encapsulation type for BACnet MS/TP, and map the newly-assigned
libpcap DLT_ value for BACnet MS/TP to it.

svn path=/trunk/; revision=11126
2004-06-07 20:28:51 +00:00
Guy Harris 30b2831847 Add support for DLT_APPLE_IP_OVER_IEEE_1394.
svn path=/trunk/; revision=10446
2004-03-23 01:02:41 +00:00
Guy Harris 48cd9f9358 Add support for DLT_ value 99, as used by the Axent Raptor
firewall/Symantec Enterprise Firewall.  Thanks, Axent/Symantec, for not
asking us for a DLT_ value and not telling us about the link-layer type.

svn path=/trunk/; revision=10361
2004-03-11 09:18:33 +00:00
Guy Harris 2df960325a From Rolf Fiedler: support for reading EyeSDN USB S0 trace files.
svn path=/trunk/; revision=10038
2004-02-11 20:05:16 +00:00
Guy Harris cf131d9e16 The DLT_ value 127 is being used for the BSD radio header, and the
current CVS libpcap uses 163 for the AVS radio header (127 was never
used for the AVS radio header).  Redo the Wiretap encapsulation values
for that (and shuffle them to put the 802.11 Wiretap values together).

svn path=/trunk/; revision=9904
2004-01-29 10:58:28 +00:00
Guy Harris 677db2dadd From Tomas Kukosa: reserve private WTAP_ENCAP values and map them to
reserved private DLT_ values.

svn path=/trunk/; revision=9892
2004-01-28 01:24:30 +00:00
Guy Harris 2528c053ce Supply a pseudo-header for all 802.11 packets; add an "fcs_len" field to
it, similar to the Ethernet pseudo-header's "fcs_len" field, and use it
in the 802.11 dissector.

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

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

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

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

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

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

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

svn path=/trunk/; revision=9852
2004-01-25 21:55:17 +00:00
Guy Harris b8299f0b98 From Jan Kiszka: IrDA support.
svn path=/trunk/; revision=9345
2003-12-18 19:07:14 +00:00
Guy Harris 02260b4056 From Jeff Morriss: add support for libpcap MTP2 and MTP3 captures.
Add a missing entry in "encap_table[]" for Bluetooth H4, and fix some
comments.

svn path=/trunk/; revision=9157
2003-12-03 22:40:39 +00:00
Guy Harris fe73d8e3b6 From Martijn Schipper: support for reading AiroPeek files in V9 capture
file format (AiroPeek 2.x).

svn path=/trunk/; revision=9144
2003-12-02 19:37:05 +00:00
Guy Harris 0247fbeb15 From Scott Emberley: support for reading Network Instruments version 9
capture files.

svn path=/trunk/; revision=8840
2003-10-31 00:43:21 +00:00
Guy Harris 95c1f2f7c9 From Marcel Holtmann: support for reading Linux Bluez Bluetooth stack
"hcidump -w" traces.

Note that Jesper Peterson contributed support for reading Endace ERF
files.

svn path=/trunk/; revision=8824
2003-10-30 03:11:03 +00:00
Guy Harris b624dce63b Add a new WTAP_ENCAP_CHDLC_WITH_PHDR type, to distinguish Cisco HDLC
captures with packet direction information from captures without it.
Use them appropriately.

svn path=/trunk/; revision=8780
2003-10-25 07:17:28 +00:00
Guy Harris be2736adcf Have a pseudo-header for Ethernet packets, giving the size of the FCS -
0 means "there is no FCS in the packet data", 4 means "there is an FCS
in the packet data", -1 means "I don't know whether there's an FCS in
the packet data, guess based on the packet size".

Assume that Ethernet encapsulated inside other protocols has no FCS, by
having the "eth" dissector assume that (and not check for an Ethernet
pseudo-header).

Have "ethertype()" take an argument giving the FCS size; pass 0 when
appropriate.

Fix up Wiretap routines to set the pseudo-header.  This means we no
longer use the "generic" seek-and-read routine, so get rid of it.

svn path=/trunk/; revision=8574
2003-10-01 07:11:49 +00:00
Guy Harris 4ecb7cb4f2 From Jesper Peterson: support for Endace ERF file format.
svn path=/trunk/; revision=8272
2003-08-26 07:10:39 +00:00
Guy Harris 2240c0668d From Thierry Martin: support for reading files from Accellent 5Views LAN
agents.

svn path=/trunk/; revision=8093
2003-07-29 19:42:01 +00:00
Guy Harris 9fa514388c GCC 3.3 noticed that checking whether the length of the slice is > 65535
is pointless, as it's a 16-bit unsigned quantity.  Remove those checks -
but note in a comment that WTAP_MAX_PACKET_SIZE must be at least 65535
(as there might well be link-layer types with packets at least that
large).

svn path=/trunk/; revision=7934
2003-06-25 17:35:17 +00:00
Guy Harris 86f3c38c4a From Can Erkin Acar: OpenBSD is now using tcpdump.org-assigned DLT_
value for DLT_PFLOG, and that goes along with a change to the link-layer
header for DLT_PFLOG - support both the old and new values and format.

svn path=/trunk/; revision=7676
2003-05-15 07:14:46 +00:00
Guy Harris ad8856029b WTAP_ENCAP_ENC was, in fact, intended for use for DLT_ENC, so just
rename WTAP_ENCAP_ENC0 to WTAP_ENCAP_ENC.

un-#if 0 out the code to handle the value 109 for DLT_ENC, as I've just
checked in support for DLT_ENC in tcpdump.org libpcap and tcpdump, which
maps DLT_ENC to 109 in the file header.

Give packet-enc.c an RCS ID.

svn path=/trunk/; revision=7323
2003-03-08 09:11:53 +00:00
Gerald Combs 0b94d9a228 From Markus Friedl:
Add support for the OpenBSD enc(4) encapsulating interface.  Add
  support for Ethernet over IP (RFC 3378).

Fold Markus' .h files into their respective .c files, add a define to
ipproto.h and use it.

svn path=/trunk/; revision=7310
2003-03-07 16:52:46 +00:00
Guy Harris f88816e60f Add WTAP_ENCAP_FRELAY_WITH_PHDR for use with Frame Relay capture files
that have direction information.

Support writing WTAP_ENCAP_FRELAY_WITH_PHDR and WTAP_ENCAP_PPP_WITH_PHDR
captures out in libpcap format - we throw away the direction
information, but so it goes.

When reading/writing Windows Sniffer format, read and write the
direction flag.

svn path=/trunk/; revision=7052
2003-01-31 01:02:14 +00:00
Guy Harris 8e6518ea60 In the BSDs, ARCNET packets don't have an offset field between the
addresses and the protocol type, as supplied by BPF; on Linux, they *do*
have an offset field, as supplied by PF_PACKET sockets.  Add a new
WTAP_ENCAP_ARCNET_LINUX, with packets that include the offset field, and
don't dissect an offset in WTAP_ENCAP_ARCNET packets.

Map a libpcap link-layer type of 129 to WTAP_ENCAP_ARCNET_LINUX; that
value was recently assigned to Linux-style ARCNET.

Add some more ARCNET protocol IDs.

For most protocol IDs, dissect an ATA 878.2 fragmentation header; don't
do it for RFC 1051 IP and ARP, and Diagnose packets.  Set the length of
the ARCNET protocol tree item appropriately.

Dissect both the RFC 1051 and RFC 1201 styles of IP and ARP over ARCNET,
and dissect the RFC 1201 style of RARP as well.

svn path=/trunk/; revision=6981
2003-01-23 04:04:01 +00:00
Guy Harris 50e696df81 The Sniffer file formats include a file to identify raw cells; export
that flag in the ATM pseudo-header, and use it to determine whether a
frame is a raw cell or a reassembled frame, rather than using the AAL,
as you can have raw AAL5 cells in a capture.

svn path=/trunk/; revision=6889
2003-01-10 04:04:42 +00:00
Guy Harris a0c5cac89d It appears that a channel number of 0 means DTE->DCE, and a channel
number of 1 means DCE->DTE, in DOS Sniffer ATM captures.

svn path=/trunk/; revision=6881
2003-01-09 01:55:13 +00:00
Guy Harris 94800ef0fb From Chris Waters: support Tazmen Sniffer Protocol and DLT_TZSP captures
from network-based libpcaps that use that protocol.

svn path=/trunk/; revision=6875
2003-01-08 05:03:54 +00:00
Guy Harris e56b77f4cd Add support for SDLC encapsulation in DOS Sniffer captures; that
includes adding an SDLC dissector.

svn path=/trunk/; revision=6848
2003-01-03 22:31:26 +00:00
Guy Harris 0a5be3f18b Rename WTAP_ENCAP_ATM_SNIFFER to WTAP_ENCAP_ATM_PDUS, as it's not just
used for the DOS-based ATM Sniffer.  (That's not a great name, but I
couldn't think of a better one.)

Add a new WTAP_ENCAP_ATM_PDUS_UNTRUNCATED encapsulation type for capture
files where reassembled frames don't have trailers, such as the AAL5
trailer, chopped off.  That's what at least some versions of the
Windows-based ATM Sniffer appear to have.

Map the ATM capture file type for NetXRay captures to
WTAP_ENCAP_ATM_PDUS_UNTRUNCATED, and put in stuff to fill in what we've
reverse-engineered, so far, for the pseudo-header; there's more that
needs to be done on it, e.g. getting the channel, AAL type, and traffic
type (or inferring them if they're not in the packet header).

svn path=/trunk/; revision=6840
2003-01-03 06:45:45 +00:00
Richard Sharpe 13970cc2eb This adds the beginning of support for Wellfleet HDLC to ngsniffer.c as
well as Cisco HDLC support. It compiles OK, but I do not claim that it is
not borken.

I will have to add a small dissector that eats the first two bytes and then
calls the Ethernet dissector as well, to complete the work.

svn path=/trunk/; revision=6809
2002-12-20 05:40:52 +00:00
Guy Harris c3674ba31c Sigh. We really *do* have to check whether a capture is a snoop or
Surveyor capture, as there's one link-layer type that UNICOS/mp snoop
treats one way and Shomiti Surveyor treats another way.  The only way to
check that is to look at the first record to see how much padding it
has.

svn path=/trunk/; revision=6750
2002-12-05 22:33:11 +00:00
Guy Harris 8ee4a65f76 From Solomon Peachy: support for new "wlancap" 802.11 extra-information
header.

Add overflow checks to "BYTES_ARE_IN_FRAME()", and cast all arguments to
unsigned values (negative values should never be passed) to squelch
compiler warnings.

svn path=/trunk/; revision=6567
2002-11-06 21:49:34 +00:00
Guy Harris 56f644145e Discard the WTAP_ENCAP_LAPD encapsulation type in favor of a
WTAP_ENCAP_ISDN encapsulation type, which includes a pseudo-header
giving the direction (user-to-network or network-to-user) and the
channel number.

Add a new circuit type, using the ISDN channel number as the circuit ID.

Add an ISDN dissector to put the direction and channel number into the
protocol tree and to call the appropriate dissector for the payload
based on the channel (LAPD for the D channel; V.120, PPP, or data for B
channels, based on some heuristics).

svn path=/trunk/; revision=6521
2002-10-31 07:12:42 +00:00
Guy Harris 2a54cd2a76 Add a Wiretap encapsulation type for RFC 2625 IP-over-Fibre Channel, and
map libpcap's DLT_IP_OVER_FC to it.

svn path=/trunk/; revision=6473
2002-10-22 09:11:13 +00:00
Jörg Mayer 64b6acac6d Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6115
2002-08-28 20:30:45 +00:00
Guy Harris c58356d62a Updates from Motonori Shindo.
svn path=/trunk/; revision=6000
2002-08-16 00:41:39 +00:00
Jörg Mayer bc82e18843 Add conditional include of winsock2.h again, so compilation with MSVC++
will work again without complaints.

svn path=/trunk/; revision=5925
2002-07-31 22:41:34 +00:00
Guy Harris 5d929e0e8f From Motonori Shindo: support for reading CoSine L2 debug output.
svn path=/trunk/; revision=5922
2002-07-31 19:27:57 +00:00
Guy Harris 6e21561be8 From Joerg Mayer:
All files:
  - Replace types from sys/types.h by those from glib.h
  - Replace ntoh family of macros from netinet/in.h and winsock2.h
    by g_ntoh family from glib.h
  - Remove now unneeded includes of sys/types.h, netinet/in.h and
    winsock2.h
wtap.h
  Move includes to the top

svn path=/trunk/; revision=5909
2002-07-29 06:09:59 +00:00
Guy Harris 44d19627ef From Graeme Hewson:
Allow "-" as the output file name in Wiretap, referring to the
	standard error.

	Optimize the capture loop.

Fix some of the error-message printing code in Ethereal and Tethereal.

Have Wiretap check whether it can seek on a file descriptor, and pass
the results of that test to the file-type-specific "open for output"
routine.  Have the "open for output" routines for files where we need to
seek when writing the file return an error if seeks don't work.

svn path=/trunk/; revision=5884
2002-07-16 07:15:09 +00:00
Guy Harris 8a9b35cb5e From Anand V. Narwani:
DOCSIS support, including support for "Ethernet" captures where
	    the raw frame is a DOCSIS frame rather than an Ethernet
	    frame (some Cisco cable-modem head-end gear can send out a
	    trace of all traffic on an Ethernet, but what it sends are
	    the raw bytes of DOCSIS frames, not Ethernet frames)

Get rid of second AUTHORS entry for Devin Heitmueller, merging its item
into the older entry.

Clean up the order of some lists of plugin items.

svn path=/trunk/; revision=5861
2002-07-12 22:52:43 +00:00
Guy Harris 73ef5a2753 WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3's
<packet32.h> includes <winsock2.h>; we include that rather than
<winsock.h>, to avoid errors due to conflicting declarations in
<winsock.h> and <winsock2.h>.

svn path=/trunk/; revision=5742
2002-06-23 10:32:36 +00:00
Guy Harris c2b438ddfa Add a Wiretap routine to process packets captured via libpcap, possibly
extracting a pseudo-header, for the use of SunATM captures.

Add support for SunATM capture.

svn path=/trunk/; revision=5652
2002-06-07 21:11:24 +00:00
Guy Harris 1b72ef68e6 Add a new error for attempts to open a pipe or FIFO for random access.
Have "wtap_open_offline()", if asked to open a FIFO, return that error
if it was asked to open the file for random access.

svn path=/trunk/; revision=5643
2002-06-07 07:47:58 +00:00
Guy Harris 586e97727f Add support for old NetXRay format.
svn path=/trunk/; revision=5576
2002-05-28 02:39:15 +00:00
Guy Harris ecb2a3939e Replace the "ngsniffer_atm" with an "atm" pseudo-header, which isn't
just an image of the ATM Sniffer data.  This means that Ethereal doesn't
have to know any ATM Sniffer-specific details (that's all hidden in
Wiretap), and allows us to add to that pseudo-header fields, traffic
types, etc. unknown to ATM Sniffers.

Have Wiretap map VPI 0/VCI 5 to the signalling AAL - for some capture
files, this might not be necessary, as they may mark all signalling
traffic as such, but, on other platforms, we don't know the AAL, so we
assume AAL5 except for 0/5 traffic.  Doing it in Wiretap lets us hide
those details from Ethereal (and lets Ethereal interpret 0/5 traffic as
non-signalling traffic, in case that happens to be what it is).

We may know that traffic is LANE, but not whether it's LE Control or
emulated 802.3/802.5; handle that case.

svn path=/trunk/; revision=5302
2002-04-30 08:48:27 +00:00
Guy Harris bf7e4ce909 Move the definition of the FROM_DCE bit in the "flags" field of a
"struct x25_phdr" to "wiretap/wtap.h".

Have two X.25 dissectors, one of which assumes that there's a "struct
x25_phdr" pseudo-header and one of which doesn't; the former uses the
information in that pseudo-header to determine whether the packet is
DTE->DCE or DCE->DTE, and the latter assumes it has no clue whether the
packet is DTE->DCE or DCE->TDE.  Use the former one in the LAPB
dissector, and the latter one in the XOT dissector and in the LLC
dissector table.

In the X.25-over-TCP dissector, handle multiple X.25 packets per TCP
segment, and handle X.25 packets split across TCP segments.

svn path=/trunk/; revision=5134
2002-04-09 08:15:04 +00:00
Guy Harris b2c46086c3 Use WTAP_ENCAP_IEEE_802_11_WITH_RADIO for AiroPeek files, rather than
having a special encapsulation type for AiroPeek files.

svn path=/trunk/; revision=5123
2002-04-08 09:44:42 +00:00
Guy Harris 939b3c8e0a Add an encapsulation type for "802.11 with radio information"; that type
returns radio information such as signal strength, channel, and data
rate in a pseudo-header.  Add that pseudo-header.

Use the "802.11 with radio information" encapsulation type for Wireless
Sniffer files; extract the radio information from where it appears to be
in the header.

Add dissector code for that encapsulation type.

Fix an error in the code to put radio information into the AiroPeek
tree.

Make the "wrapped" flag for NetXRay/Windows Sniffer captures a
"gboolean".

svn path=/trunk/; revision=5122
2002-04-08 09:09:49 +00:00
Guy Harris b5e9cef2bf Make "wtap_seek_read()" return TRUE on success and FALSE on error, like
"wtap_read()".

Add some additional error checks to the Sniffer file reader.

svn path=/trunk/; revision=4875
2002-03-05 08:40:27 +00:00
Guy Harris e300f4db52 Have "wtap_seek_read()" return 0 on success and -1 on failure, and take
an "err" argument that points to an "int" into which to put an error
code if it fails.

Check for errors in one call to it, and note that we should do so in
other places.

In the "wtap_seek_read()" call in the TCP graphing code, don't overwrite
"cfile.pseudo_header", and make the buffer into which we read the data
WTAP_MAX_PACKET_SIZE bytes, as it should be.

In some of the file readers for text files, check for errors from the
"parse the record header" and "parse the hex dump" routines when reading
sequentially.

In "csids_seek_read()", fix some calls to "file_error()" to check the
error on the random stream (that being what we're reading).

svn path=/trunk/; revision=4874
2002-03-05 05:58:41 +00:00
Guy Harris f9c109a239 Support in Wiretap for DLT_HHDLC, from Tomas Kukosa.
svn path=/trunk/; revision=4707
2002-02-07 20:41:28 +00:00
Guy Harris a9f7ef5058 Update a comment.
svn path=/trunk/; revision=4655
2002-02-01 00:10:03 +00:00
Guy Harris a66d50bbf2 Untested support for AiroPeek captures.
svn path=/trunk/; revision=4619
2002-01-29 09:45:58 +00:00
Guy Harris c873f79156 Support for capturing on, and reading captures from, OpenBSD firewall
logging virtual interface, from Mike Frantzen.

svn path=/trunk/; revision=4616
2002-01-29 08:44:53 +00:00
Guy Harris 0a979b81b8 Get rid of "m"/"M" and other Macintosh references in names - it appears
that EtherPeek for Windows uses the same format as EtherPeek for MacOS,
so the code isn't specific to the MacOS version.

Check the physMedium value in the secondary header, and leave a
placeholder for a value of 1, which is presumably used in AiroPeek
captures.

Treat unknown mediaType and physMedium values as indications that we
don't have a *Peek file, not as unsupported *Peek files - we need all
the heuristics we can get.

svn path=/trunk/; revision=4601
2002-01-23 06:32:52 +00:00
Guy Harris 6cdc5dfde2 In the EtherPeek file reader, keep the capture start time in a private
data structure attached to the "wtap" structure, rather than in a
pseudo-header structure; get rid of the EtherPeek pseudo-header
structure, as it's not actually used as a pseudo-header, it's just used
as private data for the EtherPeek reader.

Get rid of an extra level of indentation in switch statements.

svn path=/trunk/; revision=4561
2002-01-18 00:25:50 +00:00
Guy Harris bc225c2a87 Support for reading Visual Networks traffic capture files, from Tom
Nisbet.

Make a comment in "wiretap/file.c" clearer, so people know where to put
the entries for their capture file type.

svn path=/trunk/; revision=4328
2001-12-04 22:28:19 +00:00
Guy Harris 8032fa8a1b Make the bytes-written information from Wiretap a long, as we allow
files to get that big.

From Thomas Wittwer and Matthias Nyffenegger:

Support for "ring buffer mode", wherein there's a ring buffer of N
capture files; as each capture file reaches its maximum size (the ring
buffer works only with a maximum capture file size specified), Ethereal
rolls over to the next capture file in the ring buffer, replacing
whatever packets might be in it with new packets.

svn path=/trunk/; revision=4323
2001-12-04 08:26:00 +00:00
Guy Harris a1660d6d3a Support for stopping capture at specified capture file size or capture
duration, from Thomas Wittwer and Matthias Nyffenegger.

svn path=/trunk/; revision=4322
2001-12-04 07:32:05 +00:00
Guy Harris a7bb49b0d9 Add support for LocalTalk Link Access Protocol.
Rename WTAP_ENCAP_PRISM to WTAP_ENCAP_PRISM_HEADER, to match
DLT_PRISM_HEADER.

Add in missing capture support for WTAP_ENCAP_PRISM_HEADER when
capturing with "pcap_open_live()" rather than reading the capture from a
pipe.

svn path=/trunk/; revision=4299
2001-11-30 07:14:22 +00:00
Guy Harris 56636f157a Support for 802.11+Prism II monitor-mode link-layer headers, from
Tim Newsham.

Add in missing item for WTAP_ENCAP_CISCO_IOS in the Wiretap
encapsulation type table.

svn path=/trunk/; revision=4290
2001-11-28 07:11:11 +00:00
Gilbert Ramirez f14a6b8b91 Hopefully the last time I have to change my e-mail address.
svn path=/trunk/; revision=4199
2001-11-13 23:55:44 +00:00
Guy Harris 6910b84deb Add in some heuristics to try to detect AIX libpcap format. (This works
with one capture I've seen, but perhaps that was done with an old
version of AIX, and newer versions use a minor version number, in the
file, of 4.

However, libpcap hasn't used a minor version of 2 for ages, so perhaps
AIX hasn't updated their libpcap in ages, and aren't about to do so
soon.  If they do, let's hope they change the magic number.  The capture
file in question *does* have the capture length and real length in the
old, pre-2.3, order, so it really looks as if it's an old version,
rather than IBM trying to be "helpful" by using a different minor
version number so that you can distinguish between normal libpcap and
AIX libpcap formats.)

svn path=/trunk/; revision=4164
2001-11-06 01:55:14 +00:00
Gilbert Ramirez 0326e32563 Support DLT_CISCO_IOS.
svn path=/trunk/; revision=4126
2001-11-02 13:00:30 +00:00
Guy Harris 9c0c25dc17 DBS Etherwatch wiretap module, from Marc Milgram.
svn path=/trunk/; revision=4042
2001-10-19 20:18:48 +00:00
Guy Harris 3c78feeadc VMS TCPIPtrace wiretap module, from Marc Milgram.
Update the lists of known capture file formats in the Tethereal,
editcap, and mergecap man pages to match the current list (as found in
the Ethereal man page).

svn path=/trunk/; revision=4039
2001-10-18 20:29:56 +00:00
Guy Harris 3c9efdf478 Use longs as file offsets, so that on platforms with 64-bit "long" we
can handle capture files bigger than 2GB.

svn path=/trunk/; revision=3993
2001-10-04 08:30:36 +00:00
Guy Harris c80cd072ac Update the URL for ATM-on-Linux.
svn path=/trunk/; revision=3949
2001-09-23 21:55:21 +00:00
Guy Harris 537d308abe "open_cap_file()" in Ethereal and Tethereal don't use the FILE_T they
get from calling "wtap_file()", so get rid of the call and the
(otherwise unused) variable to which its result gets assigned.

That lets us get rid of "wtap_file()" in Wiretap.

It also lets us get rid of the include of "zlib.h" in "file.h"; the
#defines of "file_open()", "filed_open()", and "file_close()" are also
unnecessary, so we get rid of those as well.

However, that means we need to include <zlib.h> in "gtk/main.c" and
"tethereal.c", so that the version number of libz is defined and can
show up in the version string.

svn path=/trunk/; revision=3652
2001-07-05 00:34:42 +00:00
Guy Harris 7ecac8fbd0 Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSD
DLT_HDLC to it.

Make a separate dissector for Cisco HDLC, and add a dissector for Cisco
SLARP.  Have the PPP dissector call the Cisco HDLC dissector if the
address field is the Cisco HDLC unicast or multicast address.  Use the
Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type.

Add a new dissector table "chdlctype", for Cisco HDLC packet types
(they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not
Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example),
replacing "fr.chdlc".

Have a "chdlctype()" routine, similar to "ethertype()", used both by the
Cisco HDLC and Frame Relay dissectors.  Have a "chdlc_vals[]"
"value_string" table for Cisco HDLC types and protocol names.  Split the
packet type field in the Frame Relay dissector into separate SNAP and
Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type
"value_string" tables, respectively.

svn path=/trunk/; revision=3133
2001-03-15 09:11:03 +00:00
Guy Harris 99ec31082e Etherpeek version 5, 6, and 7 support, from Daniel Thompson.
svn path=/trunk/; revision=3066
2001-02-22 22:03:31 +00:00
Guy Harris 3f75680191 Code to handle Frame Relay Sniffer captures, from Jeff Foster.
Code to register the Frame Relay dissector to handle Frame Relay
captures, from Paul Ionescu.

svn path=/trunk/; revision=2845
2001-01-08 22:18:22 +00:00
Guy Harris 039805843b Add support for the DLT_LINUX_SLL capture type in the current CVS
version of libpcap; that's used on Linux for captures on the "any"
device (which captures from all interfaces simultaneously) and for
captures on devices whose link-layer type libpcap doesn't (yet) support
natively.

The spanning tree code, when checking for GV{M,R,...}P packets, must
first check whether the link-layer destination address is, in fact, an
Ethernet-style address; on Linux cooked captures, there *is* no
destination address, so it's of type AT_NONE, not AT_ETHER.

svn path=/trunk/; revision=2772
2000-12-23 08:06:16 +00:00
Guy Harris 7c3fcbac34 IEEE 802.11 support, from Johan Jorgensen of Axis Communications AB.
Add in stuff for a bunch of libpcap formats either in libpcap 0.5.2 or
in the current CVS version; we don't implement all of them in
Ethereal/Wiretap (those are "#if 0"ed out), but we do implement the IEEE
802.11 stuff (which isn't yet in libpcap or tcpdump, but the CVS version
of libpcap *does* reserve 105 as the encapsulation type number for
802.11).

svn path=/trunk/; revision=2646
2000-11-15 05:42:35 +00:00
Gilbert Ramirez c312f69abc Make sure to pass the sent/received direction from pppdump.c in
pseudo_header.
Use generic "p2p_phdr" instead of "lapd_phdr". Modify toshiba.c and
packet-lapd.c to take that into account.
Add frame.p2p_dir, a filterable field, 0=sent, 1=recvd
Make p2p_dir available in packe_info, as I think it will be needed
in VJ COMP and UNCOMP dissection.

Rename WTAP_ENCAP_TR to WTAP_ENCAP_TOKEN_RING.

Mention pppd-log support in man page.
Mention atmsnoop in README.

svn path=/trunk/; revision=2455
2000-09-21 04:41:37 +00:00
Gilbert Ramirez e191760a7b Add support for reading pppd log files in wiretap.
svn path=/trunk/; revision=2448
2000-09-19 17:22:11 +00:00
Guy Harris 6eccd35505 Code to read capture files from some version of tcpdump from some sort
of Nokia box (firewall) - yep, it's yet *another* mutant libpcap format
that didn't change the magic number, sigh....

svn path=/trunk/; revision=2440
2000-09-15 07:52:43 +00:00
Gilbert Ramirez f52ffba407 Change wtap_read() API so that the data offset is set via a pointer, and
a "keep reading" boolean value is returned from the function.
This avoids having to hack around the fact that some file formats truly
do have records that start at offset 0. (i4btrace and csids have no
file header. Neither does the pppdump-style file that I'm looking at right now).

svn path=/trunk/; revision=2392
2000-09-07 05:34:23 +00:00
Laurent Deniel 6a480953a9 Miscellaneous code cleaning
- add <stdarg.h> or <varargs.h> in snprintf.h
  and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes

- remove the check of multiple inclusions in source (.c)  code
  (there is a bit loss of _cpp_ performance, but I prefer the gain of
   code reading and maintenance; and nowadays, disk caches and VM are
   correctly optimized ;-).

- protect all (well almost) header files against multiple inclusions

- add header (i.e. GPL license) in some include files

- reorganize a bit the way header files are included:

  First:
  #include <system_include_files>
  #include <external_package_include_files (e.g. gtk, glib etc.)>
  Then
  #include "ethereal_include_files"

  with the correct HAVE_XXX or NEED_XXX protections.

- add some HAVE_XXX checks before including some system header files

- add the same HAVE_XXX in wiretap as in ethereal

Please forgive me, if I break something (I've only compiled and regression
tested on Linux).

svn path=/trunk/; revision=2254
2000-08-11 13:37:21 +00:00
Mike Hall c83d80de36 Added wiretap support to read the Cisco Secure Intrusion Detection System IPLog format.
svn path=/trunk/; revision=2231
2000-08-08 22:16:42 +00:00
Guy Harris 7de3b988bd In the final scene of the horror movie, just when you think the monster
is finally dead, and you're walking away, it springs up again and
attacks.

It appears that the ss990915 version of Alexey Kuznetzov's libpcap patch
has some extra stuff in the per-packet header for some sort of SMP
debugging, and that SuSE Linux 6.3 picked it up.

Thus, even if a libpcap file has the modified magic number, we *still*
have to go through the usual heuristic hell to figure out what type of
file it is.

svn path=/trunk/; revision=2164
2000-07-26 06:04:34 +00:00
Guy Harris 7843ac6d0e Add routines to Wiretap to allow a client of Wiretap to get:
a pointer to the "wtap_pkthdr" structure for an open capture
	file;

	a pointer to the "wtap_pseudo_header" union for an open capture
	file;

	a pointer to the packet buffer for an open capture file;

so that a program using "wtap_read()" in a loop can get at those items.

Keep, in a "capture_file" structure, an indicator of whether:

	no file is open;

	a file is open, and being read;

	a file is open, and is being read, but the user tried to quit
	out of reading the file (e.g., by doing "File/Quit");

	a file is open, and has been completely read.

Abort if we try to close a capture that's being read if the user hasn't
tried to quit out of the read.

Have "File/Quit" check if a file is being read; if so, just set the
state indicator to "user tried to quit out of it", so that the code
reading the file can do what's appropriate to clean up, rather than
closing the file out from under that code and causing crashes.

Have "read_cap_file()" read the capture file with a loop using
"wtap_read()", rather than by using "wtap_loop()"; have it check after
reading each packet whether the user tried to abort the read and, if so,
close the capture and return an indication that the read was aborted by
the user.  Otherwise, return an indication of whether the read
completely succeeded or failed in the middle (and, if it failed, return
the error code through a pointer).

Have "continue_tail_cap_file()" read the capture file with a loop using
"wtap_read()", rather than by using "wtap_loop()"; have it check after
reading each packet whether the user tried to abort the read and, if so,
quit the loop, and after the loop finishes (even if it read no packets),
return an indication that the read was aborted by the user if that
happened.  Otherwise, return an indication of whether the read
completely succeeded or failed in the middle (and, if it failed, return
the error code through a pointer).

Have "finish_tail_cap_file()" read the capture file with a loop using
"wtap_read()", rather than by using "wtap_loop()"; have it check after
reading each packet whether the user tried to abort the read and, if so,
quit the loop, and after the loop finishes (even if it read no packets),
close the capture and return an indication that the read was aborted by
the user if that happened.  Otherwise, return an indication of whether
the read completely succeeded or failed in the middle (and, if it
failed, return the error code through a pointer).

Have their callers check whether the read was aborted or not and, if it
was, bail out in the appropriate fashion (exit if it's reading a file
specified by "-r" on the command line; exit the main loop if it's
reading a file specified with File->Open; kill the capture child if it's
"continue_tail_cap_file()"; exit the main loop if it's
"finish_tail_cap_file()".

svn path=/trunk/; revision=2095
2000-06-27 07:13:42 +00:00
Guy Harris ae1f565029 Joerg Mayer's changes to add support for NetXRay file format version
2.002, as used by release 3.50 of the Network Associates Sniffer for
Windows; currently, we treat it just like the 2.001 version, so we
rename the version #define WTAP_FILE_NETXRAY_2_001 to
WTAP_FILE_NETXRAY_2_00x and use that for both 2.001 and 2.002.

svn path=/trunk/; revision=2087
2000-06-24 05:32:48 +00:00
Guy Harris 8af330852d Support for reading compressed Sniffer files, from Tim Farley, Joerg
Mayer, and yours truly.

svn path=/trunk/; revision=2002
2000-05-25 09:00:24 +00:00
Gilbert Ramirez d7e6e0e384 Add wtap-int.h. Move definitions relevant to the internal workins of wiretap
to that file, leave public definitions in wtap.h.

Rename "union pseudo_header" to "union wtap_pseudo_header".
Make the wtap_pseudo_header pointer available in packet_info struct.

svn path=/trunk/; revision=1989
2000-05-19 23:07:04 +00:00
Guy Harris f3d90d30a4 Remove the "union pseudo_header" from the "frame_data" structure;
there's no need to keep it around in memory - when the frame data is
read in when handing a frame, read in the information, if any, necessary
to reconstruct the frame header, and reconstruct it.  This saves some
memory.

This requires that the seek-and-read function be implemented inside
Wiretap, and that the Wiretap handle remain open even after we've
finished reading the file sequentially.

This also points out that we can't really do X.25-over-Ethernet
correctly, as we don't know where the direction (DTE->DCE or DCE->DTE)
flag is stored; it's not clear how the Ethernet type 0x0805 for X.25
Layer 3 is supposed to be handled in any case.  We eliminate
X.25-over-Ethernet support (until we find out what we're supposed to
do).

svn path=/trunk/; revision=1975
2000-05-18 09:09:50 +00:00
Guy Harris a29cf14f38 Fix minor typo found by Alan Harrison.
svn path=/trunk/; revision=1951
2000-05-12 21:27:04 +00:00
Guy Harris 0fdd93d1ce Rename the "private" member of a "wtap_dumper" structure to "dump", as
per the "capture" member of a "wtap" structure, so that it doesn't
collide with the C++ reserved word "private".

svn path=/trunk/; revision=1936
2000-05-10 22:16:31 +00:00
Guy Harris d51f36236f Get rid of the "start" field in the private data for RADCOM, i4btrace,
and nettl captures - a "start" field is used for capture files where the
time stamps on packets are relative to some initial time stamp, e.g. the
time the capture started, but those file formats use absolute time
stamps, so no "start" field is needed.

Make the "this is an HP-UX 11.x nettl capture" flag a member of the
private data structure for a nettl capture, rather than a global - it's
per-capture-file state.

Once the "start" field is removed from the RADCOM private data
structure, there's nothing left, so eliminate the private data
structure.

svn path=/trunk/; revision=1863
2000-04-15 21:12:37 +00:00
Guy Harris f5d1db4d77 Declare, in "wtap.h", Richard's new "wtap_read()" function.
svn path=/trunk/; revision=1820
2000-04-08 01:16:52 +00:00
Guy Harris 005588b8b9 In a Network Monitor capture file, get the starting offsets of frames
from the frame table - Network Monitor 2.x, at least, doesn't always
write frame N+1 right after frame N.

To do that, we need to mallocate a big array to hold the frame table,
and free it when we close the capture file; this requires that we have
capture-file-type-specific close routines as well as
capture-file-type-specific read routines - we let it the pointer to that
routine be null if it's not needed.  Given that, we might as well get
rid of the switch statement in "wtap_close()", in favor of using
capture-file-type-specific close routines, as per the comment before
that switch statement.

svn path=/trunk/; revision=1740
2000-03-22 07:06:59 +00:00
Guy Harris 585268e3e1 Use WTAP_ERR_UNSUPPORTED_ENCAP for all attempts to open or read a
capture file for an unsupported link-layer encapsulation type (as the
nettl reader does), and report it correctly if it occurs on an open or
read attempt rather than a save attempt.

svn path=/trunk/; revision=1647
2000-02-19 08:00:08 +00:00
Guy Harris 3e067b812c Fix files that had Gilbert's old e-mail address or that didn't have my
forwarding e-mail address.

svn path=/trunk/; revision=1522
2000-01-22 06:22:44 +00:00
Guy Harris 9658c33db6 Handle i4btrace captures if they're from a machine with the opposite
byte order from the machine that's reading them.

svn path=/trunk/; revision=1338
1999-12-15 02:25:50 +00:00
Guy Harris cc4e9f698b One field in the NetXRay header appears to be the number of frames in
the capture; set it to that when writing the capture.

Support Token Ring and FDDI captures (as per the network type in the
file header appearing to be either the NDIS network type, or the NDIS
network type minus 1 - I forget whether Ethernet has an NDIS type of 0
or 1).

Don't write the file header twice, keeping a static copy of it around,
as Wiretap code isn't supposed to keep any static data around; instead,
write it only when we're done writing out all the records (as we do on
Network Monitor captures).

Compute the time stamps when writing the file.

Give Windows Sniffer 1.1-format a short name, so "editcap" doesn't dump
core or print "(null)" in its usage message.

WTAP_ENCAP_NULL isn't supported by NetMon; don't write it.

svn path=/trunk/; revision=1336
1999-12-15 01:34:17 +00:00
Nathan Neulinger f78124579c more work on netxray, still not sniffer compatible though
svn path=/trunk/; revision=1333
1999-12-14 21:59:07 +00:00
Nathan Neulinger 2ad53e520e Added support for writing netxray version 1.1 dumps.
It's very basic, and doesn't write out the timestamps currently. It also
only handles WTAP_ENCAP_ETHERNET, although it can probably do the others,
but I don't have a good way to test them. This code has not yet been tested
against a Sniffer Pro, although wiretap can read the files just fine.

svn path=/trunk/; revision=1318
1999-12-14 01:12:59 +00:00
Gilbert Ramirez 4a15f6582a Added Bert Driehuis <driehuis@playbeing.org>'s I4B wiretap module
and V.120 decoder.

svn path=/trunk/; revision=1304
1999-12-12 22:40:10 +00:00
Guy Harris 626078e808 Put in a private data structure hanging off the "wtap_dumper" structure
the "this is the first frame" flag, and the time stamp of the first
frame, used when writing Sniffer files, so that more than one could be
open at a time (Wiretap doesn't forbid that) and so that they're
initialized when you start writing a capture.

svn path=/trunk/; revision=1292
1999-12-11 10:02:13 +00:00
Guy Harris 96a2e32a70 Provide different file types for "modified" and Red Hat 6.1 "libpcap"
files (the former have a different per-packet header, and a different
magic number, from the standard "libpcap"; the latter have the same
per-packet header as "modified" "libpcap" files, but the same magic
number as standard "libpcap" files, sigh).

Support writing "libpcap" captures in all three formats (so that, for
example, people running Ethereal on RH 6.1 can write out captures that
the "tcpdump" that comes with RH 6.1 can read, although that's not the
default format we save in - there's no way to tell whether you're
running on RH 6.1, as far as I know; "uname()" just tells you, on Linux
systems, that the kernel is Linux 2.x, and what "x" is, it doesn't say
what the *rest* of the system is).

Fix the table in "file.c" to use Olivier's code for writing Sniffer
files.

svn path=/trunk/; revision=1288
1999-12-11 00:40:40 +00:00
Guy Harris 959e02e540 Provide a table of descriptive and short (command-line) names for
encapsulation types, and routines to translate encapsulation types to
names and short names to encapsulation types, for the benefit of
"editcap".

svn path=/trunk/; revision=1212
1999-12-05 01:24:54 +00:00
Guy Harris ed78c10649 Give those capture file formats we can write a "short name", to be used
to, for example, specify on a command line the format that a program
should write; provide a routine to translate a file type to its short
name, and to translate a short name to the corresponding file type.

svn path=/trunk/; revision=1207
1999-12-04 21:20:09 +00:00
Guy Harris 3af8d95645 More infrastructure changes for Ethereal - make
"wtap_file_type_string()" take, as its argument, a file type, rather
than a "wtap *".

Fix some range checks of file types to check against WTAP_NUM_FILE_TYPES
rather than WTAP_NUM_ENCAP_TYPES.

svn path=/trunk/; revision=1201
1999-12-04 08:51:52 +00:00
Guy Harris 3b93574402 Add some infrastructure for the use of Ethereal, so it can make a list
of all the file types in which a file can be saved.

Giving each dumpable file type a routine that checks whether a file of a
given file type and encapsulation can be written lets us hoist some
checks into common code from out of the open routines.

If the "dump close" routine for a dump stream is NULL, have that mean
that there's no action that needs to be taken on a close by the code to
handle that file type; some file types don't need that, as they can be
written purely sequentially.

svn path=/trunk/; revision=1200
1999-12-04 08:32:14 +00:00