diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-12-16 22:39:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-12-16 22:39:41 +0000 |
commit | 068008f04f9c31a47197564b1de2f6f2ddd9b3ab (patch) | |
tree | 626069aac3c295f0612e774fd09ccee255d19397 /epan/dissectors/packet-ms-mms.c | |
parent | 54c272466f362a169421c9d8f7571c4c0459d117 (diff) |
Use proto_tree_add_item() in preference to fetching the string and
adding it with proto_tree_add_string(). Use tvb_get_string_enc() rather
than tvb_get_unicode_string() to fetch strings.
We assume a UTF-16 encoding for all "Unicode" strings.
Use tvb_strsize() and tvb_unicode_strsize() to get the lengths of
null-terminated strings.
Get rid of unused ett_nt_unicode_string variable.
svn path=/trunk/; revision=54158
Diffstat (limited to 'epan/dissectors/packet-ms-mms.c')
-rw-r--r-- | epan/dissectors/packet-ms-mms.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ms-mms.c b/epan/dissectors/packet-ms-mms.c index 9b1a1f5514..4da7ab590e 100644 --- a/epan/dissectors/packet-ms-mms.c +++ b/epan/dissectors/packet-ms-mms.c @@ -2,6 +2,12 @@ * * Routines for MicroSoft MMS (Microsoft Media Server) message dissection * + * See + * + * http://msdn.microsoft.com/en-us/library/cc234711.aspx + * + * for the [MS-MMSP] specification. + * * Copyright 2005 * Written by Martin Mathieson * @@ -760,7 +766,7 @@ static void dissect_client_transport_info(tvbuff_t *tvb, packet_info *pinfo, pro offset += 4; /* Extract and show the string in tree and info column */ - transport_info = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length_remaining - 20, ENC_LITTLE_ENDIAN); + transport_info = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length_remaining - 20, ENC_UTF_16|ENC_LITTLE_ENDIAN); proto_tree_add_string_format(tree, hf_msmms_command_client_transport_info, tvb, offset, length_remaining-20, @@ -868,7 +874,7 @@ static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t THROW(ReportedBoundsError); if (server_version_length > 1) { - server_version = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, server_version_length*2, ENC_LITTLE_ENDIAN); + server_version = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, server_version_length*2, ENC_UTF_16|ENC_LITTLE_ENDIAN); /* Server version string */ proto_tree_add_item(tree, hf_msmms_command_server_version, tvb, @@ -934,7 +940,7 @@ static void dissect_client_player_info(tvbuff_t *tvb, packet_info *pinfo, proto_ offset += 4; /* Extract and show the string in tree and info column */ - player_info = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length_remaining - 12, ENC_LITTLE_ENDIAN); + player_info = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length_remaining - 12, ENC_UTF_16|ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_msmms_command_client_player_info, tvb, offset, length_remaining-12, @@ -1011,7 +1017,7 @@ static void dissect_request_server_file(tvbuff_t *tvb, packet_info *pinfo, proto offset += 4; /* File path on server */ - server_file = tvb_get_unicode_string(wmem_packet_scope(), tvb, offset, length_remaining - 16, ENC_LITTLE_ENDIAN); + server_file = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length_remaining - 16, ENC_UTF_16|ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_msmms_command_server_file, tvb, offset, length_remaining-16, |