aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/camel
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-06-16 17:07:04 -0400
committerMichael Mann <mmann78@netscape.net>2015-06-21 03:35:13 +0000
commit6de6f7f0f8f8b79c4fc7473c7e54dad433c7b61b (patch)
tree20b4b81b49467f5685f51c6b75e240c41ca6cb32 /asn1/camel
parent2895d58dc38321a72c82e1bf77d165ef4acbc73a (diff)
Further refactor SRT stats.
Create "common" SRT tap data collection intended for all GUIs. Refactor/merge functionality of existing dissectors that have SRT support (AFP, DCERPC, Diameter, FC, GTP, LDAP, NCP, RPC, SCIS, SMB, and SMB2) for both TShark and GTK. SMB and DCERPC "tap packet filtering" were different between TShark and GTK, so I went with GTK filter logic. CAMEL "tap packet filtering" was different between TShark and GTK, so GTK filtering logic was pushed to the dissector and the TShark tap was left alone. Change-Id: I7d6eaad0673fe628ef337f9165d7ed94f4a5e1cc Reviewed-on: https://code.wireshark.org/review/8894 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'asn1/camel')
-rw-r--r--asn1/camel/packet-camel-template.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/asn1/camel/packet-camel-template.c b/asn1/camel/packet-camel-template.c
index 4488eee513..2c11b5a219 100644
--- a/asn1/camel/packet-camel-template.c
+++ b/asn1/camel/packet-camel-template.c
@@ -39,6 +39,7 @@
#include <epan/prefs.h>
#include <epan/oids.h>
#include <epan/tap.h>
+#include <epan/srt_table.h>
#include <epan/asn1.h>
#include <epan/expert.h>
@@ -325,6 +326,45 @@ static void dbg(guint level, char *fmt, ...) {
}
#endif
+static void
+camelstat_init(struct register_srt* srt _U_, GArray* srt_array, srt_gui_init_cb gui_callback, void* gui_data)
+{
+ srt_stat_table *camel_srt_table;
+ gchar* tmp_str;
+ guint32 i;
+
+ camel_srt_table = init_srt_table("CAMEL Commands", NULL, srt_array, NB_CAMELSRT_CATEGORY, NULL, NULL, gui_callback, gui_data, NULL);
+ for (i = 0; i < NB_CAMELSRT_CATEGORY; i++)
+ {
+ tmp_str = val_to_str_wmem(NULL,i,camelSRTtype_naming,"Unknown (%d)");
+ init_srt_table_row(camel_srt_table, i, tmp_str);
+ wmem_free(NULL, tmp_str);
+ }
+}
+
+static int
+camelstat_packet(void *pcamel, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi)
+{
+ guint idx = 0;
+ srt_stat_table *camel_srt_table;
+ const struct camelsrt_info_t * pi=(const struct camelsrt_info_t *)psi;
+ srt_data_t *data = (srt_data_t *)pcamel;
+ int i;
+
+ for (i=1; i<NB_CAMELSRT_CATEGORY; i++) {
+ if ( pi->bool_msginfo[i] &&
+ pi->msginfo[i].is_delta_time
+ && pi->msginfo[i].request_available
+ && !pi->msginfo[i].is_duplicate )
+ {
+ camel_srt_table = g_array_index(data->srt_array, srt_stat_table*, idx);
+ add_srt_table_data(camel_srt_table, i, &pi->msginfo[i].req_time, pinfo);
+ }
+ } /* category */
+ return 1;
+}
+
+
static char camel_number_to_char(int number)
{
if (number < 10)
@@ -1471,5 +1511,7 @@ void proto_register_camel(void) {
/* Routine for statistic */
register_init_routine(&camelsrt_init_routine);
camel_tap=register_tap(PSNAME);
+
+ register_srt_table(proto_camel, "CAMEL", 1, camelstat_packet, camelstat_init, NULL);
}