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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 * Ref: 3GPP TS 25.423 version 6.7.0 Release 6
36 #include <epan/packet.h>
40 #include <epan/asn1.h>
42 #include "packet-per.h"
45 /* disable: "warning C4146: unary minus operator applied to unsigned type, result still unsigned" */
46 #pragma warning(disable:4146)
49 #define PNAME "UTRAN Iur interface Radio Network Subsystem Application Part"
50 #define PSNAME "RNSAP"
51 #define PFNAME "rnsap"
53 #define SCCP_SSN_RNSAP 143
55 #include "packet-rnsap-val.h"
57 static dissector_handle_t rrc_dl_dcch_handle = NULL;
59 /* Initialize the protocol and registered fields */
60 static int proto_rnsap = -1;
62 #include "packet-rnsap-hf.c"
64 /* Initialize the subtree pointers */
65 static int ett_rnsap = -1;
67 #include "packet-rnsap-ett.c"
69 /* Global variables */
70 static guint32 ProcedureCode;
71 static guint32 ProtocolIE_ID;
72 static guint32 ddMode;
73 static const gchar *ProcedureID;
75 /* Dissector tables */
76 static dissector_table_t rnsap_ies_dissector_table;
77 static dissector_table_t rnsap_extension_dissector_table;
78 static dissector_table_t rnsap_proc_imsg_dissector_table;
79 static dissector_table_t rnsap_proc_sout_dissector_table;
80 static dissector_table_t rnsap_proc_uout_dissector_table;
82 static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
83 static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
84 static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
85 static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
86 static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
88 #include "packet-rnsap-fn.c"
90 static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
92 return (dissector_try_port(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)
97 return (dissector_try_port(rnsap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
100 static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
102 if (!ProcedureID) return 0;
103 return (dissector_try_string(rnsap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
106 static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
108 if (!ProcedureID) return 0;
109 return (dissector_try_string(rnsap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
112 static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
114 if (!ProcedureID) return 0;
115 return (dissector_try_string(rnsap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
119 dissect_rnsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
121 proto_item *rnsap_item = NULL;
122 proto_tree *rnsap_tree = NULL;
124 /* make entry in the Protocol column on summary display */
125 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RNSAP");
127 /* create the rnsap protocol tree */
128 rnsap_item = proto_tree_add_item(tree, proto_rnsap, tvb, 0, -1, FALSE);
129 rnsap_tree = proto_item_add_subtree(rnsap_item, ett_rnsap);
131 dissect_RNSAP_PDU_PDU(tvb, pinfo, rnsap_tree);
134 /*--- proto_register_rnsap -------------------------------------------*/
135 void proto_register_rnsap(void) {
139 static hf_register_info hf[] = {
140 #include "packet-rnsap-hfarr.c"
143 /* List of subtrees */
144 static gint *ett[] = {
146 #include "packet-rnsap-ettarr.c"
150 /* Register protocol */
151 proto_rnsap = proto_register_protocol(PNAME, PSNAME, PFNAME);
152 /* Register fields and subtrees */
153 proto_register_field_array(proto_rnsap, hf, array_length(hf));
154 proto_register_subtree_array(ett, array_length(ett));
156 /* Register dissector */
157 register_dissector("rnsap", dissect_rnsap, proto_rnsap);
159 /* Register dissector tables */
160 rnsap_ies_dissector_table = register_dissector_table("rnsap.ies", "RNSAP-PROTOCOL-IES", FT_UINT32, BASE_DEC);
161 rnsap_extension_dissector_table = register_dissector_table("rnsap.extension", "RNSAP-PROTOCOL-EXTENSION", FT_UINT32, BASE_DEC);
162 rnsap_proc_imsg_dissector_table = register_dissector_table("rnsap.proc.imsg", "RNSAP-ELEMENTARY-PROCEDURE InitiatingMessage", FT_STRING, BASE_NONE);
163 rnsap_proc_sout_dissector_table = register_dissector_table("rnsap.proc.sout", "RNSAP-ELEMENTARY-PROCEDURE SuccessfulOutcome", FT_STRING, BASE_NONE);
164 rnsap_proc_uout_dissector_table = register_dissector_table("rnsap.proc.uout", "RNSAP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", FT_STRING, BASE_NONE);
169 /*--- proto_reg_handoff_rnsap ---------------------------------------*/
171 proto_reg_handoff_rnsap(void)
173 dissector_handle_t rnsap_handle;
175 rnsap_handle = find_dissector("rnsap");
176 rrc_dl_dcch_handle = find_dissector("rrc.dl.dcch");
178 dissector_add("sccp.ssn", SCCP_SSN_RNSAP, rnsap_handle);
179 /* Add heuristic dissector
180 * Perhaps we want a preference whether the heuristic dissector
181 * is or isn't enabled
183 /*heur_dissector_add("sccp", dissect_sccp_rnsap_heur, proto_rnsap); */
185 #include "packet-rnsap-dis-tab.c"