diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2008-04-07 20:52:34 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2008-04-07 20:52:34 +0000 |
commit | 3c6b969c65b46ad618e051c5f42ceb5111fd7358 (patch) | |
tree | e39f0c1ad4866b633bbe51dc5838c8e8dae023c8 /asn1 | |
parent | 63a0378934fa8e7714fa23a9ee093396b84ea3d4 (diff) |
Since the GTK1 code was taken out of gsmmap_add_ucs2_ussd_string(), move that code back into gsmmap.cnf (this undoes rev 24227 whose sole purpose was to allow GTK1 builds).
svn path=/trunk/; revision=24836
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/gsmmap/gsmmap.cnf | 20 | ||||
-rw-r--r-- | asn1/gsmmap/packet-gsmmap-template.c | 27 |
2 files changed, 21 insertions, 26 deletions
diff --git a/asn1/gsmmap/gsmmap.cnf b/asn1/gsmmap/gsmmap.cnf index b1642c5f0e..585fa23407 100644 --- a/asn1/gsmmap/gsmmap.cnf +++ b/asn1/gsmmap/gsmmap.cnf @@ -365,6 +365,9 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; * use ep_alloc ? */ static unsigned char bigbuf[1024]; + gchar *utf8_text = NULL; + GIConv cd; + GError *l_conv_error = NULL; %(DEFAULT_BODY)s if (!parameter_tvb) @@ -388,7 +391,22 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; break; case SMS_ENCODING_UCS2: case SMS_ENCODING_UCS2_LANG: - gsmmap_add_ucs2_ussd_string(tvb, tree, length); + if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv) -1) + { + utf8_text = g_convert_with_iconv(tvb->real_data, 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"); + + if(utf8_text) + 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"); + break; default: break; diff --git a/asn1/gsmmap/packet-gsmmap-template.c b/asn1/gsmmap/packet-gsmmap-template.c index 72663f2de8..985bef405f 100644 --- a/asn1/gsmmap/packet-gsmmap-template.c +++ b/asn1/gsmmap/packet-gsmmap-template.c @@ -238,31 +238,8 @@ const value_string gsm_map_etsi_defined_pdp_vals[] = { { 0, NULL } }; -static void -gsmmap_add_ucs2_ussd_string(tvbuff_t *tvb, proto_tree *tree, int length) -{ - gchar *utf8_text = NULL; - GIConv cd; - GError *l_conv_error = NULL; - - if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv) -1) - { - utf8_text = g_convert_with_iconv(tvb->real_data, 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"); - - if(utf8_text) - 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"); -} - -char * unpack_digits(tvbuff_t *tvb, int offset){ +char * +unpack_digits(tvbuff_t *tvb, int offset) { int length; guint8 octet; |