diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-12-22 02:12:32 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-12-22 02:12:32 +0000 |
commit | 5084f58ce2ca1c1e0db771cd3649d4439ae7e4a5 (patch) | |
tree | 6bdab790e63f17b091b2f1fe990e381803f4cde3 /epan/dissectors/packet-gsm_map.c | |
parent | f9cce15b3592b60e85b22ddad97a999af350469f (diff) |
We support ENC_UCS_2, so use that in proto_tree_add_item() and
tvb_get_string_enc() rather than using iconv to convert it to UTF-8.
svn path=/trunk/; revision=54350
Diffstat (limited to 'epan/dissectors/packet-gsm_map.c')
-rw-r--r-- | epan/dissectors/packet-gsm_map.c | 58 |
1 files changed, 22 insertions, 36 deletions
diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c index d68a38d194..bf44cae516 100644 --- a/epan/dissectors/packet-gsm_map.c +++ b/epan/dissectors/packet-gsm_map.c @@ -3546,7 +3546,7 @@ static const ber_sequence_t gsm_map_ExternalSignalInfo_sequence[] = { int dissect_gsm_map_ExternalSignalInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 778 "../../asn1/gsm_map/gsm_map.cnf" +#line 764 "../../asn1/gsm_map/gsm_map.cnf" /* -- Information about the internal structure is given in -- clause 7.6.9. @@ -3762,7 +3762,7 @@ dissect_gsm_map_AlertingPattern(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in int dissect_gsm_map_GSN_Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 603 "../../asn1/gsm_map/gsm_map.cnf" +#line 589 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; guint8 octet; @@ -3913,7 +3913,7 @@ dissect_gsm_map_HLR_List(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse int dissect_gsm_map_GlobalCellId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 858 "../../asn1/gsm_map/gsm_map.cnf" +#line 844 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -4190,7 +4190,7 @@ dissect_gsm_map_TA_Id(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _ int dissect_gsm_map_RAIdentity(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 627 "../../asn1/gsm_map/gsm_map.cnf" +#line 613 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -4238,7 +4238,7 @@ dissect_gsm_map_CellGlobalIdOrServiceAreaIdFixedLength(gboolean implicit_tag _U_ int dissect_gsm_map_LAIFixedLength(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 639 "../../asn1/gsm_map/gsm_map.cnf" +#line 625 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -4531,7 +4531,7 @@ dissect_gsm_map_ss_ForwardingOptions(gboolean implicit_tag _U_, tvbuff_t *tvb _U offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); -#line 546 "../../asn1/gsm_map/gsm_map.cnf" +#line 532 "../../asn1/gsm_map/gsm_map.cnf" proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,ENC_BIG_ENDIAN); @@ -4886,8 +4886,6 @@ dissect_gsm_map_ss_USSD_String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int */ static unsigned char msgbuf[1024]; gchar *utf8_text = NULL; - GIConv cd; - GError *l_conv_error = NULL; offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, ¶meter_tvb); @@ -4908,24 +4906,12 @@ dissect_gsm_map_ss_USSD_String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int proto_tree_add_text(tree, parameter_tvb, 0, length, "USSD String: %s", utf8_text); break; case SMS_ENCODING_8BIT: - proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %s", tvb_get_string(wmem_packet_scope(), parameter_tvb, 0, length)); + /* XXX - ASCII, or some extended ASCII? */ + proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %s", tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_ASCII|ENC_NA)); break; case SMS_ENCODING_UCS2: case SMS_ENCODING_UCS2_LANG: - if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv) -1) - { - utf8_text = g_convert_with_iconv(tvb_get_ptr(parameter_tvb, 0, length), length, cd, NULL, NULL, &l_conv_error); - if(!l_conv_error) - proto_tree_add_text(tree, tvb, 0, length, "USSD String: %s", utf8_text); - else - proto_tree_add_text(tree, tvb, 0, length, "USSD String: g_convert_with_iconv FAILED"); - - g_free(utf8_text); - g_iconv_close(cd); - } - else - proto_tree_add_text(tree, tvb, 0, length, "USSD String: g_iconv_open FAILED contact wireshark"); - + proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %s", tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_UCS_2|ENC_BIG_ENDIAN)); break; default: break; @@ -8493,7 +8479,7 @@ dissect_gsm_map_ms_SGSN_Capability(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, static int dissect_gsm_map_ms_APN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 892 "../../asn1/gsm_map/gsm_map.cnf" +#line 878 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; int length, name_len, tmp; @@ -8740,7 +8726,7 @@ dissect_gsm_map_ms_UpdateGprsLocationRes(gboolean implicit_tag _U_, tvbuff_t *tv static int dissect_gsm_map_ms_IntegrityProtectionInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 675 "../../asn1/gsm_map/gsm_map.cnf" +#line 661 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; asn1_ctx_t asn1_ctx; @@ -8763,7 +8749,7 @@ dissect_gsm_map_ms_IntegrityProtectionInformation(gboolean implicit_tag _U_, tvb static int dissect_gsm_map_ms_EncryptionInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 687 "../../asn1/gsm_map/gsm_map.cnf" +#line 673 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; asn1_ctx_t asn1_ctx; @@ -8848,7 +8834,7 @@ dissect_gsm_map_ms_AllowedUMTS_Algorithms(gboolean implicit_tag _U_, tvbuff_t *t static int dissect_gsm_map_ms_RadioResourceInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 651 "../../asn1/gsm_map/gsm_map.cnf" +#line 637 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -8919,7 +8905,7 @@ dissect_gsm_map_ms_BSSMAP_ServiceHandover(gboolean implicit_tag _U_, tvbuff_t *t static int dissect_gsm_map_ms_RANAP_ServiceHandover(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 663 "../../asn1/gsm_map/gsm_map.cnf" +#line 649 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; asn1_ctx_t asn1_ctx; @@ -9865,7 +9851,7 @@ static int dissect_gsm_map_ms_T_forwardingOptions(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { offset = dissect_gsm_map_ms_Ext_ForwOptions(implicit_tag, tvb, offset, actx, tree, hf_index); -#line 552 "../../asn1/gsm_map/gsm_map.cnf" +#line 538 "../../asn1/gsm_map/gsm_map.cnf" proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,ENC_BIG_ENDIAN); @@ -11028,7 +11014,7 @@ dissect_gsm_map_ms_VlrCamelSubscriptionInfo(gboolean implicit_tag _U_, tvbuff_t static int dissect_gsm_map_ms_PDP_Type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 560 "../../asn1/gsm_map/gsm_map.cnf" +#line 546 "../../asn1/gsm_map/gsm_map.cnf" guint8 pdp_type_org; tvbuff_t *parameter_tvb; @@ -11061,7 +11047,7 @@ dissect_gsm_map_ms_PDP_Type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of int dissect_gsm_map_ms_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 582 "../../asn1/gsm_map/gsm_map.cnf" +#line 568 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; @@ -11083,7 +11069,7 @@ dissect_gsm_map_ms_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int dissect_gsm_map_ms_Ext_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 593 "../../asn1/gsm_map/gsm_map.cnf" +#line 579 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; @@ -12586,7 +12572,7 @@ dissect_gsm_map_ms_GeographicalInformation(gboolean implicit_tag _U_, tvbuff_t * static int dissect_gsm_map_ms_LocationNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 919 "../../asn1/gsm_map/gsm_map.cnf" +#line 905 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; const char *digit_str; @@ -15437,7 +15423,7 @@ dissect_gsm_map_lcs_ProvideSubscriberLocation_Arg(gboolean implicit_tag _U_, tvb int dissect_gsm_map_lcs_Ext_GeographicalInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 870 "../../asn1/gsm_map/gsm_map.cnf" +#line 856 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; @@ -16863,7 +16849,7 @@ static const ber_sequence_t gsm_old_Bss_APDU_sequence[] = { static int dissect_gsm_old_Bss_APDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 700 "../../asn1/gsm_map/gsm_map.cnf" +#line 686 "../../asn1/gsm_map/gsm_map.cnf" guint8 octet; guint8 length; tvbuff_t *next_tvb; @@ -18410,7 +18396,7 @@ dissect_gsm_ss_LCS_PeriodicLocationCancellationArg(gboolean implicit_tag _U_, tv static int dissect_gsm_map_ericsson_T_locationInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 948 "../../asn1/gsm_map/gsm_map.cnf" +#line 934 "../../asn1/gsm_map/gsm_map.cnf" tvbuff_t *parameter_tvb; proto_tree *subtree; guint8 rat; |