aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/gsmmap/packet-gsmmap-template.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2008-01-30 17:11:06 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2008-01-30 17:11:06 +0000
commit8ba9f2d3a41e2d500fcc252bc7748ee828d453b8 (patch)
tree5218c2954dae7bd0cfa859053a1466be8a363f4f /asn1/gsmmap/packet-gsmmap-template.c
parent869213d9ef897940716aa61844fe01d290f0ed37 (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/packet-gsmmap-template.c')
-rw-r--r--asn1/gsmmap/packet-gsmmap-template.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/asn1/gsmmap/packet-gsmmap-template.c b/asn1/gsmmap/packet-gsmmap-template.c
index 4810194b98..59ca82370f 100644
--- a/asn1/gsmmap/packet-gsmmap-template.c
+++ b/asn1/gsmmap/packet-gsmmap-template.c
@@ -236,6 +236,34 @@ 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)
+{
+#if GLIB_MAJOR_VERSION > 2
+ 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");
+#else
+ proto_tree_add_text(tree, tvb, 0, length, "UCS2 conversion not supported with Glib < 2");
+#endif
+}
+
char * unpack_digits(tvbuff_t *tvb, int offset){
int length;
@@ -2169,6 +2197,7 @@ static const value_string chargingcharacteristics_values[] = {
{0x8, "N (Normal billing)" },
{ 0, NULL }
};
+
/*--- proto_reg_handoff_gsm_map ---------------------------------------*/
static void range_delete_callback(guint32 ssn)
{