aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bicc_mst.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-08 19:34:54 +0200
committerAnders Broman <a.broman58@gmail.com>2019-05-10 10:44:19 +0000
commit9ddb50f33f86da361e3d56d92ade08f5cc8a44dd (patch)
tree0461238f824f31177ae440c9364d076c288954bd /epan/dissectors/packet-bicc_mst.c
parent32fa74c08ffdbd26b1e5f8ee9dad60af8b3f1c12 (diff)
BSSMAP: Further decode the GCR (Global Call Reference) field
The BSSMAP LCLS GCR field is specified in 3GPP TS 29.205, which in turn was originally created to augment the ITU-T Q.190x BICC with Mobile specific information elements. Let's add the latter decoding function as a new packet-bicc_mst.c, so it can be used also from other dissectors. For example, GSM MAP also includes GCRs and hence should be modified to use this new decoder. Change-Id: I247d2ccd2d16e996f4fe5d5952ba8a4091a4ffd0 Reviewed-on: https://code.wireshark.org/review/33117 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-bicc_mst.c')
-rw-r--r--epan/dissectors/packet-bicc_mst.c102
1 files changed, 102 insertions, 0 deletions
diff --git a/epan/dissectors/packet-bicc_mst.c b/epan/dissectors/packet-bicc_mst.c
new file mode 100644
index 0000000000..5a096509df
--- /dev/null
+++ b/epan/dissectors/packet-bicc_mst.c
@@ -0,0 +1,102 @@
+/* packet-bicc_mst.c
+ * (Incomplete) Dissector for the 3GPP TS 29.205 BICC MST (Mobile Service Transport)
+ *
+ * This currently only dissects a single MST IE, which is required by the BSSMAP
+ * dissector in order to decode the LCLS (Local Call Local Switch)
+ * GCR (Global Call Reference)
+ *
+ * Copyright 2019 by Harald Welte <laforge@gnumonks.org>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "config.h"
+
+#include <epan/packet.h>
+#include <epan/tap.h>
+#include <epan/expert.h>
+
+#include "packet-bicc_mst.h"
+
+void proto_register_bicc_mst(void);
+
+static int proto_bicc_mst = -1;
+
+static int hf_lcls_gcr_network_id_len = -1;
+static int hf_lcls_gcr_network_id = -1;
+static int hf_lcls_gcr_node_id_len = -1;
+static int hf_lcls_gcr_node_id = -1;
+static int hf_lcls_gcr_call_ref_id_len = -1;
+static int hf_lcls_gcr_call_ref_id = -1;
+
+static int ett_lcls_gcr = -1;
+
+guint
+dissect_bicc_mst_lcls_gcr(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
+{
+ guint net_id_len, node_id_len, call_ref_id_len;
+ guint32 curr_offset = offset;
+ proto_tree *subtree;
+ proto_item *ti;
+
+ ti = proto_tree_add_protocol_format(tree, proto_bicc_mst, tvb, offset, len, "BICC MST GCR");
+ subtree = proto_item_add_subtree(ti, ett_lcls_gcr);
+
+ proto_tree_add_item_ret_uint(subtree, hf_lcls_gcr_network_id_len, tvb, curr_offset++, 1, ENC_NA, &net_id_len);
+ proto_tree_add_item(subtree, hf_lcls_gcr_network_id, tvb, curr_offset, net_id_len, ENC_NA);
+ curr_offset += net_id_len;
+
+ proto_tree_add_item_ret_uint(subtree, hf_lcls_gcr_node_id_len, tvb, curr_offset++, 1, ENC_NA, &node_id_len);
+ proto_tree_add_item(subtree, hf_lcls_gcr_node_id, tvb, curr_offset, node_id_len, ENC_NA);
+ curr_offset += node_id_len;
+
+ proto_tree_add_item_ret_uint(subtree, hf_lcls_gcr_call_ref_id_len, tvb, curr_offset++, 1, ENC_NA, &call_ref_id_len);
+ proto_tree_add_item(subtree, hf_lcls_gcr_call_ref_id, tvb, curr_offset, call_ref_id_len, ENC_NA);
+ curr_offset += call_ref_id_len;
+
+ return curr_offset - offset;
+}
+
+void
+proto_register_bicc_mst(void)
+{
+ static hf_register_info hf[] = {
+ { &hf_lcls_gcr_network_id_len, { "Length of LCLS GCR Network ID",
+ "bicc_mst.lcls_gcr.network_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_lcls_gcr_network_id, { "LCLS GCR Network ID",
+ "bicc_mst.lcls_gcr.network_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_lcls_gcr_node_id_len, { "Length of LCLS GCR Node ID",
+ "bicc_mst.lcls_gcr.node_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_lcls_gcr_node_id, { "LCLS GCR Network ID",
+ "bicc_mst.lcls_gcr.network_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_lcls_gcr_call_ref_id_len, { "Length of LCLS GCR Call Ref ID",
+ "bicc_mst.lcls_gcr.call_ref_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_lcls_gcr_call_ref_id, { "LCLS GCR Call Ref ID",
+ "bicc_mst.lcls_gcr.call_ref_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ };
+
+ static gint *ett[] = {
+ &ett_lcls_gcr,
+ };
+
+ proto_bicc_mst = proto_register_protocol("3GPP BICC MST", "BICC-MST", "bicc_mst");
+ proto_register_field_array(proto_bicc_mst, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
+}
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 8
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * End:
+ *
+ * vi: set shiftwidth=8 tabstop=8 noexpandtab:
+ * :indentSize=8:tabSize=8:noTabs=false:
+ */