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>
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 * Ref: 3GPP TS 25.423 version 6.7.0 Release 6
34 #include <epan/packet.h>
36 #include <epan/asn1.h>
38 #include "packet-per.h"
39 #include "packet-ber.h"
42 /* disable: "warning C4146: unary minus operator applied to unsigned type, result still unsigned" */
43 #pragma warning(disable:4146)
46 #define PNAME "UTRAN Iur interface Radio Network Subsystem Application Part"
47 #define PSNAME "RNSAP"
48 #define PFNAME "rnsap"
50 #define SCCP_SSN_RNSAP 143
52 #include "packet-rnsap-val.h"
54 static dissector_handle_t rrc_dl_dcch_handle = NULL;
56 /* Initialize the protocol and registered fields */
57 static int proto_rnsap = -1;
59 #include "packet-rnsap-hf.c"
61 /* Initialize the subtree pointers */
62 static int ett_rnsap = -1;
64 #include "packet-rnsap-ett.c"
66 /* Global variables */
67 static guint32 ProcedureCode;
68 static guint32 ProtocolIE_ID;
69 static guint32 ddMode;
70 static const gchar *ProcedureID;
71 static const char *obj_id = NULL;
74 /* Dissector tables */
75 static dissector_table_t rnsap_ies_dissector_table;
76 static dissector_table_t rnsap_extension_dissector_table;
77 static dissector_table_t rnsap_proc_imsg_dissector_table;
78 static dissector_table_t rnsap_proc_sout_dissector_table;
79 static dissector_table_t rnsap_proc_uout_dissector_table;
81 static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
82 static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
83 static int dissect_PrivateIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
84 static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
85 static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
86 static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
88 #include "packet-rnsap-fn.c"
90 static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
92 return (dissector_try_uint(rnsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
95 static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
97 return (dissector_try_uint(rnsap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
100 static int dissect_PrivateIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
102 return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree)) ? tvb_length(tvb) : 0;
105 static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
107 if (!ProcedureID) return 0;
108 return (dissector_try_string(rnsap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
111 static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
113 if (!ProcedureID) return 0;
114 return (dissector_try_string(rnsap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
117 static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
119 if (!ProcedureID) return 0;
120 return (dissector_try_string(rnsap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
124 dissect_rnsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
126 proto_item *rnsap_item = NULL;
127 proto_tree *rnsap_tree = NULL;
129 /* make entry in the Protocol column on summary display */
130 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RNSAP");
132 /* create the rnsap protocol tree */
133 rnsap_item = proto_tree_add_item(tree, proto_rnsap, tvb, 0, -1, ENC_NA);
134 rnsap_tree = proto_item_add_subtree(rnsap_item, ett_rnsap);
136 dissect_RNSAP_PDU_PDU(tvb, pinfo, rnsap_tree);
139 /*--- proto_register_rnsap -------------------------------------------*/
140 void proto_register_rnsap(void) {
144 static hf_register_info hf[] = {
145 #include "packet-rnsap-hfarr.c"
148 /* List of subtrees */
149 static gint *ett[] = {
151 #include "packet-rnsap-ettarr.c"
155 /* Register protocol */
156 proto_rnsap = proto_register_protocol(PNAME, PSNAME, PFNAME);
157 /* Register fields and subtrees */
158 proto_register_field_array(proto_rnsap, hf, array_length(hf));
159 proto_register_subtree_array(ett, array_length(ett));
161 /* Register dissector */
162 register_dissector("rnsap", dissect_rnsap, proto_rnsap);
164 /* Register dissector tables */
165 rnsap_ies_dissector_table = register_dissector_table("rnsap.ies", "RNSAP-PROTOCOL-IES", FT_UINT32, BASE_DEC);
166 rnsap_extension_dissector_table = register_dissector_table("rnsap.extension", "RNSAP-PROTOCOL-EXTENSION", FT_UINT32, BASE_DEC);
167 rnsap_proc_imsg_dissector_table = register_dissector_table("rnsap.proc.imsg", "RNSAP-ELEMENTARY-PROCEDURE InitiatingMessage", FT_STRING, BASE_NONE);
168 rnsap_proc_sout_dissector_table = register_dissector_table("rnsap.proc.sout", "RNSAP-ELEMENTARY-PROCEDURE SuccessfulOutcome", FT_STRING, BASE_NONE);
169 rnsap_proc_uout_dissector_table = register_dissector_table("rnsap.proc.uout", "RNSAP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", FT_STRING, BASE_NONE);
174 /*--- proto_reg_handoff_rnsap ---------------------------------------*/
176 proto_reg_handoff_rnsap(void)
178 dissector_handle_t rnsap_handle;
180 rnsap_handle = find_dissector("rnsap");
181 rrc_dl_dcch_handle = find_dissector("rrc.dl.dcch");
183 dissector_add_uint("sccp.ssn", SCCP_SSN_RNSAP, rnsap_handle);
184 /* Add heuristic dissector
185 * Perhaps we want a preference whether the heuristic dissector
186 * is or isn't enabled
188 /*heur_dissector_add("sccp", dissect_sccp_rnsap_heur, proto_rnsap); */
190 #include "packet-rnsap-dis-tab.c"