aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bittorrent.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2011-10-15 18:46:26 +0000
committerBill Meier <wmeier@newsguy.com>2011-10-15 18:46:26 +0000
commit126aa8539380e6b0b465b48d30f349b76afdc489 (patch)
tree16b43738b14751d74a8ca8e4de803ba0b6c87196 /epan/dissectors/packet-bittorrent.c
parent4c9bb81ad7b0f609fa236c808a1ab9ef6cab5a79 (diff)
Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified then use ENC_ASCII. 2. For all but FT_UINT_STRING, always use ENC_NA (replacing any existing True/1/FALSE/0 /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN). svn path=/trunk/; revision=39426
Diffstat (limited to 'epan/dissectors/packet-bittorrent.c')
-rw-r--r--epan/dissectors/packet-bittorrent.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c
index 4e6e9a78ad..725bc8ff38 100644
--- a/epan/dissectors/packet-bittorrent.c
+++ b/epan/dissectors/packet-bittorrent.c
@@ -343,7 +343,7 @@ static int dissect_bencoding_str(tvbuff_t *tvb, packet_info *pinfo _U_,
}
if (tree) {
proto_tree_add_uint(tree, hf_bittorrent_bstr_length, tvb, offset, used, stringlen);
- proto_tree_add_item(tree, hf_bittorrent_bstr, tvb, offset+used, stringlen, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_bittorrent_bstr, tvb, offset+used, stringlen, ENC_ASCII|ENC_NA);
if (treeadd==1) {
proto_item_append_text(ti, " Key: %s", format_text(ep_tvb_memdup(tvb, offset+used, stringlen), stringlen));
@@ -658,7 +658,7 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto
throw an exception, so we won't use msgtype or type. */
if (isamp) {
proto_tree_add_item(mtree, hf_azureus_msg_type_len, tvb, offset, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(mtree, hf_azureus_msg_type, tvb, offset+4, typelen, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mtree, hf_azureus_msg_type, tvb, offset+4, typelen, ENC_ASCII|ENC_NA);
proto_item_append_text(ti, ": Len %u, %s", length, msgtype);
proto_tree_add_item(mtree, hf_azureus_msg_prio, tvb, offset+4+typelen, 1, ENC_BIG_ENDIAN);
offset += 4+typelen+1;
@@ -743,7 +743,7 @@ static void dissect_bittorrent_message (tvbuff_t *tvb, packet_info *pinfo, proto
case AZUREUS_MESSAGE_JPC_HELLO:
stringlen = tvb_get_ntohl(tvb, offset);
proto_tree_add_item(mtree, hf_azureus_jpc_addrlen, tvb, offset, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(mtree, hf_azureus_jpc_addr, tvb, offset+4, stringlen, ENC_BIG_ENDIAN);
+ proto_tree_add_item(mtree, hf_azureus_jpc_addr, tvb, offset+4, stringlen, ENC_ASCII|ENC_NA);
proto_tree_add_item(mtree, hf_azureus_jpc_port, tvb, offset+4+stringlen, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(mtree, hf_azureus_jpc_session, tvb, offset+4+stringlen+4, 4, ENC_BIG_ENDIAN);
break;
@@ -766,7 +766,7 @@ static void dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo _U_, p
col_set_str(pinfo->cinfo, COL_INFO, "Handshake");
proto_tree_add_item(tree, hf_bittorrent_prot_name_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset+=1;
- proto_tree_add_item(tree, hf_bittorrent_prot_name, tvb, offset, 19, ENC_BIG_ENDIAN); offset += 19;
+ proto_tree_add_item(tree, hf_bittorrent_prot_name, tvb, offset, 19, ENC_ASCII|ENC_NA); offset += 19;
proto_tree_add_item(tree, hf_bittorrent_reserved, tvb, offset, 8, ENC_NA); offset += 8;
proto_tree_add_item(tree, hf_bittorrent_sha1_hash, tvb, offset, 20, ENC_NA);