aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2006-04-21 18:11:20 +0000
committerAnders Broman <anders.broman@ericsson.com>2006-04-21 18:11:20 +0000
commitaa6ce770d08cf20d2c1f9677797ca9b47552bbe5 (patch)
treed155e4bff3a1131c7a6a12322932eeeb3003909e /epan
parente0e4f2d53205201cf09adc663c2301be0762cd25 (diff)
From Jeff Morris:
I tried out the 0.99.0pre1 release and I noticed that all my SCCP management messages (on SSN==1) were getting decoded as TCAP. Turns out that the INAP dissector (due to a bug) registers to SSN==1 by default (instead of 106 and 241). Rather than just fix that bug, the attached patch modifies the INAP dissector to use a range preference (like GSM MAP, TCAP, etc.). svn path=/trunk/; revision=17945
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-inap.c76
-rw-r--r--epan/dissectors/packet-inap.h2
2 files changed, 43 insertions, 35 deletions
diff --git a/epan/dissectors/packet-inap.c b/epan/dissectors/packet-inap.c
index 2e4bde5f72..f312eb74cd 100644
--- a/epan/dissectors/packet-inap.c
+++ b/epan/dissectors/packet-inap.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-inap.c */
+/* .\packet-inap.c */
/* ../../tools/asn2eth.py -X -b -e -p inap -c inap.cnf -s packet-inap-template inap.asn */
/* Input file: packet-inap-template.c */
@@ -351,12 +351,11 @@ static int hf_inap_rep = -1; /* ReturnErrorProblem */
/*--- End of included file: packet-inap-hf.c ---*/
#line 66 "packet-inap-template.c"
-static guint tcap_itu_ssn = 106;
-static guint tcap_itu_ssn1 = 241;
+#define MAX_SSN 254
+static range_t *global_ssn_range;
+static range_t *ssn_range;
-
-static guint global_tcap_itu_ssn = 1;
-static guint global_tcap_itu_ssn1 = 1;
+dissector_handle_t inap_handle;
/* Initialize the subtree pointers */
static gint ett_inap = -1;
@@ -494,7 +493,7 @@ static gint ett_inap_T_rinvokeID = -1;
static gint ett_inap_T_rproblem = -1;
/*--- End of included file: packet-inap-ett.c ---*/
-#line 84 "packet-inap-template.c"
+#line 83 "packet-inap-template.c"
static int dissect_invokeCmd(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset);
@@ -4986,7 +4985,7 @@ static void dissect_TNoAnswerArg_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tr
/*--- End of included file: packet-inap-fn.c ---*/
-#line 88 "packet-inap-template.c"
+#line 87 "packet-inap-template.c"
const value_string inap_opr_code_strings[] = {
@@ -5497,24 +5496,37 @@ dissect_inap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
}
/*--- proto_reg_handoff_inap ---------------------------------------*/
+static void range_delete_callback(guint32 ssn)
+{
+ if (ssn) {
+ delete_itu_tcap_subdissector(ssn, inap_handle);
+ }
+}
+
+static void range_add_callback(guint32 ssn)
+{
+ if (ssn) {
+ add_itu_tcap_subdissector(ssn, inap_handle);
+ }
+}
+
void proto_reg_handoff_inap(void) {
- dissector_handle_t inap_handle;
- static int inap_prefs_initialized = FALSE;
+
+ static int inap_prefs_initialized = FALSE;
inap_handle = create_dissector_handle(dissect_inap, proto_inap);
- if (!inap_prefs_initialized) {
- inap_prefs_initialized = TRUE;
- }
- else {
- delete_itu_tcap_subdissector(tcap_itu_ssn, inap_handle);
- delete_itu_tcap_subdissector(tcap_itu_ssn1, inap_handle);
- }
- tcap_itu_ssn = global_tcap_itu_ssn;
- tcap_itu_ssn1 = global_tcap_itu_ssn1;
- add_itu_tcap_subdissector(global_tcap_itu_ssn, inap_handle);
- add_itu_tcap_subdissector(global_tcap_itu_ssn1, inap_handle);
-
+ if (!inap_prefs_initialized) {
+ inap_prefs_initialized = TRUE;
+ }
+ else {
+ range_foreach(ssn_range, range_delete_callback);
+ }
+
+ g_free(ssn_range);
+ ssn_range = range_copy(global_ssn_range);
+
+ range_foreach(ssn_range, range_add_callback);
}
@@ -6658,7 +6670,7 @@ void proto_register_inap(void) {
"RejectPDU/rproblem/rep", HFILL }},
/*--- End of included file: packet-inap-hfarr.c ---*/
-#line 659 "packet-inap-template.c"
+#line 671 "packet-inap-template.c"
};
@@ -6803,7 +6815,7 @@ void proto_register_inap(void) {
&ett_inap_T_rproblem,
/*--- End of included file: packet-inap-ettarr.c ---*/
-#line 677 "packet-inap-template.c"
+#line 689 "packet-inap-template.c"
};
/* Register protocol */
@@ -6813,19 +6825,15 @@ void proto_register_inap(void) {
proto_register_field_array(proto_inap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ /* Set default SSNs */
+ range_convert_str(&global_ssn_range, "106,241", MAX_SSN);
+ ssn_range = range_empty();
inap_module = prefs_register_protocol(proto_inap, proto_reg_handoff_inap);
-
- prefs_register_uint_preference(inap_module, "tcap.itu_ssn",
- "Subsystem number used for INAP",
- "Set Subsystem number used for INAP",
- 10, &global_tcap_itu_ssn);
-
- prefs_register_uint_preference(inap_module, "tcap.itu_ssn1",
- "Subsystem number used for INAP",
- "Set Subsystem number used for INAP",
- 10, &global_tcap_itu_ssn1);
+ prefs_register_range_preference(inap_module, "ssn", "TCAP SSNs",
+ "TCAP Subsystem numbers used for INAP",
+ &global_ssn_range, MAX_SSN);
}
diff --git a/epan/dissectors/packet-inap.h b/epan/dissectors/packet-inap.h
index d6f872e73d..7236f9fdea 100644
--- a/epan/dissectors/packet-inap.h
+++ b/epan/dissectors/packet-inap.h
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
-/* ./packet-inap.h */
+/* .\packet-inap.h */
/* ../../tools/asn2eth.py -X -b -e -p inap -c inap.cnf -s packet-inap-template inap.asn */
/* Input file: packet-inap-template.h */