TCAP,CAMEL: Always enable SRT and Counter stats

The Service Response Time stats for CAMEL (and TCAP, which must be
enabled as well) are reliable and not that processor intensive. They
should be always enabled, just like the SRT stats for other protocols.

This also makes things less confusing with regards to the CAMEL
opcode counter stats, which were only enabled if the SRT preferences
were also set, since they use the same tap.

Also remove a unused function declaration in a header.
This commit is contained in:
John Thacker 2021-11-15 07:16:22 -05:00 committed by Wireshark GitLab Utility
parent 5005a696e4
commit 4015aa954c
6 changed files with 55 additions and 83 deletions

View File

@ -114,7 +114,6 @@ static int dissect_camel_EstablishTemporaryConnectionArgV2(gboolean implicit_tag
static int dissect_camel_SpecializedResourceReportArgV23(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
/* XXX - can we get rid of these and always do the SRT work? */
static gboolean gcamel_HandleSRT=FALSE;
static gboolean gcamel_PersistentSRT=FALSE;
static gboolean gcamel_DisplaySRT=FALSE;
gboolean gcamel_StatSRT=FALSE;
@ -496,9 +495,9 @@ camelsrt_init_routine(void)
/* The Display of SRT is enable
* 1) For wireshark only if Persistent Stat is enable
* 2) For Tshark, if the SRT handling is enable
* 2) For Tshark, if the SRT CLI tap is registered
*/
gcamel_DisplaySRT=gcamel_PersistentSRT || gcamel_HandleSRT&gcamel_StatSRT;
gcamel_DisplaySRT=gcamel_PersistentSRT || gcamel_StatSRT;
}
@ -1105,8 +1104,7 @@ dissect_camel_all(int version, const char* col_protocol, const char* suffix,
dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1, p_private_tcap);
/* If a Tcap context is associated to this transaction */
if (gcamel_HandleSRT &&
gp_camelsrt_info->tcap_context ) {
if (gp_camelsrt_info->tcap_context ) {
if (gcamel_DisplaySRT && tree) {
stat_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_camel_stat, NULL, "Stat");
}
@ -1552,10 +1550,7 @@ void proto_register_camel(void) {
"TCAP Subsystem numbers used for Camel",
&global_ssn_range, MAX_SSN);
prefs_register_bool_preference(camel_module, "srt",
"Analyze Service Response Time",
"Enable response time analysis",
&gcamel_HandleSRT);
prefs_register_obsolete_preference(camel_module, "srt");
prefs_register_bool_preference(camel_module, "persistentsrt",
"Persistent stats for SRT",

View File

@ -76,7 +76,6 @@ static struct tcapsrt_info_t tcapsrt_global_info[MAX_TCAP_INSTANCE];
static range_t *global_ssn_range;
static range_t *ssn_range;
gboolean gtcap_HandleSRT=FALSE;
/* These two timeout (in second) are used when some message are lost,
or when the same TCAP transcation identifier is reused */
guint gtcap_RepetitionTimeout = 10;
@ -1883,7 +1882,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
gp_tcap_context=NULL;
dissect_tcap_TCMessage(FALSE, tvb, 0, &asn1_ctx, tree, -1);
if (gtcap_HandleSRT && !tcap_subdissector_used ) {
if (!tcap_subdissector_used ) {
p_tcap_context=tcapsrt_call_matching(tvb, pinfo, tcap_stat_tree, gp_tcapsrt_info);
p_tcap_private->context=p_tcap_context;
@ -1899,7 +1898,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
p_tcap_context->subdissector_present=TRUE;
}
}
if (gtcap_HandleSRT && p_tcap_context && p_tcap_context->callback) {
if (p_tcap_context && p_tcap_context->callback) {
/* Callback fonction for the upper layer */
(p_tcap_context->callback)(tvb, pinfo, tcap_stat_tree, p_tcap_context);
}
@ -2046,10 +2045,7 @@ proto_register_tcap(void)
"SCCP (and SUA) SSNs to decode as TCAP",
&global_ssn_range, MAX_SSN);
prefs_register_bool_preference(tcap_module, "srt",
"Service Response Time Analyse",
"Activate the analyse for Response Time",
&gtcap_HandleSRT);
prefs_register_obsolete_preference(tcap_module, "srt");
prefs_register_bool_preference(tcap_module, "persistentsrt",
"Persistent stats for SRT",
@ -2106,8 +2102,11 @@ static void init_tcap(void)
/* Reset the session counter */
tcapsrt_global_SessionId=1;
/* Display of SRT only if Persistent Stat */
gtcap_DisplaySRT=gtcap_PersistentSRT || gtcap_HandleSRT&gtcap_StatSRT;
/* Display of SRT is enabled
* 1) For wireshark only if Persistent Stat is enabled
* 2) For tshark, if the CLI SRT tap is registered
*/
gtcap_DisplaySRT=gtcap_PersistentSRT || gtcap_StatSRT;
}
static void cleanup_tcap(void)
@ -2210,17 +2209,15 @@ dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
/*
* Handle The TCAP Service Response Time
*/
if ( gtcap_HandleSRT ) {
if (!tcap_subdissector_used) {
p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_subdissector_used=TRUE;
gp_tcap_context=p_tcap_context;
p_tcap_private->context=p_tcap_context;
} else {
/* Take the last TCAP context */
p_tcap_context = gp_tcap_context;
p_tcap_private->context=p_tcap_context;
}
if (!tcap_subdissector_used) {
p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_subdissector_used=TRUE;
gp_tcap_context=p_tcap_context;
p_tcap_private->context=p_tcap_context;
} else {
/* Take the last TCAP context */
p_tcap_context = gp_tcap_context;
p_tcap_private->context=p_tcap_context;
}
if (p_tcap_context) {
if (cur_oid) {

View File

@ -161,12 +161,6 @@ struct tcapsrt_info_t {
guint8 ope;
};
/**
* Routine called when the TAP is initialized.
* so hash table are (re)created
*/
void tcapsrt_init_routine(void);
/**
* Initialize the Message Info used by the main dissector
* Data are linked to a TCAP transaction

View File

@ -613,7 +613,6 @@ static int dissect_camel_EstablishTemporaryConnectionArgV2(gboolean implicit_tag
static int dissect_camel_SpecializedResourceReportArgV23(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
/* XXX - can we get rid of these and always do the SRT work? */
static gboolean gcamel_HandleSRT=FALSE;
static gboolean gcamel_PersistentSRT=FALSE;
static gboolean gcamel_DisplaySRT=FALSE;
gboolean gcamel_StatSRT=FALSE;
@ -842,7 +841,7 @@ static gint ett_camel_T_problem = -1;
static gint ett_camel_InvokeId = -1;
/*--- End of included file: packet-camel-ett.c ---*/
#line 146 "./asn1/camel/packet-camel-template.c"
#line 145 "./asn1/camel/packet-camel-template.c"
static expert_field ei_camel_unknown_invokeData = EI_INIT;
static expert_field ei_camel_unknown_returnResultData = EI_INIT;
@ -1184,7 +1183,7 @@ static const value_string camel_ectTreatmentIndicator_values[] = {
#define noInvokeId NULL
/*--- End of included file: packet-camel-val.h ---*/
#line 303 "./asn1/camel/packet-camel-template.c"
#line 302 "./asn1/camel/packet-camel-template.c"
/*--- Included file: packet-camel-table.c ---*/
@ -1274,7 +1273,7 @@ static const value_string camel_err_code_string_vals[] = {
/*--- End of included file: packet-camel-table.c ---*/
#line 305 "./asn1/camel/packet-camel-template.c"
#line 304 "./asn1/camel/packet-camel-template.c"
/*
* DEBUG fonctions
@ -7227,7 +7226,7 @@ static int dissect_CAP_U_ABORT_REASON_PDU(tvbuff_t *tvb _U_, packet_info *pinfo
/*--- End of included file: packet-camel-fn.c ---*/
#line 406 "./asn1/camel/packet-camel-template.c"
#line 405 "./asn1/camel/packet-camel-template.c"
/*--- Included file: packet-camel-table2.c ---*/
@ -7434,7 +7433,7 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,a
/*--- End of included file: packet-camel-table2.c ---*/
#line 408 "./asn1/camel/packet-camel-template.c"
#line 407 "./asn1/camel/packet-camel-template.c"
/*
* Functions needed for Hash-Table
@ -7526,9 +7525,9 @@ camelsrt_init_routine(void)
/* The Display of SRT is enable
* 1) For wireshark only if Persistent Stat is enable
* 2) For Tshark, if the SRT handling is enable
* 2) For Tshark, if the SRT CLI tap is registered
*/
gcamel_DisplaySRT=gcamel_PersistentSRT || gcamel_HandleSRT&gcamel_StatSRT;
gcamel_DisplaySRT=gcamel_PersistentSRT || gcamel_StatSRT;
}
@ -8135,8 +8134,7 @@ dissect_camel_all(int version, const char* col_protocol, const char* suffix,
dissect_camel_camelPDU(FALSE, tvb, 0, &asn1_ctx , tree, -1, p_private_tcap);
/* If a Tcap context is associated to this transaction */
if (gcamel_HandleSRT &&
gp_camelsrt_info->tcap_context ) {
if (gp_camelsrt_info->tcap_context ) {
if (gcamel_DisplaySRT && tree) {
stat_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_camel_stat, NULL, "Stat");
}
@ -8316,7 +8314,7 @@ void proto_reg_handoff_camel(void) {
/*--- End of included file: packet-camel-dis-tab.c ---*/
#line 1282 "./asn1/camel/packet-camel-template.c"
#line 1280 "./asn1/camel/packet-camel-template.c"
} else {
range_foreach(ssn_range, range_delete_callback, NULL);
wmem_free(wmem_epan_scope(), ssn_range);
@ -10438,7 +10436,7 @@ void proto_register_camel(void) {
"InvokeId_present", HFILL }},
/*--- End of included file: packet-camel-hfarr.c ---*/
#line 1455 "./asn1/camel/packet-camel-template.c"
#line 1453 "./asn1/camel/packet-camel-template.c"
};
/* List of subtrees */
@ -10666,7 +10664,7 @@ void proto_register_camel(void) {
&ett_camel_InvokeId,
/*--- End of included file: packet-camel-ettarr.c ---*/
#line 1482 "./asn1/camel/packet-camel-template.c"
#line 1480 "./asn1/camel/packet-camel-template.c"
};
static ei_register_info ei[] = {
@ -10740,10 +10738,7 @@ void proto_register_camel(void) {
"TCAP Subsystem numbers used for Camel",
&global_ssn_range, MAX_SSN);
prefs_register_bool_preference(camel_module, "srt",
"Analyze Service Response Time",
"Enable response time analysis",
&gcamel_HandleSRT);
prefs_register_obsolete_preference(camel_module, "srt");
prefs_register_bool_preference(camel_module, "persistentsrt",
"Persistent stats for SRT",

View File

@ -194,7 +194,6 @@ static struct tcapsrt_info_t tcapsrt_global_info[MAX_TCAP_INSTANCE];
static range_t *global_ssn_range;
static range_t *ssn_range;
gboolean gtcap_HandleSRT=FALSE;
/* These two timeout (in second) are used when some message are lost,
or when the same TCAP transcation identifier is reused */
guint gtcap_RepetitionTimeout = 10;
@ -1431,7 +1430,7 @@ static int dissect_DialoguePDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pr
/*--- End of included file: packet-tcap-fn.c ---*/
#line 143 "./asn1/tcap/packet-tcap-template.c"
#line 142 "./asn1/tcap/packet-tcap-template.c"
/*
* DEBUG functions
@ -3175,7 +3174,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
gp_tcap_context=NULL;
dissect_tcap_TCMessage(FALSE, tvb, 0, &asn1_ctx, tree, -1);
if (gtcap_HandleSRT && !tcap_subdissector_used ) {
if (!tcap_subdissector_used ) {
p_tcap_context=tcapsrt_call_matching(tvb, pinfo, tcap_stat_tree, gp_tcapsrt_info);
p_tcap_private->context=p_tcap_context;
@ -3191,7 +3190,7 @@ dissect_tcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
p_tcap_context->subdissector_present=TRUE;
}
}
if (gtcap_HandleSRT && p_tcap_context && p_tcap_context->callback) {
if (p_tcap_context && p_tcap_context->callback) {
/* Callback fonction for the upper layer */
(p_tcap_context->callback)(tvb, pinfo, tcap_stat_tree, p_tcap_context);
}
@ -3217,7 +3216,7 @@ proto_reg_handoff_tcap(void)
/*--- End of included file: packet-tcap-dis-tab.c ---*/
#line 1921 "./asn1/tcap/packet-tcap-template.c"
#line 1920 "./asn1/tcap/packet-tcap-template.c"
}
static void init_tcap(void);
@ -3559,7 +3558,7 @@ proto_register_tcap(void)
NULL, HFILL }},
/*--- End of included file: packet-tcap-hfarr.c ---*/
#line 1994 "./asn1/tcap/packet-tcap-template.c"
#line 1993 "./asn1/tcap/packet-tcap-template.c"
};
/* Setup protocol subtree array */
@ -3607,7 +3606,7 @@ proto_register_tcap(void)
&ett_tcap_Associate_source_diagnostic,
/*--- End of included file: packet-tcap-ettarr.c ---*/
#line 2004 "./asn1/tcap/packet-tcap-template.c"
#line 2003 "./asn1/tcap/packet-tcap-template.c"
};
/*static enum_val_t tcap_options[] = {
@ -3653,10 +3652,7 @@ proto_register_tcap(void)
"SCCP (and SUA) SSNs to decode as TCAP",
&global_ssn_range, MAX_SSN);
prefs_register_bool_preference(tcap_module, "srt",
"Service Response Time Analyse",
"Activate the analyse for Response Time",
&gtcap_HandleSRT);
prefs_register_obsolete_preference(tcap_module, "srt");
prefs_register_bool_preference(tcap_module, "persistentsrt",
"Persistent stats for SRT",
@ -3713,8 +3709,11 @@ static void init_tcap(void)
/* Reset the session counter */
tcapsrt_global_SessionId=1;
/* Display of SRT only if Persistent Stat */
gtcap_DisplaySRT=gtcap_PersistentSRT || gtcap_HandleSRT&gtcap_StatSRT;
/* Display of SRT is enabled
* 1) For wireshark only if Persistent Stat is enabled
* 2) For tshark, if the CLI SRT tap is registered
*/
gtcap_DisplaySRT=gtcap_PersistentSRT || gtcap_StatSRT;
}
static void cleanup_tcap(void)
@ -3817,17 +3816,15 @@ dissect_tcap_ITU_ComponentPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
/*
* Handle The TCAP Service Response Time
*/
if ( gtcap_HandleSRT ) {
if (!tcap_subdissector_used) {
p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_subdissector_used=TRUE;
gp_tcap_context=p_tcap_context;
p_tcap_private->context=p_tcap_context;
} else {
/* Take the last TCAP context */
p_tcap_context = gp_tcap_context;
p_tcap_private->context=p_tcap_context;
}
if (!tcap_subdissector_used) {
p_tcap_context=tcapsrt_call_matching(tvb, actx->pinfo, tcap_stat_tree, gp_tcapsrt_info);
tcap_subdissector_used=TRUE;
gp_tcap_context=p_tcap_context;
p_tcap_private->context=p_tcap_context;
} else {
/* Take the last TCAP context */
p_tcap_context = gp_tcap_context;
p_tcap_private->context=p_tcap_context;
}
if (p_tcap_context) {
if (cur_oid) {

View File

@ -169,12 +169,6 @@ struct tcapsrt_info_t {
guint8 ope;
};
/**
* Routine called when the TAP is initialized.
* so hash table are (re)created
*/
void tcapsrt_init_routine(void);
/**
* Initialize the Message Info used by the main dissector
* Data are linked to a TCAP transaction
@ -232,6 +226,6 @@ int dissect_tcap_UniDialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
int dissect_tcap_DialoguePDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
/*--- End of included file: packet-tcap-exp.h ---*/
#line 219 "./asn1/tcap/packet-tcap-template.h"
#line 213 "./asn1/tcap/packet-tcap-template.h"
#endif /* PACKET_tcap_H */