Commit Graph

41 Commits

Author SHA1 Message Date
Guy Harris 8195bdd340 Rename a bunch of things with "conversation".
A conversation in Wireshark might have two endpoints or might have no
endpoints; few if any have one endpoint.  Distinguish between
conversations and endpoints.
2022-08-25 20:02:20 -07:00
Alexis La Goutte cfcd060171 bt-utp: Fix warning found by Clang Analyzer
packet-bt-utp.c:1052:5: warning: Value stored to 'offset' is never read [deadcode.DeadStores]
2021-10-20 21:51:40 +00:00
Martin Mathieson 29fe2340bd BT-UTP: Make a function statis 2021-10-20 20:19:26 +00:00
John Thacker db8e63614e BT-uTP: Hand to bittorrent dissector, dissect multiple PDUs
Handle uTP payload to the bittorrent dissector.
Implement dissect PDUs to handle more than one bittorrent PDU
in a uTP payload.
Implement basic multisegment PDU tracking; not enough to actually
desegment, but enough to provide a hint to the start offset of the
next PDU when a PDU does span segments. (Provided that they're in
order, but OOO handling isn't implemented yet either.)
Improves #8792.
2021-10-19 18:53:46 +00:00
John Thacker c6e44fb00c BT-uTP: Track conversations
Add endpoint type for uTP connection IDs.
Manage uTP conversations, creating generated stream ID to filter
on both sides of a conversation.
Display more information in INFO column, similar to TCP.
This is some progress towards #8792.
2021-10-13 04:37:21 +00:00
John Thacker 35d09a7854 BT-DHT, BT-uTP: Use conversation_set_dissector_from_frame_number
Since the UDP connection switches back and forth between DHT and uTP,
use conversation_set_dissector_from_frame_number so that the dissector
called by try_conversation_dissector in packet-udp.c doesn't change for
a given frame based on the last packet clicked in the GUI.

Split out a heuristic dissector from uTP so that conversation_set_dissector
is only called from the heuristic dissector.

This doesn't make a difference when the heuristics are accurate but
might in some edge cases.
2021-10-10 11:31:06 +00:00
John Thacker ac9e95acca BT-uTP: Strengthen heuristic
Strengthen the heuristic, including fixing a typo, disabling via
preference the pre-release "Version 0" of the protocol that hasn't been
supported by any clients for a decade, and putting a limit on the maximum
window size by default via preference. This might be enough to enable it
by default, but hold off on doing so for until more testing.

Also fix a couple of typos and add unit strings.
2021-10-09 13:06:44 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Michael Mann 2eb7b05b8c Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13 02:51:18 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Michael Mann 21e5a950ad Remove all preferences related to enabling/disabling heuristic dissectors.
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector.

Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled.

Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22
Reviewed-on: https://code.wireshark.org/review/9610
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-17 17:12:22 +00:00
Michael Mann be7d295fbf Add "user presentable" and "unique string ids" to heuristic table entries.
This allows better presentation of heuristic dissectors to the end user.

Change-Id: I2ff3985ab914e83c2989880cc0c7b9904045b3f6
Reviewed-on: https://code.wireshark.org/review/9602
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-12 03:14:38 +00:00
Evan Huus 11803d422f Remove more tvb_length
Change-Id: I940704e927001b2a051a59fd0738e7a02328472b
Reviewed-on: https://code.wireshark.org/review/9031
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-22 21:40:50 +00:00
Guy Harris ce3d2ff3de Rename dissector_add_handle() to dissector_add_for_decode_as().
Hopefully that name makes it clear what the routiner's purpose is, and
will encourage people to use it rather than using dissector_add_uint()
with a bogus integer value.

Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8
Reviewed-on: https://code.wireshark.org/review/2483
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 16:43:56 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +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
Jakub Zawadzki 1053e722ed Fix warnings
svn path=/trunk/; revision=54089
2013-12-14 12:45:57 +00:00
Chris Maynard 1455b36647 Fix Coverity CID 751720: Logically dead code.
In fixing this bug, also fix another:  Be sure to use tvb_length() and not tvb_reported_length() in get_utp_version(), since this is essentially where the heuristics are being applied to decide whether to accept the packet or not.

svn path=/trunk/; revision=47761
2013-02-20 02:15:20 +00:00
Chris Maynard 97af002693 Fix Coverity CID 746734: Dead default in switch. (No need to backport)
svn path=/trunk/; revision=47461
2013-02-04 02:44:04 +00:00
Pascal Quantin 2dbf4f6fff Strengthen BT-uTP heuristic dissector and add a preference to enable it (disabled by default)
svn path=/trunk/; revision=46551
2012-12-16 00:28:38 +00:00
Bill Meier fbbe7cb97f Fix [-Wshadow] warning.
svn path=/trunk/; revision=46379
2012-12-04 19:52:01 +00:00
Anders Broman 9ca3f30f75 From Patrik Lundquist Updated V1 header description to reflect corrected specification (BEP 0029). Removed if(tree) in dissect. New style dissector, right? Added heuristics for V0 header. Removed length checking in heuristics since uTP packets can have any lenght, even odd ones, and they do. Fixed Extensions looping over whole packets and added a Data field for the trailing payload. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8048
svn path=/trunk/; revision=46373
2012-12-04 17:47:07 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Anders Broman d226f4de96 From Xiao Xiangquan:
bt-dht and bt-utp should also be common dissectors while not only heuristic
ones. So we can use them with "Decode As..." command.

Applying the missing part as this seems to be an owerlapping patch.

svn path=/trunk/; revision=40868
2012-02-05 13:51:50 +00:00
Bill Meier 3b387d1b8e Remove unneeded #include
svn path=/trunk/; revision=39869
2011-11-15 21:07:37 +00:00
Jeff Morriss f5e838b602 Remove comma at the end of several enumerator lists.
svn path=/trunk/; revision=39700
2011-11-01 01:23:10 +00:00
Alexis La Goutte f0f3d8d13c From Xiao Xiangquan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5767
Make bt-utp as heuristic dissectors

svn path=/trunk/; revision=39652
2011-10-28 14:49:31 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Bill Meier 781129806f Fix ex "modeline" so it works;
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748

svn path=/trunk/; revision=39081
2011-09-21 17:49:11 +00:00
Bill Meier 4910bc142f Add to comment about using a heuristic; Fix a typo.
svn path=/trunk/; revision=37330
2011-05-20 15:34:29 +00:00
Alexis La Goutte 2105f81d8a Enhance BT-UTP dissector:
* Add type (syn, data, reset...) in column info
* Split dissect_utp_header(...) function to 
	* dissect_utp_header_v0(...)
	* dissect_utp_header_v1(...)
	* dissect_utp_extensions(...)

svn path=/trunk/; revision=36803
2011-04-22 13:16:45 +00:00
Bill Meier 2eced546c1 Add code to dissect "original uTP header format"
as described in the LibuTP utp.cpp source code;
Add a kludgy heuristic to differentiate between
 original and "V1" header formats.
 TBD: validity of the heuristic; is there a better way ?

svn path=/trunk/; revision=36742
2011-04-20 20:32:26 +00:00
Bill Meier 42538888ea - New-style dissectors need to always return "bytes dissected" (not just when tree != NULL);
- The dissector probably shouldn't return a value for "bytes dissected" which is larger
   than the tvb length (altho there's actually no harm given the current implementation).
- Don't try to do an 'add_item' with an offset past the end of the tvb (altho again there's
   no actual harm in this case).

ToDo: Handle "original format" uTP headers.

svn path=/trunk/; revision=36737
2011-04-20 17:25:07 +00:00
Bill Meier 26a50ccd97 Whitespace cleanup; Remove an uneeded col_clear().
svn path=/trunk/; revision=36720
2011-04-19 16:37:39 +00:00
Stephen Fisher 9dad613f08 This file had an identical copy appended to the end of it. Remove
duplicate.


svn path=/trunk/; revision=36719
2011-04-19 16:24:29 +00:00
Alexis La Goutte 372639e7f8 From Xiao Xiangquan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5846
A new dissector for uTorrent Transport Protocol

From me :
* Add link to spec BEP-0029
* Add note about type/version 
* Rework extensions loop
* Use 2-space indenting


svn path=/trunk/; revision=36716
2011-04-19 15:23:51 +00:00