diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-10-15 18:46:26 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-10-15 18:46:26 +0000 |
commit | 324bfeb5e255e490809e91ccd615d7d9b538984c (patch) | |
tree | 16b43738b14751d74a8ca8e4de803ba0b6c87196 /epan/dissectors/packet-stun.c | |
parent | 7b25ae429b0dab3ed9566f8a9d1a069216bc69e4 (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).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39426 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-stun.c')
-rw-r--r-- | epan/dissectors/packet-stun.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c index 996fd10ae0..f74878024f 100644 --- a/epan/dissectors/packet-stun.c +++ b/epan/dissectors/packet-stun.c @@ -677,7 +677,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; case USERNAME: - proto_tree_add_item(att_tree, stun_att_username, tvb, offset, att_length, ENC_BIG_ENDIAN); + proto_tree_add_item(att_tree, stun_att_username, tvb, offset, att_length, ENC_ASCII|ENC_NA); proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset, att_length)); col_append_fstr( pinfo->cinfo, COL_INFO, @@ -722,7 +722,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } if (att_length < 5) break; - proto_tree_add_item(att_tree, stun_att_error_reason, tvb, offset+4, att_length-4, ENC_BIG_ENDIAN); + proto_tree_add_item(att_tree, stun_att_error_reason, tvb, offset+4, att_length-4, ENC_ASCII|ENC_NA); proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset+4, att_length-4)); col_append_fstr( @@ -744,7 +744,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; case REALM: - proto_tree_add_item(att_tree, stun_att_realm, tvb, offset, att_length, ENC_BIG_ENDIAN); + proto_tree_add_item(att_tree, stun_att_realm, tvb, offset, att_length, ENC_ASCII|ENC_NA); proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset, att_length)); col_append_fstr( pinfo->cinfo, COL_INFO, @@ -756,7 +756,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; case NONCE: - proto_tree_add_item(att_tree, stun_att_nonce, tvb, offset, att_length, ENC_BIG_ENDIAN); + proto_tree_add_item(att_tree, stun_att_nonce, tvb, offset, att_length, ENC_ASCII|ENC_NA); proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset, att_length)); col_append_fstr( pinfo->cinfo, COL_INFO, @@ -877,7 +877,7 @@ case EVEN_PORT: break; case SOFTWARE: - proto_tree_add_item(att_tree, stun_att_software, tvb, offset, att_length, ENC_BIG_ENDIAN); + proto_tree_add_item(att_tree, stun_att_software, tvb, offset, att_length, ENC_ASCII|ENC_NA); if (att_length % 4 != 0) proto_tree_add_uint(att_tree, stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4)); break; |