diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2008-01-30 17:11:06 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2008-01-30 17:11:06 +0000 |
commit | 8ba9f2d3a41e2d500fcc252bc7748ee828d453b8 (patch) | |
tree | 5218c2954dae7bd0cfa859053a1466be8a363f4f /asn1/gsmmap/gsmmap.cnf | |
parent | 869213d9ef897940716aa61844fe01d290f0ed37 (diff) |
Move glib-2 specific code out of gsmmap.cnf (where we can't #ifdef around
it--asn2wrs doesn't understand #ifdef's) to packet-gsm-template.c
svn path=/trunk/; revision=24227
Diffstat (limited to 'asn1/gsmmap/gsmmap.cnf')
-rw-r--r-- | asn1/gsmmap/gsmmap.cnf | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/asn1/gsmmap/gsmmap.cnf b/asn1/gsmmap/gsmmap.cnf index c7afed9515..ad41641e06 100644 --- a/asn1/gsmmap/gsmmap.cnf +++ b/asn1/gsmmap/gsmmap.cnf @@ -360,9 +360,6 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; tvbuff_t *parameter_tvb; int length; guint8 out_len; - gchar *utf8_text = NULL; - GIConv cd; - GError *l_conv_error = NULL; /* XXX - The maximum item label length is 240. Does this really need to be 1024? * use ep_alloc ? */ @@ -375,35 +372,24 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; length = tvb_length_remaining(parameter_tvb,0); switch(sms_encoding){ case SMS_ENCODING_7BIT: - case SMS_ENCODING_7BIT_LANG: + case SMS_ENCODING_7BIT_LANG: out_len = gsm_sms_char_7bit_unpack(0, length, sizeof(bigbuf), - tvb_get_ptr(parameter_tvb, 0, length), bigbuf); + tvb_get_ptr(parameter_tvb, 0, length), + bigbuf); bigbuf[out_len] = '\0'; gsm_sms_char_ascii_decode(bigbuf, bigbuf, out_len); bigbuf[1023] = '\0'; proto_tree_add_text(tree, parameter_tvb, 0, length, "USSD String: %%s", bigbuf); break; - case SMS_ENCODING_8BIT: - proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s",tvb_get_ptr(parameter_tvb, 0, length)); + case SMS_ENCODING_8BIT: + proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_ptr(parameter_tvb, 0, length)); 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(parameter_tvb->real_data , length , cd , NULL , NULL , &l_conv_error); - if(!l_conv_error) - proto_tree_add_text(tree , parameter_tvb , 0 , length, "USSD String: %%s", utf8_text); - else - proto_tree_add_text(tree , parameter_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 , parameter_tvb , 0 , length, "USSD String: g_iconv_open FAILED contact wireshark"); + case SMS_ENCODING_UCS2: + case SMS_ENCODING_UCS2_LANG: + gsmmap_add_ucs2_ussd_string(tvb, tree, length); break; - default: + default: break; } |