aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2017-12-11 13:10:30 +0100
committerAnders Broman <a.broman58@gmail.com>2017-12-11 13:00:25 +0000
commit84f905786ed2b2aabaec9a0c1045daeda66358ba (patch)
tree0231307847d9998ed7d35bbd7a7707f39b498c4e
parent397e2a2d74e9c6ea103d3b4c30794552041e39c2 (diff)
[capture_info] Fold the code of capture_info_open() into ui/capture.c
Change-Id: Id302e88bed4da8b9b457049fb78b0bc7d7ffabe3 Reviewed-on: https://code.wireshark.org/review/24766 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--capture_info.c18
-rw-r--r--capture_info.h2
-rw-r--r--ui/capture.c14
-rw-r--r--ui/capture.h3
4 files changed, 16 insertions, 21 deletions
diff --git a/capture_info.c b/capture_info.c
index 2c71e2ff64..b08f696d1a 100644
--- a/capture_info.c
+++ b/capture_info.c
@@ -23,24 +23,6 @@
#include <wsutil/filesystem.h>
-/* open the info */
-void capture_info_open(capture_session *cap_session, info_data_t* cap_info)
-{
- if (cap_info->counts.counts_hash != NULL)
- {
- /* Clean up any previous lists of packet counts */
- g_hash_table_destroy(cap_info->counts.counts_hash);
- }
- cap_info->counts.counts_hash = g_hash_table_new_full( g_direct_hash, g_direct_equal, NULL, g_free );
- cap_info->counts.other = 0;
- cap_info->counts.total = 0;
-
- cap_info->wtap = NULL;
- cap_info->ui.counts = &cap_info->counts;
-
- capture_info_ui_create(&cap_info->ui, cap_session);
-}
-
static const char *
cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
diff --git a/capture_info.h b/capture_info.h
index 9a5cdd5b53..aa5953595c 100644
--- a/capture_info.h
+++ b/capture_info.h
@@ -49,8 +49,6 @@ typedef struct _info_data {
capture_info ui; /* user interface data */
} info_data_t;
-/* open the info - init values (wtap, counts), create dialog */
-extern void capture_info_open(capture_session *cap_session, info_data_t* cap_info);
/* new file arrived - (eventually close old wtap), open wtap */
extern gboolean capture_info_new_file(const char *new_filename, info_data_t* cap_info);
diff --git a/ui/capture.c b/ui/capture.c
index 68e667d8f8..4ec0da4c37 100644
--- a/ui/capture.c
+++ b/ui/capture.c
@@ -144,7 +144,19 @@ capture_start(capture_options *capture_opts, capture_session *cap_session, info_
capture_callback_invoke(capture_cb_capture_prepared, cap_session);
if(capture_opts->show_info)
- capture_info_open(cap_session, cap_data);
+ if (cap_data->counts.counts_hash != NULL)
+ {
+ /* Clean up any previous lists of packet counts */
+ g_hash_table_destroy(cap_data->counts.counts_hash);
+ }
+ cap_data->counts.counts_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free);
+ cap_data->counts.other = 0;
+ cap_data->counts.total = 0;
+
+ cap_data->wtap = NULL;
+ cap_data->ui.counts = &cap_data->counts;
+
+ capture_info_ui_create(&cap_data->ui, cap_session);
}
return ret;
diff --git a/ui/capture.h b/ui/capture.h
index 1f0082f816..219767c40f 100644
--- a/ui/capture.h
+++ b/ui/capture.h
@@ -91,6 +91,9 @@ extern gboolean capture_stats(if_stat_cache_t *sc, char *ifname, struct pcap_sta
*/
void capture_stat_stop(if_stat_cache_t *sc);
+/* open the info - init values (wtap, counts), create dialog */
+extern void capture_info_open(capture_session *cap_session, info_data_t* cap_info);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */