#include <glib.h>
#include <epan/packet.h>
-#include <epan/prefs.h>
#include <packet-mtp3.h>
{ JAPAN_TEST_SRA, "SRA" },
{ 0, NULL } };
-#define COO_LENGTH 2
+#define ANSI_COO_LENGTH 2
#define ANSI_COO_SLC_MASK 0x000f
#define ANSI_COO_FSN_MASK 0x07f0
+#define ITU_COO_LENGTH 1
#define ITU_COO_FSN_MASK 0x007f
#define ANSI_XCO_LENGTH 4
#define ANSI_XCO_SLC_MASK 0x0000000f
{
guint8 message_length;
- message_length = tvb_length_remaining(tvb, 0);
+ message_length = tvb_length(tvb);
proto_tree_add_text(tree, tvb, 0, message_length,
"Unknown message (%u byte%s)", message_length,
plurality(message_length, "", "s"));
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, chm_h1_message_type_acro_values, "Unknown"));
-
+
switch (h1)
{
case CHM_H1_COO:
if (mtp3_standard == ANSI_STANDARD)
{
proto_tree_add_item(tree, hf_mtp3mg_coo_ansi_slc, tvb, 0,
- COO_LENGTH, TRUE);
+ ANSI_COO_LENGTH, TRUE);
proto_tree_add_item(tree, hf_mtp3mg_coo_ansi_fsn, tvb, 0,
- COO_LENGTH, TRUE);
+ ANSI_COO_LENGTH, TRUE);
} else /* ITU_STANDARD, CHINESE_ITU_STANDARD, and JAPAN_STANDARD */ {
proto_tree_add_item(tree, hf_mtp3mg_coo_itu_fsn, tvb, 0,
- COO_LENGTH, TRUE);
+ ITU_COO_LENGTH, TRUE);
}
break;
case JAPAN_STANDARD:
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (Japan)");
break;
- };
+ };
if (tree) {
/* create display subtree for the protocol */
default:
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown ");
+ col_set_str(pinfo->cinfo, COL_INFO, "Unknown ");
dissect_mtp3mg_unknown_message(tvb, mtp3mg_tree);
} /* switch */
default:
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown ");
+ col_set_str(pinfo->cinfo, COL_INFO, "Unknown ");
dissect_mtp3mg_unknown_message(tvb, mtp3mg_tree);
} /* switch */
{
dissector_handle_t mtp3mg_handle;
- mtp3mg_handle = create_dissector_handle(dissect_mtp3mg, proto_mtp3mg);
+ mtp3mg_handle = find_dissector("mtp3mg");
dissector_add("mtp3.service_indicator", MTP3MG_SI, mtp3mg_handle);