/src/wireshark/epan/dissectors/packet-bicc_mst.c
Line | Count | Source |
1 | | /* packet-bicc_mst.c |
2 | | * (Incomplete) Dissector for the 3GPP TS 29.205 BICC MST (Mobile Service Transport) |
3 | | * |
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) |
7 | | * |
8 | | * Copyright 2019 by Harald Welte <laforge@gnumonks.org> |
9 | | * |
10 | | * Wireshark - Network traffic analyzer |
11 | | * By Gerald Combs <gerald@wireshark.org> |
12 | | * Copyright 1998 Gerald Combs |
13 | | * |
14 | | * SPDX-License-Identifier: GPL-2.0-or-later |
15 | | */ |
16 | | |
17 | | #include "config.h" |
18 | | |
19 | | #include <epan/packet.h> |
20 | | #include <epan/tap.h> |
21 | | #include <epan/expert.h> |
22 | | |
23 | | #include "packet-bicc_mst.h" |
24 | | |
25 | | void proto_register_bicc_mst(void); |
26 | | |
27 | | static int proto_bicc_mst; |
28 | | |
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; |
35 | | |
36 | | static int ett_lcls_gcr; |
37 | | |
38 | | unsigned |
39 | | dissect_bicc_mst_lcls_gcr(tvbuff_t *tvb, proto_tree *tree, uint32_t offset, unsigned len) |
40 | 0 | { |
41 | 0 | unsigned net_id_len, node_id_len, call_ref_id_len; |
42 | 0 | uint32_t curr_offset = offset; |
43 | 0 | proto_tree *subtree; |
44 | 0 | proto_item *ti; |
45 | |
|
46 | 0 | ti = proto_tree_add_protocol_format(tree, proto_bicc_mst, tvb, offset, len, "BICC MST GCR"); |
47 | 0 | subtree = proto_item_add_subtree(ti, ett_lcls_gcr); |
48 | |
|
49 | 0 | proto_tree_add_item_ret_uint(subtree, hf_lcls_gcr_network_id_len, tvb, curr_offset++, 1, ENC_NA, &net_id_len); |
50 | 0 | proto_tree_add_item(subtree, hf_lcls_gcr_network_id, tvb, curr_offset, net_id_len, ENC_NA); |
51 | 0 | curr_offset += net_id_len; |
52 | |
|
53 | 0 | proto_tree_add_item_ret_uint(subtree, hf_lcls_gcr_node_id_len, tvb, curr_offset++, 1, ENC_NA, &node_id_len); |
54 | 0 | proto_tree_add_item(subtree, hf_lcls_gcr_node_id, tvb, curr_offset, node_id_len, ENC_NA); |
55 | 0 | curr_offset += node_id_len; |
56 | |
|
57 | 0 | 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 | 0 | proto_tree_add_item(subtree, hf_lcls_gcr_call_ref_id, tvb, curr_offset, call_ref_id_len, ENC_NA); |
59 | 0 | curr_offset += call_ref_id_len; |
60 | |
|
61 | 0 | return curr_offset - offset; |
62 | 0 | } |
63 | | |
64 | | void |
65 | | proto_register_bicc_mst(void) |
66 | 14 | { |
67 | 14 | static hf_register_info hf[] = { |
68 | 14 | { &hf_lcls_gcr_network_id_len, { "Length of LCLS GCR Network ID", |
69 | 14 | "bicc_mst.lcls_gcr.network_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, |
70 | 14 | { &hf_lcls_gcr_network_id, { "LCLS GCR Network ID", |
71 | 14 | "bicc_mst.lcls_gcr.network_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, |
72 | 14 | { &hf_lcls_gcr_node_id_len, { "Length of LCLS GCR Node ID", |
73 | 14 | "bicc_mst.lcls_gcr.node_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, |
74 | 14 | { &hf_lcls_gcr_node_id, { "LCLS GCR Network ID", |
75 | 14 | "bicc_mst.lcls_gcr.network_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, |
76 | 14 | { &hf_lcls_gcr_call_ref_id_len, { "Length of LCLS GCR Call Ref ID", |
77 | 14 | "bicc_mst.lcls_gcr.call_ref_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, |
78 | 14 | { &hf_lcls_gcr_call_ref_id, { "LCLS GCR Call Ref ID", |
79 | 14 | "bicc_mst.lcls_gcr.call_ref_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, |
80 | 14 | }; |
81 | | |
82 | 14 | static int *ett[] = { |
83 | 14 | &ett_lcls_gcr, |
84 | 14 | }; |
85 | | |
86 | 14 | proto_bicc_mst = proto_register_protocol("3GPP BICC MST", "BICC-MST", "bicc_mst"); |
87 | 14 | proto_register_field_array(proto_bicc_mst, hf, array_length(hf)); |
88 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
89 | 14 | } |
90 | | |
91 | | /* |
92 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
93 | | * |
94 | | * Local variables: |
95 | | * c-basic-offset: 8 |
96 | | * tab-width: 8 |
97 | | * indent-tabs-mode: t |
98 | | * End: |
99 | | * |
100 | | * vi: set shiftwidth=8 tabstop=8 noexpandtab: |
101 | | * :indentSize=8:tabSize=8:noTabs=false: |
102 | | */ |