aboutsummaryrefslogtreecommitdiffstats
path: root/capchild
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-12-16 23:15:03 -0500
committerMichael Mann <mmann78@netscape.net>2015-12-19 14:22:56 +0000
commit444dfda793784cecda0757cbe50e27a5ba855ba0 (patch)
treeec34e5780c2dbe29bc2f170c2fc406ee20aa0430 /capchild
parent7baac67149a68b66087c5d688dbeda2869485765 (diff)
Allow "capture info data" to not be a singleton.
It was buried as a static variable in capture_info.c, and functions were refactored to allow a pointer to the info_data_t structure to be passed in. TShark and GTK will have their own single (global) copy of the structure, while it opens up Qt to have multiple instances. Change-Id: Ic2d7a2ad574de43f457cb18b194d6bc3fffb6120 Reviewed-on: https://code.wireshark.org/review/12691 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'capchild')
-rw-r--r--capchild/capture_session.h3
-rw-r--r--capchild/capture_sync.c3
-rw-r--r--capchild/capture_sync.h4
3 files changed, 7 insertions, 3 deletions
diff --git a/capchild/capture_session.h b/capchild/capture_session.h
index d55ef1f768..e10eeb5f7b 100644
--- a/capchild/capture_session.h
+++ b/capchild/capture_session.h
@@ -45,7 +45,7 @@ typedef enum {
} capture_state;
struct _capture_file;
-
+struct _info_data;
/*
* State of a capture session.
*/
@@ -64,6 +64,7 @@ typedef struct _capture_session {
guint32 count; /**< Total number of frames captured */
capture_options *capture_opts; /**< options for this capture */
struct _capture_file *cf; /**< handle to cfile */
+ struct _info_data *cap_data_info; /**< stats for this capture */
} capture_session;
extern void
diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c
index a698efc5e0..6f02219d60 100644
--- a/capchild/capture_sync.c
+++ b/capchild/capture_sync.c
@@ -339,7 +339,7 @@ init_pipe_args(int *argc) {
#define ARGV_NUMBER_LEN 24
/* a new capture run: start a new dumpcap task and hand over parameters through command line */
gboolean
-sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, void (*update_cb)(void))
+sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, info_data_t* cap_data, void (*update_cb)(void))
{
char ssnap[ARGV_NUMBER_LEN];
char scount[ARGV_NUMBER_LEN];
@@ -772,6 +772,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi
cap_session->fork_child_status = 0;
cap_session->capture_opts = capture_opts;
+ cap_session->cap_data_info = cap_data;
/* we might wait for a moment till child is ready, so update screen now */
if (update_cb) update_cb();
diff --git a/capchild/capture_sync.h b/capchild/capture_sync.h
index 3cdac27956..2f4a512af0 100644
--- a/capchild/capture_sync.h
+++ b/capchild/capture_sync.h
@@ -36,6 +36,8 @@
extern "C" {
#endif /* __cplusplus */
+struct _info_data;
+
/**
* Start a new capture session.
* Create a capture child which is doing the real capture work.
@@ -50,7 +52,7 @@ extern "C" {
* @return TRUE if a capture could be started, FALSE if not
*/
extern gboolean
-sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, void(*update_cb)(void));
+sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, struct _info_data* cap_data, void(*update_cb)(void));
/** User wants to stop capturing, gracefully close the capture child */
extern void