2011-10-28 14:50:13 +00:00
|
|
|
/******************************************************************************************************/
|
|
|
|
/* packet-bt-dht.c
|
|
|
|
* Routines for BT-DHT dissection
|
|
|
|
* Copyright 2011, Xiao Xiangquan <xiaoxiangquan@gmail.com>
|
|
|
|
*
|
|
|
|
* A plugin for BT-DHT packet:
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1999 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2011-10-28 14:50:13 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
2011-11-15 19:00:08 +00:00
|
|
|
|
2013-12-03 22:16:49 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
#include <epan/packet.h>
|
2011-11-15 19:00:08 +00:00
|
|
|
#include <epan/conversation.h>
|
2012-01-20 03:24:05 +00:00
|
|
|
#include <epan/prefs.h>
|
2013-12-21 17:23:17 +00:00
|
|
|
#include <epan/to_str.h>
|
2016-10-18 20:44:51 +00:00
|
|
|
#include <epan/expert.h>
|
|
|
|
|
|
|
|
#include <wsutil/strtoi.h>
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2013-12-15 23:44:12 +00:00
|
|
|
void proto_register_bt_dht(void);
|
|
|
|
void proto_reg_handoff_bt_dht(void);
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
/* Specifications: BEP-0005
|
|
|
|
* http://www.bittorrent.org/beps/bep_0005.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int proto_bt_dht = -1;
|
|
|
|
static dissector_handle_t bt_dht_handle;
|
|
|
|
|
|
|
|
/* fields */
|
|
|
|
static int hf_bencoded_int = -1;
|
|
|
|
static int hf_bencoded_string = -1;
|
|
|
|
static int hf_bencoded_list = -1;
|
|
|
|
static int hf_bencoded_dict = -1;
|
|
|
|
static int hf_bencoded_dict_entry = -1;
|
2016-10-19 09:16:58 +00:00
|
|
|
static int hf_bencoded_list_terminator = -1;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
static int hf_bt_dht_error = -1;
|
|
|
|
static int hf_bt_dht_peers = -1;
|
|
|
|
static int hf_bt_dht_peer = -1;
|
|
|
|
static int hf_bt_dht_nodes = -1;
|
|
|
|
static int hf_bt_dht_node = -1;
|
|
|
|
static int hf_bt_dht_id = -1;
|
|
|
|
|
|
|
|
static int hf_ip = -1;
|
2017-02-28 20:19:48 +00:00
|
|
|
static int hf_ip6 = -1;
|
2011-10-28 14:50:13 +00:00
|
|
|
static int hf_port = -1;
|
|
|
|
static int hf_truncated_data = -1;
|
|
|
|
|
2016-10-18 20:44:51 +00:00
|
|
|
static expert_field ei_int_string = EI_INIT;
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
/* tree types */
|
|
|
|
static gint ett_bt_dht = -1;
|
|
|
|
static gint ett_bencoded_list = -1;
|
|
|
|
static gint ett_bencoded_dict = -1;
|
|
|
|
static gint ett_bencoded_dict_entry = -1;
|
|
|
|
static gint ett_bt_dht_error = -1;
|
|
|
|
static gint ett_bt_dht_peers = -1;
|
|
|
|
static gint ett_bt_dht_nodes = -1;
|
|
|
|
|
|
|
|
/* some keys use short name in packet */
|
|
|
|
static const value_string short_key_name_value_string[] = {
|
2013-04-20 09:49:00 +00:00
|
|
|
{ 'y', "Message type" },
|
|
|
|
{ 'q', "Request type" },
|
|
|
|
{ 'e', "Error" },
|
|
|
|
{ 't', "Transaction ID" },
|
|
|
|
{ 'v', "Version" },
|
|
|
|
{ 'a', "Request arguments" },
|
|
|
|
{ 'r', "Response values" },
|
2011-10-28 14:50:13 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* some values use short name in packet */
|
|
|
|
static const value_string short_val_name_value_string[] = {
|
2013-04-20 09:49:00 +00:00
|
|
|
{ 'q', "Request" },
|
|
|
|
{ 'r', "Response" },
|
|
|
|
{ 'e', "Error" },
|
2011-10-28 14:50:13 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2013-04-20 09:49:00 +00:00
|
|
|
static const char dict_str[] = "Dictionary...";
|
|
|
|
static const char list_str[] = "List...";
|
2012-12-05 09:27:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
bencoded_string_length(tvbuff_t *tvb, guint *offset_ptr)
|
|
|
|
{
|
|
|
|
guint offset, start, len;
|
2016-10-18 20:44:51 +00:00
|
|
|
guint remaining = tvb_captured_length_remaining(tvb, *offset_ptr);
|
2012-12-05 09:27:58 +00:00
|
|
|
|
|
|
|
offset = *offset_ptr;
|
|
|
|
start = offset;
|
|
|
|
|
2016-10-18 20:44:51 +00:00
|
|
|
while(tvb_get_guint8(tvb, offset) != ':' && remaining--)
|
2012-12-05 09:27:58 +00:00
|
|
|
++offset;
|
|
|
|
|
2016-10-18 20:44:51 +00:00
|
|
|
if (remaining && ws_strtou32(tvb_get_string_enc(wmem_packet_scope(), tvb, start, offset-start, ENC_ASCII),
|
|
|
|
NULL, &len)) {
|
|
|
|
++offset; /* skip the ':' */
|
|
|
|
*offset_ptr = offset;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
return 0;
|
2012-12-05 09:27:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
/*
|
|
|
|
* dissect a bencoded string from tvb, start at offset. it's like "5:abcde"
|
|
|
|
* *result will be the decoded value
|
|
|
|
*/
|
2012-01-20 03:24:05 +00:00
|
|
|
|
|
|
|
static int
|
2014-01-14 03:56:36 +00:00
|
|
|
dissect_bencoded_string(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, guint offset, const char **result, gboolean tohex, const char *label )
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
2016-10-18 20:44:51 +00:00
|
|
|
gint string_len;
|
2012-12-05 09:27:58 +00:00
|
|
|
string_len = bencoded_string_length(tvb, &offset);
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2016-10-18 20:44:51 +00:00
|
|
|
if (string_len == 0)
|
|
|
|
return 0;
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
/* fill the return data */
|
|
|
|
if( tohex )
|
2015-01-07 15:11:22 +00:00
|
|
|
*result = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, string_len );
|
2011-10-28 14:50:13 +00:00
|
|
|
else
|
2014-06-17 15:30:58 +00:00
|
|
|
*result = tvb_get_string_enc( wmem_packet_scope(), tvb, offset, string_len , ENC_ASCII);
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
proto_tree_add_string_format( tree, hf_bencoded_string, tvb, offset, string_len, *result, "%s: %s", label, *result );
|
|
|
|
offset += string_len;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* dissect a bencoded integer from tvb, start at offset. it's like "i5673e"
|
|
|
|
* *result will be the decoded value
|
|
|
|
*/
|
2012-01-20 03:24:05 +00:00
|
|
|
static int
|
2014-01-14 04:01:34 +00:00
|
|
|
dissect_bencoded_int(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, guint offset, const char **result, const char *label )
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
|
|
|
guint start_offset;
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
/* we have confirmed that the first byte is 'i' */
|
|
|
|
offset += 1;
|
2013-07-26 00:24:54 +00:00
|
|
|
start_offset = offset;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
while( tvb_get_guint8(tvb,offset)!='e' )
|
2012-01-20 03:24:05 +00:00
|
|
|
offset += 1;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2016-10-19 09:16:58 +00:00
|
|
|
proto_tree_add_item(tree, hf_bencoded_list_terminator, tvb, offset, 1, ENC_ASCII|ENC_NA);
|
|
|
|
|
2014-06-17 15:30:58 +00:00
|
|
|
*result = tvb_get_string_enc( wmem_packet_scope(), tvb, start_offset, offset-start_offset, ENC_ASCII);
|
2013-07-26 00:24:54 +00:00
|
|
|
proto_tree_add_string_format( tree, hf_bencoded_int, tvb, start_offset, offset-start_offset, *result,
|
2011-10-28 14:50:13 +00:00
|
|
|
"%s: %s", label, *result );
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
offset += 1;
|
2011-10-28 14:50:13 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* pre definition of dissect_bencoded_dict(), which is needed by dissect_bencoded_list() */
|
2012-12-26 05:57:06 +00:00
|
|
|
static int dissect_bencoded_dict(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const char *label );
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
/* dissect a bencoded list from tvb, start at offset. it's like "lXXXe", "X" is any bencoded thing */
|
2012-01-20 03:24:05 +00:00
|
|
|
static int
|
2012-06-04 13:21:44 +00:00
|
|
|
dissect_bencoded_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const char *label )
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *sub_tree;
|
2012-01-20 03:24:05 +00:00
|
|
|
guint one_byte;
|
2014-01-14 04:01:34 +00:00
|
|
|
const char *result;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
ti = proto_tree_add_none_format( tree, hf_bencoded_list, tvb, offset, 0, "%s: list...", label );
|
|
|
|
sub_tree = proto_item_add_subtree( ti, ett_bencoded_list);
|
|
|
|
|
|
|
|
/* skip the 'l' */
|
2012-01-20 03:24:05 +00:00
|
|
|
offset += 1;
|
2011-10-28 14:50:13 +00:00
|
|
|
while( (one_byte=tvb_get_guint8(tvb,offset)) != 'e' )
|
|
|
|
{
|
|
|
|
switch( one_byte )
|
|
|
|
{
|
|
|
|
/* a integer */
|
|
|
|
case 'i':
|
|
|
|
offset = dissect_bencoded_int( tvb, pinfo, sub_tree, offset, &result, "Integer" );
|
|
|
|
break;
|
|
|
|
/* a sub-list */
|
|
|
|
case 'l':
|
|
|
|
offset = dissect_bencoded_list( tvb, pinfo, sub_tree, offset, "Sub-list" );
|
|
|
|
break;
|
|
|
|
/* a dictionary */
|
|
|
|
case 'd':
|
|
|
|
offset = dissect_bencoded_dict( tvb, pinfo, sub_tree, offset, "Sub-dict" );
|
|
|
|
break;
|
|
|
|
/* a string */
|
|
|
|
default:
|
|
|
|
offset = dissect_bencoded_string( tvb, pinfo, sub_tree, offset, &result, FALSE, "String" );
|
2016-10-18 20:44:51 +00:00
|
|
|
if (offset == 0)
|
|
|
|
{
|
|
|
|
proto_tree_add_expert(sub_tree, pinfo, &ei_int_string, tvb, offset, -1);
|
|
|
|
/* if offset is not going on, there is no chance to exit the loop, then return*/
|
|
|
|
return 0;
|
|
|
|
}
|
2011-10-28 14:50:13 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2016-10-19 09:16:58 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_bencoded_list_terminator, tvb, offset, 1, ENC_ASCII|ENC_NA);
|
2012-01-20 03:24:05 +00:00
|
|
|
offset += 1;
|
2011-10-28 14:50:13 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* dissect a bt dht error from tvb, start at offset. it's like "li201e9:error msge" */
|
2012-01-20 03:24:05 +00:00
|
|
|
static int
|
2014-01-14 04:01:34 +00:00
|
|
|
dissect_bt_dht_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const char **result, const char *label )
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *sub_tree;
|
2014-01-14 04:01:34 +00:00
|
|
|
const char *error_no, *error_msg;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
error_no = NULL;
|
2011-10-28 14:50:13 +00:00
|
|
|
error_msg = NULL;
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
ti = proto_tree_add_item( tree, hf_bt_dht_error, tvb, offset, 0, ENC_NA );
|
2011-10-28 14:50:13 +00:00
|
|
|
sub_tree = proto_item_add_subtree( ti, ett_bt_dht_error);
|
|
|
|
|
|
|
|
/* we have confirmed that the first byte is 'l' */
|
2012-01-20 03:24:05 +00:00
|
|
|
offset += 1;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
/* dissect bt-dht error number and message */
|
|
|
|
offset = dissect_bencoded_int( tvb, pinfo, sub_tree, offset, &error_no, "Error ID" );
|
|
|
|
offset = dissect_bencoded_string( tvb, pinfo, sub_tree, offset, &error_msg, FALSE, "Error Message" );
|
|
|
|
|
|
|
|
proto_item_set_text( ti, "%s: error %s, %s", label, error_no, error_msg );
|
2013-04-20 09:49:00 +00:00
|
|
|
col_append_fstr( pinfo->cinfo, COL_INFO, "error_no=%s error_msg=%s ", error_no, error_msg );
|
2013-09-12 22:03:31 +00:00
|
|
|
*result = wmem_strdup_printf(wmem_packet_scope(), "error %s, %s", error_no, error_msg );
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* dissect a bt dht values list from tvb, start at offset. it's like "l6:....6:....e" */
|
2012-01-20 03:24:05 +00:00
|
|
|
static int
|
2014-01-14 04:01:34 +00:00
|
|
|
dissect_bt_dht_values(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const char **result, const char *label )
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_item *value_ti;
|
|
|
|
proto_tree *value_tree;
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
guint peer_index;
|
|
|
|
guint string_len;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
ti = proto_tree_add_item( tree, hf_bt_dht_peers, tvb, offset, 0, ENC_NA );
|
|
|
|
sub_tree = proto_item_add_subtree( ti, ett_bt_dht_peers);
|
|
|
|
|
|
|
|
peer_index = 0;
|
|
|
|
/* we has confirmed that the first byte is 'l' */
|
2012-01-20 03:24:05 +00:00
|
|
|
offset += 1;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
/* dissect bt-dht values */
|
|
|
|
while( tvb_get_guint8(tvb,offset)!='e' )
|
|
|
|
{
|
2012-12-05 09:27:58 +00:00
|
|
|
string_len = bencoded_string_length(tvb, &offset);
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2020-11-10 08:39:53 +00:00
|
|
|
if (string_len == 6)
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
2020-11-10 08:39:53 +00:00
|
|
|
/* 4 bytes ip, 2 bytes port */
|
2012-01-20 03:24:05 +00:00
|
|
|
peer_index += 1;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2013-04-20 09:49:00 +00:00
|
|
|
value_ti = proto_tree_add_item( sub_tree, hf_bt_dht_peer, tvb, offset, 6, ENC_NA );
|
|
|
|
proto_item_append_text(value_ti, " %d", peer_index);
|
2011-10-28 14:50:13 +00:00
|
|
|
value_tree = proto_item_add_subtree( value_ti, ett_bt_dht_peers);
|
|
|
|
|
|
|
|
proto_tree_add_item( value_tree, hf_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2013-04-20 09:49:00 +00:00
|
|
|
proto_item_append_text(value_ti, " (IP/Port: %s", tvb_ip_to_str(tvb, offset));
|
2011-10-28 14:50:13 +00:00
|
|
|
proto_tree_add_item( value_tree, hf_port, tvb, offset+4, 2, ENC_BIG_ENDIAN);
|
2013-04-20 09:49:00 +00:00
|
|
|
proto_item_append_text(value_ti, ":%u)", tvb_get_ntohs( tvb, offset+4 ));
|
2020-11-10 08:39:53 +00:00
|
|
|
}
|
|
|
|
else if (string_len == 18)
|
|
|
|
{
|
|
|
|
/* 16 bytes ip, 2 bytes port */
|
|
|
|
peer_index += 1;
|
2013-04-20 09:49:00 +00:00
|
|
|
|
2020-11-10 08:39:53 +00:00
|
|
|
value_ti = proto_tree_add_item( sub_tree, hf_bt_dht_peer, tvb, offset, 18, ENC_NA );
|
|
|
|
proto_item_append_text(value_ti, " %d", peer_index);
|
|
|
|
value_tree = proto_item_add_subtree( value_ti, ett_bt_dht_peers);
|
|
|
|
|
|
|
|
proto_tree_add_item( value_tree, hf_ip6, tvb, offset, 16, ENC_NA);
|
|
|
|
proto_item_append_text(value_ti, " (IPv6/Port: [%s]", tvb_ip6_to_str(tvb, offset));
|
|
|
|
proto_tree_add_item( value_tree, hf_port, tvb, offset+16, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_item_append_text(value_ti, ":%u)", tvb_get_ntohs( tvb, offset+16 ));
|
2011-10-28 14:50:13 +00:00
|
|
|
}
|
2020-11-10 08:39:53 +00:00
|
|
|
else
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
2020-11-10 08:39:53 +00:00
|
|
|
/* truncated data */
|
2011-10-28 14:50:13 +00:00
|
|
|
proto_tree_add_item( tree, hf_truncated_data, tvb, offset, string_len, ENC_NA );
|
|
|
|
}
|
2020-11-10 08:39:53 +00:00
|
|
|
|
|
|
|
offset += string_len;
|
2011-10-28 14:50:13 +00:00
|
|
|
}
|
2013-06-03 21:01:43 +00:00
|
|
|
|
2016-10-19 09:16:58 +00:00
|
|
|
if (tvb_get_guint8(tvb,offset)=='e') { /* list ending delimiter */
|
|
|
|
proto_tree_add_item(sub_tree, hf_bencoded_list_terminator, tvb, offset, 1, ENC_ASCII|ENC_NA);
|
2013-06-03 21:01:43 +00:00
|
|
|
offset++;
|
2016-10-19 09:16:58 +00:00
|
|
|
}
|
2013-06-03 21:01:43 +00:00
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
proto_item_set_text( ti, "%s: %d peers", label, peer_index );
|
2020-11-10 08:39:53 +00:00
|
|
|
col_append_fstr( pinfo->cinfo, COL_INFO, " reply=%d peers", peer_index );
|
2013-09-12 22:03:31 +00:00
|
|
|
*result = wmem_strdup_printf(wmem_packet_scope(), "%d peers", peer_index);
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
static int
|
2017-02-28 20:19:48 +00:00
|
|
|
dissect_bt_dht_nodes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const char **result, const char *label, gboolean is_ipv6 )
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_item *node_ti;
|
|
|
|
proto_tree *node_tree;
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
guint node_index;
|
|
|
|
guint string_len;
|
2017-02-28 20:19:48 +00:00
|
|
|
guint node_byte_length;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2012-12-05 09:27:58 +00:00
|
|
|
string_len = bencoded_string_length(tvb, &offset);
|
|
|
|
|
|
|
|
ti = proto_tree_add_item( tree, hf_bt_dht_nodes, tvb, offset, string_len, ENC_NA );
|
2011-10-28 14:50:13 +00:00
|
|
|
sub_tree = proto_item_add_subtree( ti, ett_bt_dht_nodes);
|
|
|
|
node_index = 0;
|
|
|
|
|
2017-02-28 20:19:48 +00:00
|
|
|
/* 26 bytes = 20 bytes id + 4 bytes ipv4 address + 2 bytes port */
|
|
|
|
node_byte_length = 26;
|
|
|
|
|
|
|
|
if ( is_ipv6 )
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
2017-02-28 20:19:48 +00:00
|
|
|
/* 38 bytes = 20 bytes id + 16 bytes ipv6 address + 2 bytes port */
|
|
|
|
node_byte_length = 38;
|
|
|
|
}
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2017-02-28 20:19:48 +00:00
|
|
|
for( ; string_len>=node_byte_length; string_len-=node_byte_length, offset+=node_byte_length )
|
|
|
|
{
|
|
|
|
node_index += 1;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2017-02-28 20:19:48 +00:00
|
|
|
node_ti = proto_tree_add_item( sub_tree, hf_bt_dht_node, tvb, offset, node_byte_length, ENC_NA);
|
2013-04-20 09:49:00 +00:00
|
|
|
proto_item_append_text(node_ti, " %d", node_index);
|
2011-10-28 14:50:13 +00:00
|
|
|
node_tree = proto_item_add_subtree( node_ti, ett_bt_dht_peers);
|
|
|
|
|
|
|
|
proto_tree_add_item( node_tree, hf_bt_dht_id, tvb, offset, 20, ENC_NA);
|
2015-01-07 15:11:22 +00:00
|
|
|
proto_item_append_text(node_ti, " (id: %s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 20));
|
2017-02-28 20:19:48 +00:00
|
|
|
|
|
|
|
if ( is_ipv6 )
|
|
|
|
{
|
|
|
|
proto_tree_add_item( node_tree, hf_ip6, tvb, offset+20, 16, ENC_NA);
|
|
|
|
proto_item_append_text(node_ti, ", IPv6/Port: [%s]", tvb_ip6_to_str(tvb, offset+20));
|
|
|
|
|
|
|
|
proto_tree_add_item( node_tree, hf_port, tvb, offset+36, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_item_append_text(node_ti, ":%u)", tvb_get_ntohs( tvb, offset+36 ));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
proto_tree_add_item( node_tree, hf_ip, tvb, offset+20, 4, ENC_BIG_ENDIAN);
|
|
|
|
proto_item_append_text(node_ti, ", IPv4/Port: %s", tvb_ip_to_str(tvb, offset+20));
|
|
|
|
|
|
|
|
proto_tree_add_item( node_tree, hf_port, tvb, offset+24, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_item_append_text(node_ti, ":%u)", tvb_get_ntohs( tvb, offset+24 ));
|
|
|
|
}
|
2011-10-28 14:50:13 +00:00
|
|
|
}
|
2017-02-28 20:19:48 +00:00
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
if( string_len>0 )
|
|
|
|
{
|
|
|
|
proto_tree_add_item( tree, hf_truncated_data, tvb, offset, string_len, ENC_NA );
|
|
|
|
offset += string_len;
|
|
|
|
}
|
|
|
|
proto_item_set_text( ti, "%s: %d nodes", label, node_index );
|
2020-11-10 08:39:53 +00:00
|
|
|
col_append_fstr( pinfo->cinfo, COL_INFO, " reply=%d nodes", node_index );
|
2013-09-12 22:03:31 +00:00
|
|
|
*result = wmem_strdup_printf(wmem_packet_scope(), "%d", node_index);
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
static int
|
|
|
|
dissect_bencoded_dict_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset )
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *sub_tree;
|
2012-01-20 03:24:05 +00:00
|
|
|
gboolean tohex;
|
2014-01-14 03:16:27 +00:00
|
|
|
const char *key;
|
|
|
|
const char *val;
|
2012-01-20 03:24:05 +00:00
|
|
|
guint orig_offset = offset;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
key = NULL;
|
|
|
|
val = NULL;
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
ti = proto_tree_add_item( tree, hf_bencoded_dict_entry, tvb, offset, 0, ENC_NA );
|
2011-10-28 14:50:13 +00:00
|
|
|
sub_tree = proto_item_add_subtree( ti, ett_bencoded_dict_entry);
|
|
|
|
|
|
|
|
/* dissect the key, it must be a string */
|
2012-01-20 03:24:05 +00:00
|
|
|
offset = dissect_bencoded_string( tvb, pinfo, sub_tree, offset, &key, FALSE, "Key" );
|
2016-10-18 20:44:51 +00:00
|
|
|
if (offset == 0)
|
|
|
|
{
|
|
|
|
proto_tree_add_expert_format(sub_tree, pinfo, &ei_int_string, tvb, offset, -1, "Invalid string for Key");
|
|
|
|
return 0;
|
|
|
|
}
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
/* If it is a dict, then just do recursion */
|
2011-10-28 14:50:13 +00:00
|
|
|
switch( tvb_get_guint8(tvb,offset) )
|
|
|
|
{
|
|
|
|
case 'd':
|
|
|
|
offset = dissect_bencoded_dict( tvb, pinfo, sub_tree, offset, "Value" );
|
2014-01-14 03:16:27 +00:00
|
|
|
val = dict_str;
|
2011-10-28 14:50:13 +00:00
|
|
|
break;
|
|
|
|
case 'l':
|
|
|
|
if( strcmp(key,"e")==0 )
|
|
|
|
offset = dissect_bt_dht_error( tvb, pinfo, sub_tree, offset, &val, "Value" );
|
|
|
|
else if( strcmp(key,"values")==0 )
|
|
|
|
offset = dissect_bt_dht_values( tvb, pinfo, sub_tree, offset, &val, "Value" );
|
|
|
|
/* other unfamiliar lists */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
offset = dissect_bencoded_list( tvb, pinfo, sub_tree, offset, "Value" );
|
2014-01-14 03:16:27 +00:00
|
|
|
val = list_str;
|
2011-10-28 14:50:13 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'i':
|
|
|
|
offset = dissect_bencoded_int( tvb, pinfo, sub_tree, offset, &val, "Value" );
|
|
|
|
break;
|
|
|
|
/* it's a string */
|
|
|
|
default:
|
|
|
|
/* special process */
|
2012-12-05 09:27:58 +00:00
|
|
|
if( strcmp(key,"nodes")==0 )
|
|
|
|
{
|
2017-02-28 20:19:48 +00:00
|
|
|
offset = dissect_bt_dht_nodes( tvb, pinfo, sub_tree, offset, &val, "Value", 0 );
|
|
|
|
}
|
|
|
|
else if( strcmp(key,"nodes6")==0 )
|
|
|
|
{
|
|
|
|
offset = dissect_bt_dht_nodes( tvb, pinfo, sub_tree, offset, &val, "Value", 1 );
|
2012-12-05 09:27:58 +00:00
|
|
|
}
|
|
|
|
else if( strcmp(key,"ip")==0 )
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Not found in BEP 0005 but explained by
|
|
|
|
* http://www.rasterbar.com/products/libtorrent/dht_sec.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
int len, old_offset;
|
|
|
|
old_offset = offset;
|
|
|
|
len = bencoded_string_length(tvb, &offset);
|
|
|
|
|
|
|
|
if(len == 4) {
|
2013-04-20 09:49:00 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_ip, tvb, offset, len, ENC_BIG_ENDIAN);
|
2014-01-14 03:16:27 +00:00
|
|
|
val = tvb_ip_to_str(tvb, offset);
|
2012-12-05 09:27:58 +00:00
|
|
|
offset += len;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
offset = dissect_bencoded_string( tvb, pinfo, sub_tree, old_offset, &val, TRUE, "Value" );
|
|
|
|
}
|
|
|
|
}
|
2011-10-28 14:50:13 +00:00
|
|
|
else
|
|
|
|
{
|
2012-12-05 09:27:58 +00:00
|
|
|
/* some need to return hex string */
|
2011-10-28 14:50:13 +00:00
|
|
|
tohex = strcmp(key,"id")==0 || strcmp(key,"target")==0
|
|
|
|
|| strcmp(key,"info_hash")==0 || strcmp(key,"t")==0
|
2012-12-05 09:27:58 +00:00
|
|
|
|| strcmp(key,"v")==0 || strcmp(key,"token")==0;
|
2011-10-28 14:50:13 +00:00
|
|
|
offset = dissect_bencoded_string( tvb, pinfo, sub_tree, offset, &val, tohex, "Value" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-18 20:44:51 +00:00
|
|
|
if (offset == 0)
|
|
|
|
{
|
|
|
|
proto_tree_add_expert_format(sub_tree, pinfo, &ei_int_string, tvb, offset, -1, "Invalid string for value");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
if( strlen(key)==1 )
|
2014-01-14 03:16:27 +00:00
|
|
|
key = val_to_str_const( key[0], short_key_name_value_string, key );
|
2011-10-28 14:50:13 +00:00
|
|
|
if( strlen(val)==1 )
|
2014-01-14 03:16:27 +00:00
|
|
|
val = val_to_str_const( val[0], short_val_name_value_string, val );
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
proto_item_set_text( ti, "%s: %s", key, val );
|
2012-01-20 03:24:05 +00:00
|
|
|
proto_item_set_len( ti, offset-orig_offset );
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
if( strcmp(key,"message_type")==0 || strcmp(key,"request_type")==0 )
|
2013-04-20 09:49:00 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "%s=%s ", key, val);
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* dict = d...e */
|
2012-01-20 03:24:05 +00:00
|
|
|
static int
|
2012-12-26 05:57:06 +00:00
|
|
|
dissect_bencoded_dict(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const char *label )
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *sub_tree;
|
2012-01-20 03:24:05 +00:00
|
|
|
guint orig_offset = offset;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2012-12-05 09:27:58 +00:00
|
|
|
if(offset == 0)
|
|
|
|
{
|
|
|
|
ti = proto_tree_add_item(tree, proto_bt_dht, tvb, 0, -1, ENC_NA);
|
|
|
|
sub_tree = proto_item_add_subtree(ti, ett_bt_dht);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-04-20 09:49:00 +00:00
|
|
|
ti = proto_tree_add_none_format( tree, hf_bencoded_dict, tvb, offset, -1, "%s: Dictionary...", label );
|
2012-12-05 09:27:58 +00:00
|
|
|
sub_tree = proto_item_add_subtree( ti, ett_bencoded_dict);
|
|
|
|
}
|
2011-10-28 14:50:13 +00:00
|
|
|
|
|
|
|
/* skip the first char('d') */
|
2012-01-20 03:24:05 +00:00
|
|
|
offset += 1;
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2016-10-18 20:44:51 +00:00
|
|
|
while( tvb_get_guint8(tvb,offset)!='e' ) {
|
2011-10-28 14:50:13 +00:00
|
|
|
offset = dissect_bencoded_dict_entry( tvb, pinfo, sub_tree, offset );
|
2016-10-18 20:44:51 +00:00
|
|
|
if (offset == 0)
|
|
|
|
{
|
|
|
|
proto_tree_add_expert(sub_tree, pinfo, &ei_int_string, tvb, offset, -1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2016-10-19 09:16:58 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_bencoded_list_terminator, tvb, offset, 1, ENC_ASCII|ENC_NA);
|
2012-01-20 03:24:05 +00:00
|
|
|
offset += 1;
|
|
|
|
proto_item_set_len( ti, offset-orig_offset );
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
static int
|
2012-09-10 21:40:21 +00:00
|
|
|
dissect_bt_dht(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BT-DHT");
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2016-11-08 15:31:01 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "BitTorrent DHT Protocol");
|
2012-01-20 03:24:05 +00:00
|
|
|
|
2012-12-05 09:27:58 +00:00
|
|
|
return dissect_bencoded_dict(tvb, pinfo, tree, 0, "BitTorrent DHT Protocol");
|
2011-10-28 14:50:13 +00:00
|
|
|
}
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
static
|
|
|
|
gboolean dissect_bt_dht_heur (tvbuff_t *tvb, packet_info *pinfo,
|
2012-09-10 21:40:21 +00:00
|
|
|
proto_tree *tree, void *data _U_)
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
2014-03-14 17:05:15 +00:00
|
|
|
conversation_t *conversation;
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
/* try dissecting */
|
2012-12-05 09:27:58 +00:00
|
|
|
/* Assume dictionary (d) is followed by a one char long (1:) key string. */
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2015-06-22 21:40:23 +00:00
|
|
|
if(tvb_captured_length(tvb) < 4)
|
2014-03-14 17:05:15 +00:00
|
|
|
return FALSE;
|
2012-12-05 09:27:58 +00:00
|
|
|
|
2014-03-14 17:05:15 +00:00
|
|
|
if(tvb_memeql(tvb, 0, "d1:", 3) != 0)
|
|
|
|
return FALSE;
|
2012-01-20 03:24:05 +00:00
|
|
|
|
2014-03-14 17:05:15 +00:00
|
|
|
/* Is 'key' a valid key ? */
|
|
|
|
if(try_val_to_str(tvb_get_guint8(tvb, 3), short_key_name_value_string) == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
conversation = find_or_create_conversation(pinfo);
|
|
|
|
conversation_set_dissector(conversation, bt_dht_handle);
|
|
|
|
|
|
|
|
dissect_bt_dht(tvb, pinfo, tree, NULL);
|
|
|
|
return TRUE;
|
2011-10-28 14:50:13 +00:00
|
|
|
}
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
void
|
|
|
|
proto_register_bt_dht(void)
|
2011-10-28 14:50:13 +00:00
|
|
|
{
|
2016-10-18 20:44:51 +00:00
|
|
|
expert_module_t* expert_bt_dht;
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_bencoded_string,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "String", "bt-dht.bencoded.string",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bencoded_list,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "List", "bt-dht.bencoded.list",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bencoded_int,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "Int", "bt-dht.bencoded.int",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bencoded_dict,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "Dictionary", "bt-dht.bencoded.dict",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bencoded_dict_entry,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "Dictionary Entry", "bt-dht.bencoded.dict_entry",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
2016-10-19 09:16:58 +00:00
|
|
|
{ &hf_bencoded_list_terminator,
|
|
|
|
{ "Terminator", "bt-dht.bencoded.list.terminator",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
2011-10-28 14:50:13 +00:00
|
|
|
{ &hf_bt_dht_error,
|
|
|
|
{ "Error", "bt-dht.error",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bt_dht_peer,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "Peer", "bt-dht.peer",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bt_dht_peers,
|
|
|
|
{ "Peers", "bt-dht.peers",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bt_dht_node,
|
|
|
|
{ "Node", "bt-dht.node",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bt_dht_nodes,
|
|
|
|
{ "Nodes", "bt-dht.nodes",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_bt_dht_id,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "ID", "bt-dht.id",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_ip,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "IP", "bt-dht.ip",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
2017-02-28 20:19:48 +00:00
|
|
|
{ &hf_ip6,
|
|
|
|
{ "IP", "bt-dht.ip6",
|
|
|
|
FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
2011-10-28 14:50:13 +00:00
|
|
|
{ &hf_port,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "Port", "bt-dht.port",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_truncated_data,
|
2013-04-20 09:49:00 +00:00
|
|
|
{ "Truncated data", "bt-dht.truncated_data",
|
2011-10-28 14:50:13 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-10-18 20:44:51 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_int_string, { "bt-dht.invalid_string", PI_MALFORMED, PI_ERROR,
|
|
|
|
"String must contain an integer", EXPFILL }}
|
|
|
|
};
|
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
/* Setup protocol subtree array */
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_bt_dht,
|
|
|
|
&ett_bencoded_list,
|
|
|
|
&ett_bencoded_dict,
|
|
|
|
&ett_bt_dht_error,
|
|
|
|
&ett_bt_dht_peers,
|
|
|
|
&ett_bt_dht_nodes,
|
|
|
|
&ett_bencoded_dict_entry
|
|
|
|
};
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
module_t *bt_dht_module;
|
|
|
|
|
2016-10-05 20:33:54 +00:00
|
|
|
proto_bt_dht = proto_register_protocol ("BitTorrent DHT Protocol", "BT-DHT", "bt-dht");
|
2011-10-28 14:50:13 +00:00
|
|
|
|
2016-10-05 20:33:54 +00:00
|
|
|
bt_dht_module = prefs_register_protocol(proto_bt_dht, NULL);
|
2015-07-13 00:40:31 +00:00
|
|
|
prefs_register_obsolete_preference(bt_dht_module, "enable");
|
2012-01-20 03:24:05 +00:00
|
|
|
|
2011-10-28 14:50:13 +00:00
|
|
|
proto_register_field_array(proto_bt_dht, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2016-10-18 20:44:51 +00:00
|
|
|
|
|
|
|
expert_bt_dht = expert_register_protocol(proto_bt_dht);
|
|
|
|
expert_register_field_array(expert_bt_dht, ei, array_length(ei));
|
2011-10-28 14:50:13 +00:00
|
|
|
}
|
2011-11-15 19:00:08 +00:00
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
void
|
|
|
|
proto_reg_handoff_bt_dht(void)
|
2011-11-15 19:00:08 +00:00
|
|
|
{
|
2012-01-20 03:24:05 +00:00
|
|
|
/* "Decode As" is always available;
|
|
|
|
* Heuristic dissection in disabled by default since the heuristic is quite weak.
|
2012-12-05 09:27:58 +00:00
|
|
|
* XXX - Still too weak?
|
2012-01-20 03:24:05 +00:00
|
|
|
*/
|
2016-10-05 20:33:54 +00:00
|
|
|
heur_dissector_add("udp", dissect_bt_dht_heur, "BitTorrent DHT over UDP", "bittorrent_dht_udp", proto_bt_dht, HEURISTIC_DISABLE);
|
2012-01-20 03:24:05 +00:00
|
|
|
|
2016-10-05 20:33:54 +00:00
|
|
|
bt_dht_handle = create_dissector_handle(dissect_bt_dht, proto_bt_dht);
|
|
|
|
dissector_add_for_decode_as_with_preference("udp.port", bt_dht_handle);
|
2011-11-15 19:00:08 +00:00
|
|
|
}
|
|
|
|
|
2012-01-20 03:24:05 +00:00
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 2
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=2 tabstop=8 expandtab:
|
|
|
|
* :indentSize=2:tabSize=8:noTabs=true:
|
|
|
|
*/
|