aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2008-02-21 19:59:55 +0000
committerAnders Broman <anders.broman@ericsson.com>2008-02-21 19:59:55 +0000
commit018eabb6ab89d19fe4b39732beec2b42d0060d01 (patch)
treea44dd9b9cb23409fb0a4819481c3c26d202ee75c /asn1
parent85c51a72a052472b99fbd04184afefc4d6cf09c9 (diff)
Add code to set ssn in the preferenses and make it compile.
svn path=/trunk/; revision=24409
Diffstat (limited to 'asn1')
-rw-r--r--asn1/pcap/packet-pcap-template.c72
-rw-r--r--asn1/pcap/pcap.cnf11
2 files changed, 74 insertions, 9 deletions
diff --git a/asn1/pcap/packet-pcap-template.c b/asn1/pcap/packet-pcap-template.c
index fe930bbebc..86caee8959 100644
--- a/asn1/pcap/packet-pcap-template.c
+++ b/asn1/pcap/packet-pcap-template.c
@@ -34,6 +34,7 @@
#include <glib.h>
#include <epan/packet.h>
+#include <epan/prefs.h>
#include <epan/conversation.h>
#include <stdio.h>
@@ -55,8 +56,15 @@
#define PSNAME "PCAP"
#define PFNAME "pcap"
+#define MAX_SSN 254
+static range_t *global_ssn_range;
+static range_t *ssn_range;
+
+static dissector_table_t sccp_ssn_table;
+
#include "packet-pcap-val.h"
+static dissector_handle_t data_handle;
static dissector_handle_t pcap_handle = NULL;
/* Initialize the protocol and registered fields */
@@ -152,6 +160,50 @@ dissect_pcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_PCAP_PDU_PDU(tvb, pinfo, pcap_tree);
}
+
+static void range_delete_callback(guint32 ssn)
+{
+ if ( ssn ) {
+ dissector_delete("sccp.ssn", ssn, pcap_handle);
+ }
+}
+
+static void range_add_callback(guint32 ssn)
+{
+ if (ssn) {
+ dissector_add("sccp.ssn", ssn, pcap_handle);
+ }
+}
+
+
+static void init_pcap(void) {
+ if (ssn_range) {
+ 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);
+}
+
+
+/*--- proto_reg_handoff_pcap ---------------------------------------*/
+void
+proto_reg_handoff_pcap(void)
+{
+
+ static gboolean prefs_initialized = FALSE;
+
+ if (! prefs_initialized) {
+ sccp_ssn_table = find_dissector_table("sccp.ssn");
+ prefs_initialized = TRUE;
+ }
+
+ data_handle = find_dissector("data");
+
+#include "packet-pcap-dis-tab.c"
+}
+
/*--- proto_register_pcap -------------------------------------------*/
void proto_register_pcap(void) {
@@ -168,12 +220,15 @@ void proto_register_pcap(void) {
#include "packet-pcap-ettarr.c"
};
+ module_t *pcap_module;
/* Register protocol */
proto_pcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
/* Register fields and subtrees */
proto_register_field_array(proto_pcap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ pcap_module = prefs_register_protocol(proto_pcap, proto_reg_handoff_pcap);
/* Register dissector */
register_dissector("pcap", dissect_pcap, proto_pcap);
@@ -190,16 +245,19 @@ void proto_register_pcap(void) {
pcap_proc_out_dissector_table = register_dissector_table("pcap.proc.out", "PCAP-ELEMENTARY-PROCEDURE Outcome", FT_UINT32, BASE_DEC);
-}
+ /* Preferences */
+ /* Set default SSNs */
+ range_convert_str(&global_ssn_range, "", MAX_SSN);
+ ssn_range = range_empty();
+ prefs_register_range_preference(pcap_module, "ssn", "SCCP SSNs",
+ "SCCP (and SUA) SSNs to decode as PCAP",
+ &global_ssn_range, MAX_SSN);
-/*--- proto_reg_handoff_pcap ---------------------------------------*/
-void
-proto_reg_handoff_pcap(void)
-{
-
-#include "packet-pcap-dis-tab.c"
+ register_init_routine(&init_pcap);
}
+
+
diff --git a/asn1/pcap/pcap.cnf b/asn1/pcap/pcap.cnf
index cc1dfa3bb2..c050bfa1a1 100644
--- a/asn1/pcap/pcap.cnf
+++ b/asn1/pcap/pcap.cnf
@@ -6,6 +6,7 @@
#.OPT
PER
ALIGNED
+-L
#.END
#.EXPORTS
@@ -40,6 +41,13 @@ ProtocolExtensionField/id ext_id
PrivateIE-Field/value private_value
ProtocolIE-Field/value ie_field_value
+
+# Handle 64 bit constraint
+#.FN_PARS UTRAN-GPSReferenceTimeResult/ue-GPSTimingOfCell FN_VARIANT = _64b
+#.FN_PARS UTRAN-GANSSReferenceTimeUL/ue-GANSSTimingOfCellFrames FN_VARIANT = _64b
+#.FN_PARS UTRAN-GPSReferenceTime/utran-GPSTimingOfCell FN_VARIANT = _64b
+
+
#.FN_PARS ProtocolIE-ID VAL_PTR=&ProtocolIE_ID
#.FN_FTR ProtocolIE-ID
if (tree) {
@@ -58,7 +66,7 @@ ProtocolIE-Field/value ie_field_value
#.FN_FTR ProcedureCode
if (check_col(actx->pinfo->cinfo, COL_INFO))
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(ProcedureCode, s1ap_ProcedureCode_vals,
+ val_to_str(ProcedureCode, pcap_ProcedureCode_vals,
"unknown message"));
#.END
@@ -244,7 +252,6 @@ Positioning-ResponseTime N pcap.ies id-Positioning-ResponseTime
EnvironmentCharacterisation N pcap.ies id-EnvironmentCharacterisation
PositionData N pcap.ies id-PositionData
VelocityEstimate N pcap.ies id-VelocityEstimate
-N pcap.ies id-rxTimingDeviation768Info
UC-ID-InfEx-Rqst N pcap.ies id-UC-ID-InfEx-Rqst
UE-PositionEstimateInfo N pcap.ies id-UE-PositionEstimateInfo
OTDOA-MeasuredResultsSets N pcap.ies id-OTDOA-MeasuredResultsSets