2 * Routines for dissecting Universal Mobile Telecommunications System (UMTS);
3 * UTRAN Iur interface Radio Network Subsystem
4 * Application Part (RNSAP) signalling
5 * (3GPP TS 25.423 version 6.7.0 Release 6) packet dissection
6 * Copyright 2005 - 2006, Anders Broman <anders.broman@ericsson.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * Ref: 3GPP TS 25.423 version 6.7.0 Release 6
31 #include <epan/packet.h>
32 #include <epan/asn1.h>
34 #include "packet-per.h"
35 #include "packet-ber.h"
38 /* disable: "warning C4146: unary minus operator applied to unsigned type, result still unsigned" */
39 #pragma warning(disable:4146)
42 #define PNAME "UTRAN Iur interface Radio Network Subsystem Application Part"
43 #define PSNAME "RNSAP"
44 #define PFNAME "rnsap"
46 #define SCCP_SSN_RNSAP 143
48 #include "packet-rnsap-val.h"
50 void proto_register_rnsap(void);
51 void proto_reg_handoff_rnsap(void);
53 static dissector_handle_t rrc_dl_dcch_handle = NULL;
55 /* Initialize the protocol and registered fields */
56 static int proto_rnsap = -1;
58 #include "packet-rnsap-hf.c"
60 /* Initialize the subtree pointers */
61 static int ett_rnsap = -1;
63 #include "packet-rnsap-ett.c"
65 /* Global variables */
66 static guint32 ProcedureCode;
67 static guint32 ProtocolIE_ID;
68 static guint32 ddMode;
69 static const gchar *ProcedureID;
70 static const char *obj_id = NULL;
73 /* Dissector tables */
74 static dissector_table_t rnsap_ies_dissector_table;
75 static dissector_table_t rnsap_extension_dissector_table;
76 static dissector_table_t rnsap_proc_imsg_dissector_table;
77 static dissector_table_t rnsap_proc_sout_dissector_table;
78 static dissector_table_t rnsap_proc_uout_dissector_table;
80 static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
81 static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
82 static int dissect_PrivateIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
83 static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
84 static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
85 static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
87 #include "packet-rnsap-fn.c"
89 static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
91 return (dissector_try_uint(rnsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
94 static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
96 return (dissector_try_uint(rnsap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
99 static int dissect_PrivateIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
101 return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
104 static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
106 if (!ProcedureID) return 0;
107 return (dissector_try_string(rnsap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
110 static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
112 if (!ProcedureID) return 0;
113 return (dissector_try_string(rnsap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
116 static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
118 if (!ProcedureID) return 0;
119 return (dissector_try_string(rnsap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
123 dissect_rnsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
125 proto_item *rnsap_item = NULL;
126 proto_tree *rnsap_tree = NULL;
128 /* make entry in the Protocol column on summary display */
129 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RNSAP");
131 /* create the rnsap protocol tree */
132 rnsap_item = proto_tree_add_item(tree, proto_rnsap, tvb, 0, -1, ENC_NA);
133 rnsap_tree = proto_item_add_subtree(rnsap_item, ett_rnsap);
135 return dissect_RNSAP_PDU_PDU(tvb, pinfo, rnsap_tree, data);
138 /*--- proto_register_rnsap -------------------------------------------*/
139 void proto_register_rnsap(void) {
143 static hf_register_info hf[] = {
144 #include "packet-rnsap-hfarr.c"
147 /* List of subtrees */
148 static gint *ett[] = {
150 #include "packet-rnsap-ettarr.c"
154 /* Register protocol */
155 proto_rnsap = proto_register_protocol(PNAME, PSNAME, PFNAME);
156 /* Register fields and subtrees */
157 proto_register_field_array(proto_rnsap, hf, array_length(hf));
158 proto_register_subtree_array(ett, array_length(ett));
160 /* Register dissector */
161 register_dissector("rnsap", dissect_rnsap, proto_rnsap);
163 /* Register dissector tables */
164 rnsap_ies_dissector_table = register_dissector_table("rnsap.ies", "RNSAP-PROTOCOL-IES", FT_UINT32, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE);
165 rnsap_extension_dissector_table = register_dissector_table("rnsap.extension", "RNSAP-PROTOCOL-EXTENSION", FT_UINT32, BASE_DEC, DISSECTOR_TABLE_ALLOW_DUPLICATE);
166 rnsap_proc_imsg_dissector_table = register_dissector_table("rnsap.proc.imsg", "RNSAP-ELEMENTARY-PROCEDURE InitiatingMessage", FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE);
167 rnsap_proc_sout_dissector_table = register_dissector_table("rnsap.proc.sout", "RNSAP-ELEMENTARY-PROCEDURE SuccessfulOutcome", FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE);
168 rnsap_proc_uout_dissector_table = register_dissector_table("rnsap.proc.uout", "RNSAP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE);
173 /*--- proto_reg_handoff_rnsap ---------------------------------------*/
175 proto_reg_handoff_rnsap(void)
177 dissector_handle_t rnsap_handle;
179 rnsap_handle = find_dissector("rnsap");
180 rrc_dl_dcch_handle = find_dissector("rrc.dl.dcch");
182 dissector_add_uint("sccp.ssn", SCCP_SSN_RNSAP, rnsap_handle);
183 /* Add heuristic dissector */
184 /*heur_dissector_add("sccp", dissect_sccp_rnsap_heur, "RNSAP over SCCP", "ranap_sccp", proto_rnsap, HEURISTIC_DISABLE); */
186 #include "packet-rnsap-dis-tab.c"