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>
2015-06-16 21:07:04 +00:00
|
|
|
/* srt_table.c
|
|
|
|
* Helper routines common to all SRT taps.
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-08 16:59:17 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "proto.h"
|
2016-01-25 01:10:20 +00:00
|
|
|
#include "packet_info.h"
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
#include "srt_table.h"
|
2021-06-18 18:21:42 +00:00
|
|
|
#include <wsutil/ws_assert.h>
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
|
|
|
|
struct register_srt {
|
|
|
|
int proto_id; /* protocol id (0-indexed) */
|
|
|
|
const char* tap_listen_str; /* string used in register_tap_listener (NULL to use protocol name) */
|
|
|
|
int max_tables; /* Maximum number of tables expected (used by GUI to determine how to display tables) */
|
|
|
|
tap_packet_cb srt_func; /* function to be called for new incoming packets for SRT */
|
|
|
|
srt_init_cb srt_init; /* function to create dissector SRT tables */
|
|
|
|
srt_param_handler_cb param_cb; /* function to parse parameters of optional arguments of tap string */
|
|
|
|
void* param_data; /* Storage for tap parameter data */
|
|
|
|
};
|
|
|
|
|
|
|
|
int get_srt_proto_id(register_srt_t* srt)
|
|
|
|
{
|
|
|
|
if (!srt) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return srt->proto_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* get_srt_tap_listener_name(register_srt_t* srt)
|
|
|
|
{
|
|
|
|
return srt->tap_listen_str;
|
|
|
|
}
|
|
|
|
|
|
|
|
int get_srt_max_tables(register_srt_t* srt)
|
|
|
|
{
|
|
|
|
return srt->max_tables;
|
|
|
|
}
|
|
|
|
|
|
|
|
tap_packet_cb get_srt_packet_func(register_srt_t* srt)
|
|
|
|
{
|
|
|
|
return srt->srt_func;
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_srt_table_param_data(register_srt_t* srt, void* data)
|
|
|
|
{
|
|
|
|
srt->param_data = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
void* get_srt_table_param_data(register_srt_t* srt)
|
|
|
|
{
|
|
|
|
return srt->param_data;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
free_srt_table_data(srt_stat_table *rst)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for(i=0;i<rst->num_procs;i++){
|
|
|
|
g_free(rst->procedures[i].procedure);
|
|
|
|
rst->procedures[i].procedure=NULL;
|
|
|
|
}
|
|
|
|
g_free(rst->filter_string);
|
|
|
|
rst->filter_string=NULL;
|
|
|
|
g_free(rst->procedures);
|
|
|
|
rst->procedures=NULL;
|
|
|
|
rst->num_procs=0;
|
|
|
|
}
|
|
|
|
|
2018-05-13 19:45:16 +00:00
|
|
|
void free_srt_table(register_srt_t *srt, GArray* srt_array)
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
{
|
|
|
|
guint i = 0;
|
|
|
|
srt_stat_table *srt_table;
|
|
|
|
|
|
|
|
for (i = 0; i < srt_array->len; i++)
|
|
|
|
{
|
|
|
|
srt_table = g_array_index(srt_array, srt_stat_table*, i);
|
|
|
|
|
|
|
|
free_srt_table_data(srt_table);
|
2017-09-10 13:20:56 +00:00
|
|
|
g_free(srt_table);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Clear the tables */
|
|
|
|
g_array_set_size(srt_array, 0);
|
|
|
|
|
|
|
|
/* Clear out any possible parameter data */
|
|
|
|
g_free(srt->param_data);
|
|
|
|
srt->param_data = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void reset_srt_table_data(srt_stat_table *rst)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for(i=0;i<rst->num_procs;i++){
|
|
|
|
time_stat_init(&rst->procedures[i].stats);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-13 19:45:16 +00:00
|
|
|
void reset_srt_table(GArray* srt_array)
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
{
|
|
|
|
guint i = 0;
|
|
|
|
srt_stat_table *srt_table;
|
|
|
|
|
|
|
|
for (i = 0; i < srt_array->len; i++)
|
|
|
|
{
|
|
|
|
srt_table = g_array_index(srt_array, srt_stat_table*, i);
|
|
|
|
|
|
|
|
reset_srt_table_data(srt_table);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-08 01:18:33 +00:00
|
|
|
static wmem_tree_t *registered_srt_tables = NULL;
|
2017-01-02 21:24:41 +00:00
|
|
|
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
register_srt_t* get_srt_table_by_name(const char* name)
|
|
|
|
{
|
2017-02-08 01:18:33 +00:00
|
|
|
return (register_srt_t*)wmem_tree_lookup_string(registered_srt_tables, name, 0);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gchar* srt_table_get_tap_string(register_srt_t* srt)
|
|
|
|
{
|
|
|
|
GString *cmd_str = g_string_new(proto_get_protocol_filter_name(srt->proto_id));
|
|
|
|
g_string_append(cmd_str, ",srt");
|
|
|
|
return g_string_free(cmd_str, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void srt_table_get_filter(register_srt_t* srt, const char *opt_arg, const char **filter, char** err)
|
|
|
|
{
|
|
|
|
gchar* cmd_str = srt_table_get_tap_string(srt);
|
2015-06-21 05:35:27 +00:00
|
|
|
guint len = (guint32)strlen(cmd_str);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
guint pos = len;
|
|
|
|
*filter=NULL;
|
|
|
|
*err = NULL;
|
|
|
|
|
|
|
|
if(!strncmp(opt_arg, cmd_str, len))
|
|
|
|
{
|
|
|
|
if (srt->param_cb != NULL)
|
|
|
|
{
|
|
|
|
pos = srt->param_cb(srt, opt_arg + len, err);
|
|
|
|
if (*err != NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (pos > 0)
|
|
|
|
pos += len;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (opt_arg[pos] == ',')
|
|
|
|
{
|
2015-06-25 18:33:28 +00:00
|
|
|
*filter = opt_arg + pos+1;
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free(cmd_str);
|
|
|
|
}
|
|
|
|
|
2018-05-13 19:45:16 +00:00
|
|
|
void srt_table_dissector_init(register_srt_t* srt, GArray* srt_array)
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
{
|
2018-05-13 19:45:16 +00:00
|
|
|
srt->srt_init(srt, srt_array);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
register_srt_table(const int proto_id, const char* tap_listener, int max_tables, tap_packet_cb srt_packet_func, srt_init_cb init_cb, srt_param_handler_cb param_cb)
|
|
|
|
{
|
|
|
|
register_srt_t *table;
|
|
|
|
DISSECTOR_ASSERT(init_cb);
|
|
|
|
DISSECTOR_ASSERT(srt_packet_func);
|
|
|
|
|
2017-02-08 01:18:33 +00:00
|
|
|
table = wmem_new(wmem_epan_scope(), register_srt_t);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
|
|
|
|
table->proto_id = proto_id;
|
|
|
|
if (tap_listener != NULL)
|
|
|
|
table->tap_listen_str = tap_listener;
|
|
|
|
else
|
|
|
|
table->tap_listen_str = proto_get_protocol_filter_name(proto_id);
|
|
|
|
table->max_tables = max_tables;
|
|
|
|
table->srt_func = srt_packet_func;
|
|
|
|
table->srt_init = init_cb;
|
|
|
|
table->param_cb = param_cb;
|
|
|
|
table->param_data = NULL;
|
|
|
|
|
2017-02-08 01:18:33 +00:00
|
|
|
if (registered_srt_tables == NULL)
|
|
|
|
registered_srt_tables = wmem_tree_new(wmem_epan_scope());
|
|
|
|
|
2017-02-08 21:42:05 +00:00
|
|
|
wmem_tree_insert_string(registered_srt_tables, proto_get_protocol_filter_name(proto_id), table, 0);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
}
|
|
|
|
|
2017-02-08 01:18:33 +00:00
|
|
|
void srt_table_iterate_tables(wmem_foreach_func func, gpointer user_data)
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
{
|
2017-02-08 01:18:33 +00:00
|
|
|
wmem_tree_foreach(registered_srt_tables, func, user_data);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
srt_stat_table*
|
|
|
|
init_srt_table(const char *name, const char *short_name, GArray *srt_array, int num_procs, const char* proc_column_name,
|
2018-05-13 19:45:16 +00:00
|
|
|
const char *filter_string, void* table_specific_data)
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
srt_stat_table *table = g_new(srt_stat_table, 1);
|
|
|
|
|
2017-08-26 08:30:47 +00:00
|
|
|
table->filter_string = g_strdup(filter_string);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
|
|
|
|
table->name = name;
|
|
|
|
table->short_name = short_name;
|
|
|
|
table->proc_column_name = proc_column_name;
|
|
|
|
table->num_procs=num_procs;
|
2020-12-21 02:30:28 +00:00
|
|
|
table->procedures=g_new(srt_procedure_t, num_procs);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
for(i=0;i<num_procs;i++){
|
|
|
|
time_stat_init(&table->procedures[i].stats);
|
2016-06-23 15:35:17 +00:00
|
|
|
table->procedures[i].proc_index = 0;
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
table->procedures[i].procedure = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_array_insert_val(srt_array, srt_array->len, table);
|
|
|
|
|
|
|
|
table->table_specific_data = table_specific_data;
|
|
|
|
|
|
|
|
return table;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
init_srt_table_row(srt_stat_table *rst, int indx, const char *procedure)
|
|
|
|
{
|
|
|
|
/* we have discovered a new procedure. Extend the table accordingly */
|
|
|
|
if(indx>=rst->num_procs){
|
|
|
|
int old_num_procs=rst->num_procs;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
rst->num_procs=indx+1;
|
|
|
|
rst->procedures=(srt_procedure_t *)g_realloc(rst->procedures, sizeof(srt_procedure_t)*(rst->num_procs));
|
|
|
|
for(i=old_num_procs;i<rst->num_procs;i++){
|
|
|
|
time_stat_init(&rst->procedures[i].stats);
|
2016-06-23 15:35:17 +00:00
|
|
|
rst->procedures[i].proc_index = i;
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
rst->procedures[i].procedure=NULL;
|
|
|
|
}
|
|
|
|
}
|
2016-06-23 15:35:17 +00:00
|
|
|
rst->procedures[indx].proc_index = indx;
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
rst->procedures[indx].procedure=g_strdup(procedure);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
add_srt_table_data(srt_stat_table *rst, int indx, const nstime_t *req_time, packet_info *pinfo)
|
|
|
|
{
|
|
|
|
srt_procedure_t *rp;
|
|
|
|
nstime_t t, delta;
|
|
|
|
|
2021-06-18 18:21:42 +00:00
|
|
|
ws_assert(indx >= 0 && indx < rst->num_procs);
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
rp=&rst->procedures[indx];
|
|
|
|
|
|
|
|
/* calculate time delta between request and reply */
|
2016-01-23 03:57:32 +00:00
|
|
|
t=pinfo->abs_ts;
|
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>
2015-06-16 21:07:04 +00:00
|
|
|
nstime_delta(&delta, &t, req_time);
|
|
|
|
|
|
|
|
time_stat_update(&rp->stats, &delta, pinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|