aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_map.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2021-02-06 18:21:41 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-02-07 22:46:43 +0000
commit72468248c7073b0adcb3b0134b534c859a227120 (patch)
treed75665f10dcffa15071c184ad8bc569b09738d0a /epan/dissectors/packet-gsm_map.c
parenta1980945994f088a6015d9017547eba45cb0a475 (diff)
gsm_map: create and populate the stats table only once
Use the new stat_tap_find_table function during init to check if our statistics table already exists. If so, we can safely assume that its rows have already beend initialized. All we have to do is clear the data that was collected by the tap.
Diffstat (limited to 'epan/dissectors/packet-gsm_map.c')
-rw-r--r--epan/dissectors/packet-gsm_map.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c
index 411e537371..00de07240c 100644
--- a/epan/dissectors/packet-gsm_map.c
+++ b/epan/dissectors/packet-gsm_map.c
@@ -24069,6 +24069,7 @@ static stat_tap_table_item gsm_map_stat_fields[] = {
static void gsm_map_stat_init(stat_tap_table_ui* new_stat)
{
+ const char *table_name = "GSM MAP Operation Statistics";
int num_fields = sizeof(gsm_map_stat_fields)/sizeof(stat_tap_table_item);
stat_tap_table* table;
guint i;
@@ -24087,7 +24088,15 @@ static void gsm_map_stat_init(stat_tap_table_ui* new_stat)
items[TOT_BYTES_COLUMN].type = TABLE_ITEM_UINT;
items[AVG_BYTES_COLUMN].type = TABLE_ITEM_FLOAT;
- table = stat_tap_init_table("GSM MAP Operation Statistics", num_fields, 0, NULL);
+ table = stat_tap_find_table(new_stat, table_name);
+ if (table) {
+ if (new_stat->stat_tap_reset_table_cb) {
+ new_stat->stat_tap_reset_table_cb(table);
+ }
+ return;
+ }
+
+ table = stat_tap_init_table(table_name, num_fields, 0, NULL);
stat_tap_add_table(new_stat, table);
/* Add a row for each value type */
@@ -31999,7 +32008,7 @@ void proto_register_gsm_map(void) {
NULL, HFILL }},
/*--- End of included file: packet-gsm_map-hfarr.c ---*/
-#line 3320 "./asn1/gsm_map/packet-gsm_map-template.c"
+#line 3329 "./asn1/gsm_map/packet-gsm_map-template.c"
};
/* List of subtrees */
@@ -32754,7 +32763,7 @@ void proto_register_gsm_map(void) {
&ett_NokiaMAP_Extensions_AllowedServiceData,
/*--- End of included file: packet-gsm_map-ettarr.c ---*/
-#line 3359 "./asn1/gsm_map/packet-gsm_map-template.c"
+#line 3368 "./asn1/gsm_map/packet-gsm_map-template.c"
};
static ei_register_info ei[] = {
@@ -32898,7 +32907,7 @@ void proto_register_gsm_map(void) {
/*--- End of included file: packet-gsm_map-dis-tab.c ---*/
-#line 3419 "./asn1/gsm_map/packet-gsm_map-template.c"
+#line 3428 "./asn1/gsm_map/packet-gsm_map-template.c"
oid_add_from_string("ericsson-gsm-Map-Ext","1.2.826.0.1249.58.1.0" );
oid_add_from_string("accessTypeNotAllowed-id","1.3.12.2.1107.3.66.1.2");
/*oid_add_from_string("map-ac networkLocUp(1) version3(3)","0.4.0.0.1.0.1.3" );