# include "config.h"
#endif
-/* #include <stdlib.h> */
-#include <gmodule.h>
-
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
# include <netinet/in.h>
#endif
-#include <string.h>
-
#include <epan/packet.h>
#include <epan/emem.h>
#include <epan/strutil.h>
const gchar *str = NULL;
/*add more translation UCS , IA5 , latin , latin \ hebrew ,gsm 7BIT*/
- proto_item *ucs2_item;
gchar *utf8_text = NULL;
GIConv cd;
GError *l_conv_error = NULL;
if ((cd = g_iconv_open("UTF-8","iso-8859-8")) != (GIConv)-1)
{
- utf8_text = g_convert_with_iconv(tvb->real_data + offset, num_fields , cd , NULL , NULL , &l_conv_error);
+ utf8_text = g_convert_with_iconv(tvb_get_ptr(tvb, offset, num_fields), num_fields , cd , NULL , NULL , &l_conv_error);
if(!l_conv_error)
{
- ucs2_item = proto_tree_add_text(tree, tvb, offset, num_fields, "Encoded user data: %s", utf8_text);
+ proto_tree_add_text(tree, tvb, offset, num_fields, "Encoded user data: %s", utf8_text);
}
else
{
- ucs2_item = proto_tree_add_text(tree, tvb, offset, num_fields, "%s", "Failed on iso-8859-8 contact Wireshark developers");
+ proto_tree_add_text(tree, tvb, offset, num_fields, "%s", "Failed on iso-8859-8 contact Wireshark developers");
}
if(utf8_text)
g_free(utf8_text);
utf8_text = g_convert_with_iconv(ansi_637_bigbuf , num_fields , cd , NULL , NULL , &l_conv_error);
if(!l_conv_error)
{
- ucs2_item = proto_tree_add_text(tree, tvb, offset, num_fields, "Encoded user data: %s", utf8_text);
+ proto_tree_add_text(tree, tvb, offset, num_fields, "Encoded user data: %s", utf8_text);
}
else
{
- ucs2_item = proto_tree_add_text(tree, tvb, offset, num_fields, "%s", "Failed on iso-8859-1 contact Wireshark developers");
+ proto_tree_add_text(tree, tvb, offset, num_fields, "%s", "Failed on iso-8859-1 contact Wireshark developers");
}
if(utf8_text)
g_free(utf8_text);
value = tvb_get_ntohs(tvb, offset);
- str = match_strval(value, ansi_srvc_cat_strings);
-
- if (NULL == str) str = "Reserved";
+ str = val_to_str_const(value, ansi_srvc_cat_strings, "Reserved");
proto_tree_add_text(tree, tvb, offset, 2,
"%s", str);
}
static void
-trans_param_bearer_reply_opt(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len)
+trans_param_bearer_reply_opt(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 offset, gchar *add_string, int string_len)
{
guint8 oct;
- len = len;
oct = tvb_get_guint8(tvb, offset);
other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xfc, 8);
*/
tele_tvb = tvb_new_subset(tvb, offset, len, len);
- dissector_try_port(tele_dissector_table, ansi_637_trans_tele_id,
+ dissector_try_uint(tele_dissector_table, ansi_637_trans_tele_id,
tele_tvb, g_pinfo, g_tree);
}
*/
if (tree)
{
- value = pinfo->match_port;
+ value = pinfo->match_uint;
/*
* create the ansi_637 protocol tree
{
/*
* supposed to be "Reserved for carrier specific teleservices"
- * but we are using it to key SMS Broadcast dissection were
+ * but we are using it to key SMS Broadcast dissection where
* there is no teleservice ID
*/
str = "(Reserved) Being used for Broadcast";
"%s - %s (%d)",
ansi_proto_name_tele,
str,
- pinfo->match_port);
+ pinfo->match_uint);
ansi_637_tree =
proto_item_add_subtree(ansi_637_item, ett_ansi_637_tele);
static void
dissect_ansi_637_trans_app(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- col_set_str(pinfo->cinfo, COL_PROTOCOL,"/");
- col_set_fence(pinfo->cinfo, COL_INFO);
- dissect_ansi_637_trans(tvb, pinfo, tree);
+ col_set_str(pinfo->cinfo, COL_PROTOCOL,"/");
+ col_set_fence(pinfo->cinfo, COL_INFO);
+ dissect_ansi_637_trans(tvb, pinfo, tree);
}
/* Register the protocol with Wireshark */
void
proto_ansi_637_trans =
proto_register_protocol(ansi_proto_name_trans, "ANSI IS-637-A Transport", "ansi_637_trans");
- register_dissector("ansi_637_tele", dissect_ansi_637_tele, proto_ansi_637_tele);
- register_dissector("ansi_637_trans", dissect_ansi_637_trans, proto_ansi_637_trans);
+ register_dissector("ansi_637_tele", dissect_ansi_637_tele, proto_ansi_637_tele);
+ register_dissector("ansi_637_trans", dissect_ansi_637_trans, proto_ansi_637_trans);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_ansi_637_tele, hf_tele, array_length(hf_tele));
ansi_637_trans_app_handle = create_dissector_handle(dissect_ansi_637_trans_app, proto_ansi_637_trans);
/* Dissect messages embedded in SIP */
- dissector_add_string("media_type","application/vnd.3gpp2.sms", ansi_637_trans_handle);
+ dissector_add_string("media_type","application/vnd.3gpp2.sms", ansi_637_trans_app_handle);
/*
* register for all known teleservices
* '-1' is to stop before trailing '0' entry
/*
* ANSI MAP dissector will push out teleservice ids
*/
- dissector_add("ansi_map.tele_id", ansi_tele_id_strings[i].value, ansi_637_tele_handle);
+ dissector_add_uint("ansi_map.tele_id", ansi_tele_id_strings[i].value, ansi_637_tele_handle);
/*
* we will push out teleservice ids after Transport layer decode
*/
- dissector_add("ansi_637.tele_id", ansi_tele_id_strings[i].value, ansi_637_tele_handle);
+ dissector_add_uint("ansi_637.tele_id", ansi_tele_id_strings[i].value, ansi_637_tele_handle);
}
/*
* ANSI A-interface will push out transport layer data
*/
- dissector_add("ansi_a.sms", 0, ansi_637_trans_handle);
+ dissector_add_uint("ansi_a.sms", 0, ansi_637_trans_handle);
/* data_handle = find_dissector("data"); */
}