diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-01 10:08:57 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-08-03 16:30:10 +0000 |
commit | 5db1352526e71727091ff0e1c0e97821eec4e4cb (patch) | |
tree | 01f836967616b7ae8b2840c488b500c7ff13d55c /epan/dissectors/packet-bittorrent.c | |
parent | 3fa5625ea074908d5617111a7edfcf6d95e6108a (diff) |
Eliminate proto_tree_add_text from some dissectors.
Change-Id: I398e9cf4f6882e76644aa758e12c39a39159e95f
Reviewed-on: https://code.wireshark.org/review/3319
Petri-Dish: Michael Mann <mmann78@netscape.net>
Petri-Dish: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-bittorrent.c')
-rw-r--r-- | epan/dissectors/packet-bittorrent.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c index ccbdb1b8e4..49a514898b 100644 --- a/epan/dissectors/packet-bittorrent.c +++ b/epan/dissectors/packet-bittorrent.c @@ -155,6 +155,8 @@ static gint hf_azureus_jpc_port = -1; static gint hf_azureus_jpc_session = -1; static gint hf_bittorrent_port = -1; static gint hf_bittorrent_extended = -1; +static gint hf_bittorrent_continuous_data = -1; +static gint hf_bittorrent_version = -1; static gint ett_bittorrent = -1; static gint ett_bittorrent_msg = -1; @@ -362,7 +364,7 @@ dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } #endif if (msgtype == NULL) { - proto_tree_add_text(tree, tvb, offset, -1, "Continuation data"); + proto_tree_add_item(tree, hf_bittorrent_continuous_data, tvb, offset, -1, ENC_NA); col_set_str(pinfo->cinfo, COL_INFO, "Continuation data"); return; } @@ -514,9 +516,8 @@ dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t if(tvb_memeql(tvb, offset, peer_id[i].id, (int)strlen(peer_id[i].id)) == 0) { version = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + (int)strlen(peer_id[i].id), peer_id[i].ver_len, ENC_ASCII); - proto_tree_add_text(tree, tvb, offset, 20, "Client is %s v%s", - peer_id[i].name, - format_text((guchar*)version, peer_id[i].ver_len)); + proto_tree_add_string_format(tree, hf_bittorrent_version, tvb, offset, 20, version, "Client is %s v%s", + peer_id[i].name, format_text((guchar*)version, peer_id[i].ver_len)); break; } } @@ -655,7 +656,13 @@ proto_register_bittorrent(void) }, { &hf_bittorrent_extended, { "Extended Message", "bittorrent.extended", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } - } + }, + { &hf_bittorrent_continuous_data, + { "Extended Message", "bittorrent.continuous_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, + { &hf_bittorrent_version, + { "Client version", "bittorrent.version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } + }, }; static gint *ett[] = { |