Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-bicc_mst.c
blob1e7a870250fc1088082dae7b9a58b1da660c65db
1 /* packet-bicc_mst.c
2 * (Incomplete) Dissector for the 3GPP TS 29.205 BICC MST (Mobile Service Transport)
4 * This currently only dissects a single MST IE, which is required by the BSSMAP
5 * dissector in order to decode the LCLS (Local Call Local Switch)
6 * GCR (Global Call Reference)
8 * Copyright 2019 by Harald Welte <laforge@gnumonks.org>
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * SPDX-License-Identifier: GPL-2.0-or-later
17 #include "config.h"
19 #include <epan/packet.h>
20 #include <epan/tap.h>
21 #include <epan/expert.h>
23 #include "packet-bicc_mst.h"
25 void proto_register_bicc_mst(void);
27 static int proto_bicc_mst;
29 static int hf_lcls_gcr_network_id_len;
30 static int hf_lcls_gcr_network_id;
31 static int hf_lcls_gcr_node_id_len;
32 static int hf_lcls_gcr_node_id;
33 static int hf_lcls_gcr_call_ref_id_len;
34 static int hf_lcls_gcr_call_ref_id;
36 static int ett_lcls_gcr;
38 unsigned
39 dissect_bicc_mst_lcls_gcr(tvbuff_t *tvb, proto_tree *tree, uint32_t offset, unsigned len)
41 unsigned net_id_len, node_id_len, call_ref_id_len;
42 uint32_t curr_offset = offset;
43 proto_tree *subtree;
44 proto_item *ti;
46 ti = proto_tree_add_protocol_format(tree, proto_bicc_mst, tvb, offset, len, "BICC MST GCR");
47 subtree = proto_item_add_subtree(ti, ett_lcls_gcr);
49 proto_tree_add_item_ret_uint(subtree, hf_lcls_gcr_network_id_len, tvb, curr_offset++, 1, ENC_NA, &net_id_len);
50 proto_tree_add_item(subtree, hf_lcls_gcr_network_id, tvb, curr_offset, net_id_len, ENC_NA);
51 curr_offset += net_id_len;
53 proto_tree_add_item_ret_uint(subtree, hf_lcls_gcr_node_id_len, tvb, curr_offset++, 1, ENC_NA, &node_id_len);
54 proto_tree_add_item(subtree, hf_lcls_gcr_node_id, tvb, curr_offset, node_id_len, ENC_NA);
55 curr_offset += node_id_len;
57 proto_tree_add_item_ret_uint(subtree, hf_lcls_gcr_call_ref_id_len, tvb, curr_offset++, 1, ENC_NA, &call_ref_id_len);
58 proto_tree_add_item(subtree, hf_lcls_gcr_call_ref_id, tvb, curr_offset, call_ref_id_len, ENC_NA);
59 curr_offset += call_ref_id_len;
61 return curr_offset - offset;
64 void
65 proto_register_bicc_mst(void)
67 static hf_register_info hf[] = {
68 { &hf_lcls_gcr_network_id_len, { "Length of LCLS GCR Network ID",
69 "bicc_mst.lcls_gcr.network_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
70 { &hf_lcls_gcr_network_id, { "LCLS GCR Network ID",
71 "bicc_mst.lcls_gcr.network_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
72 { &hf_lcls_gcr_node_id_len, { "Length of LCLS GCR Node ID",
73 "bicc_mst.lcls_gcr.node_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
74 { &hf_lcls_gcr_node_id, { "LCLS GCR Network ID",
75 "bicc_mst.lcls_gcr.network_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
76 { &hf_lcls_gcr_call_ref_id_len, { "Length of LCLS GCR Call Ref ID",
77 "bicc_mst.lcls_gcr.call_ref_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
78 { &hf_lcls_gcr_call_ref_id, { "LCLS GCR Call Ref ID",
79 "bicc_mst.lcls_gcr.call_ref_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
82 static int *ett[] = {
83 &ett_lcls_gcr,
86 proto_bicc_mst = proto_register_protocol("3GPP BICC MST", "BICC-MST", "bicc_mst");
87 proto_register_field_array(proto_bicc_mst, hf, array_length(hf));
88 proto_register_subtree_array(ett, array_length(ett));
92 * Editor modelines - https://www.wireshark.org/tools/modelines.html
94 * Local variables:
95 * c-basic-offset: 8
96 * tab-width: 8
97 * indent-tabs-mode: t
98 * End:
100 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
101 * :indentSize=8:tabSize=8:noTabs=false: