summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-bt-dht.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-03BT-DHT: add IPv6 support for find_node responsesFlorian Adamsky1-11/+42
Change-Id: I4ce38892b6c287c2dc51f438a12a5be5920197b6 Reviewed-on: https://code.wireshark.org/review/20323 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-11-10bt-dht: add data to COL_INFO.Dario Lombardo1-0/+1
Change-Id: I69e8b012156020f79cf22604bc709fc70f215155 Reviewed-on: https://code.wireshark.org/review/18710 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-10-20bt-dht: use ws_strtou function.Dario Lombardo1-8/+52
Change-Id: I105ceb0053d5ff3f595611cf919d44d40f5df037 Reviewed-on: https://code.wireshark.org/review/18287 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-19bt-dht: add bencoding terminators.Dario Lombardo1-2/+12
Change-Id: I367495fb11aa09f1c8cb7f1df8812e179d41d9b9 Reviewed-on: https://code.wireshark.org/review/18305 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Tested-by: Michael Mann <mmann78@netscape.net>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-15/+5
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>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-1/+1
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-07-17Remove all preferences related to enabling/disabling heuristic dissectors.Michael Mann1-8/+2
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-12Add "user presentable" and "unique string ids" to heuristic table entries.Michael Mann1-1/+1
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-06-22Remove more tvb_lengthEvan Huus1-1/+1
Change-Id: I940704e927001b2a051a59fd0738e7a02328472b Reviewed-on: https://code.wireshark.org/review/9031 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-07tvb_bytes_to_ep_str -> tvb_bytes_to_strMichael Mann1-2/+2
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4 Reviewed-on: https://code.wireshark.org/review/6371 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-1/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-20Rename dissector_add_handle() to dissector_add_for_decode_as().Guy Harris1-1/+1
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-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-1/+1
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-1/+1
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-3/+3
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-14Use try_val_to_str() in heuristics test (intead of a loop); ensure no ↵Bill Meier1-18/+15
exception during test. Change-Id: Ib55ccca4a025fb1cbef52ffa01888fef6d72156a Reviewed-on: https://code.wireshark.org/review/651 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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-01-14And more constification.Guy Harris1-6/+6
svn path=/trunk/; revision=54759
2014-01-14More constification.Guy Harris1-1/+1
svn path=/trunk/; revision=54758
2014-01-14Don't cast away constness when you don't have to.Guy Harris1-6/+7
svn path=/trunk/; revision=54756
2013-12-21Add missing includesJakub Zawadzki1-0/+1
svn path=/trunk/; revision=54332
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-2/+2
obvious that the returned string is ephemeral, and opens up the original names in the API for versions that take a wmem pool (and thus can work in any scope). svn path=/trunk/; revision=54249
2013-12-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-2/+3
svn path=/trunk/; revision=54135
2013-12-03When including <epan/prefs.h> don't force inclusion of <epan/uat.h>Jakub Zawadzki1-0/+2
svn path=/trunk/; revision=53769
2013-09-22emem -> wmem conversion:Pascal Quantin1-3/+3
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-09-12Convert a few more dissectors to wmemPascal Quantin1-3/+4
svn path=/trunk/; revision=51991
2013-07-26From Chen Li via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8949 :Jeff Morriss1-4/+3
Fix the dissection of the port number in announce_peers request in BTDHT. svn path=/trunk/; revision=50899
2013-06-03From chen liMartin Kaiser1-0/+4
handle list ending delimiter in bt-dth peer list https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8759 svn path=/trunk/; revision=49729
2013-04-20Enhance BT-DHT Dissector * Use proto_tree_add_item * Enhance display list ↵Alexis La Goutte1-45/+39
(nodes, peers...) * Remove ununeed space * ... svn path=/trunk/; revision=48941
2013-04-15Fix Modelines (No CR in the end of file)Alexis La Goutte1-1/+0
svn path=/trunk/; revision=48851
2013-04-15From report of chen li via ↵Alexis La Goutte1-3/+3
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8572 Endian error and IP:Port error when decoding BT-DHT response message When the remote client sended a node set, it contains nodes info The node info it shows like (1 3cad1f360cc51870d3e68d61ed604078bc608ee2 60.173.31.54:43365), but this node's true ip and port is 99.192.73.131:26025. When we expand these items, the ips and ports in detailed information are right. From me : It is a problem of encoding (LITTLE ENDIAN => BIG ENDIAN) and wrong offset Some issue with Peers info svn path=/trunk/; revision=48850
2012-12-26Fix a bunch of warnings.Guy Harris1-3/+3
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-12-05From Patrik Lundquist:Anders Broman1-44/+86
Improvements to BitTorrent DHT dissector Fixed filtering on protocol "bt-dht". Improved heuristics. Can probably be enabled by default now (but I'll let someone else make that decision). Unexpected IP address (first packet in capture file) and binary "tokens" (packet 17) were incorrectly printed as UTF-8 strings. Moved duplicate code into bencoded_string_length(). https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8044 svn path=/trunk/; revision=46396
2012-12-02Introduce, and start using, TVB_SET_ADDRESS() and TVB_SET_ADDRESS_HF(). TheyJeff Morriss1-2/+2
are like the non-TVB versions except that they take a TVB and an offset instead of (frequently) a pointer into the TVB. Calling tvb_get_ptr() before modifying the rest of the fields should help fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7960 (though I can't reproduce that problem). Replace a bunch of calls like: SET_ADDRESS(..., AT_XXX, length, tvb_get_ptr(tvb, offset, length)); with: TVB_SET_ADDRESS(..., AT_XXX, tvb, offset, length); svn path=/trunk/; revision=46324
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45017
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-3/+3
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL svn path=/trunk/; revision=44860
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-2/+2
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-04Get rid of a couple of warnings.Anders Broman1-5/+5
svn path=/trunk/; revision=43065
2012-01-20Fix Fix "bt-dht [..] NOT registered properly" as reported in Bug #6571.Bill Meier1-61/+119
"bt-dht [...] should also be common dissectors while not only heuristic ones. So we can use them with 'Decode As...' command." Essentially: -Register dissector handle so the dissector can be accessed via "decode-as". From me: 1. Given that the current heuristic is much too weak and causes 'false positives': Add a preference to allow enabling/disabling of heuristic dissection. The default is 'disabled' since the current heuristic is quite weak. (For example: The heuristic incorrectly dissects about 40 files in menagerie/public as being the BT-DHT protocol). Note: only heuristic dissection is disabled; 'decode-as' remains enabled. Also: 1. Fix some bugs wherein bytes in the hex pane were not highlighted when a field was selected in the details pane. 2. Do some minor re-formatting of the source code. svn path=/trunk/; revision=40603
2011-12-28Fix memory leaks involving tvb_get_string[z]().Chris Maynard1-5/+5
svn path=/trunk/; revision=40312
2011-11-15Remove unneeded #includes;Bill Meier1-12/+10
Move proto_reg_handoff...() to the end of the file as per convention. svn path=/trunk/; revision=39860
2011-10-28From Xiao Xiangquan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5767Alexis La Goutte1-0/+527
BitTorrent DHT dissector for wireshark From me : * Fix encoding attribut for proto_tree_add_item (with fix-encodings-args script) svn path=/trunk/; revision=39653