aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ansi_map.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2021-02-06 15:04:20 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-02-07 22:30:21 +0000
commita1980945994f088a6015d9017547eba45cb0a475 (patch)
tree84d536b6ba838999faa1c9f0693d401ea477c9d3 /epan/dissectors/packet-ansi_map.c
parent04d887f2fd784bf38b6783a4deededed8d153733 (diff)
ansi_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-ansi_map.c')
-rw-r--r--epan/dissectors/packet-ansi_map.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ansi_map.c b/epan/dissectors/packet-ansi_map.c
index 96de9f5923..7fceee47ab 100644
--- a/epan/dissectors/packet-ansi_map.c
+++ b/epan/dissectors/packet-ansi_map.c
@@ -16086,11 +16086,21 @@ static stat_tap_table_item stat_fields[] = {{TABLE_ITEM_UINT, TAP_ALIGN_RIGHT, "
static void ansi_map_stat_init(stat_tap_table_ui* new_stat)
{
+ const char *table_name = "ANSI MAP Operation Statistics";
int num_fields = sizeof(stat_fields)/sizeof(stat_tap_table_item);
- stat_tap_table* table = stat_tap_init_table("ANSI MAP Operation Statistics", num_fields, 0, "ansi_map.op_code");
+ stat_tap_table *table;
int i = 0;
stat_tap_table_item_type items[sizeof(stat_fields)/sizeof(stat_tap_table_item)];
+ 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, "ansi_map.op_code");
stat_tap_add_table(new_stat, table);
/* Add a fow for each value type */
@@ -19199,7 +19209,7 @@ void proto_register_ansi_map(void) {
NULL, HFILL }},
/*--- End of included file: packet-ansi_map-hfarr.c ---*/
-#line 5361 "./asn1/ansi_map/packet-ansi_map-template.c"
+#line 5371 "./asn1/ansi_map/packet-ansi_map-template.c"
};
/* List of subtrees */
@@ -19460,7 +19470,7 @@ void proto_register_ansi_map(void) {
&ett_ansi_map_ReturnData,
/*--- End of included file: packet-ansi_map-ettarr.c ---*/
-#line 5394 "./asn1/ansi_map/packet-ansi_map-template.c"
+#line 5404 "./asn1/ansi_map/packet-ansi_map-template.c"
};
static ei_register_info ei[] = {