diff options
author | Gerald Combs <gerald@wireshark.org> | 2014-09-09 16:42:58 -0400 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2014-12-20 17:39:29 +0000 |
commit | 9ba9cd83a4f72339b15aebbc1fbdde32f08ef3bc (patch) | |
tree | 4ed17ac7d9681f43bf1e0e1069bb2a84a48a8387 /capchild | |
parent | 2bb8255e29e26c7c14f7a83ce33b41f9af18501e (diff) | |
download | wireshark-9ba9cd83a4f72339b15aebbc1fbdde32f08ef3bc.tar.gz wireshark-9ba9cd83a4f72339b15aebbc1fbdde32f08ef3bc.tar.bz2 wireshark-9ba9cd83a4f72339b15aebbc1fbdde32f08ef3bc.zip |
Qt: Add a CaptureFile class.
Wrap the capture_file struct in a QObject which translates cf_cb_* and
capture_cb_* events into signals. Move the global cfile to
capture_file.cpp.
Don't use a void pointer for the capture file struct.
Change-Id: Ic5d5efb4bb1db64aa0247245890e5669b1da723a
Reviewed-on: https://code.wireshark.org/review/5885
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'capchild')
-rw-r--r-- | capchild/capture_ifinfo.c | 5 | ||||
-rw-r--r-- | capchild/capture_session.h | 10 | ||||
-rw-r--r-- | capchild/capture_sync.c | 2 |
3 files changed, 10 insertions, 7 deletions
diff --git a/capchild/capture_ifinfo.c b/capchild/capture_ifinfo.c index 0ae807ec53..eb86215c89 100644 --- a/capchild/capture_ifinfo.c +++ b/capchild/capture_ifinfo.c @@ -47,8 +47,9 @@ #include <glib.h> #include "capture_opts.h" -#include <capchild/capture_session.h> -#include <capchild/capture_sync.h> + +#include "capchild/capture_session.h" +#include "capchild/capture_sync.h" #ifdef HAVE_EXTCAP #include "extcap.h" #endif diff --git a/capchild/capture_session.h b/capchild/capture_session.h index 951b51e499..06cfb88902 100644 --- a/capchild/capture_session.h +++ b/capchild/capture_session.h @@ -41,10 +41,12 @@ typedef enum { CAPTURE_RUNNING /**< capture child signalled ok, capture is running now */ } capture_state; +struct _capture_file; + /* * State of a capture session. */ -typedef struct { +typedef struct _capture_session { int fork_child; /**< If not -1, in parent, process ID of child */ int fork_child_status; /**< Child exit status */ #ifdef _WIN32 @@ -57,15 +59,15 @@ typedef struct { #endif gboolean session_started; capture_options *capture_opts; /**< options for this capture */ - void *cf; /**< handle to cfile (note: untyped handle) */ + struct _capture_file *cf; /**< handle to cfile */ } capture_session; extern void -capture_session_init(capture_session *cap_session, void *cf); +capture_session_init(capture_session *cap_session, struct _capture_file *cf); #else /* dummy is needed because clang throws the error: empty struct has size 0 in C, size 1 in C++ */ -typedef struct {int dummy;} capture_session; +typedef struct _capture_session {int dummy;} capture_session; #endif /* HAVE_LIBPCAP */ diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c index 8542105a04..e1c6870745 100644 --- a/capchild/capture_sync.c +++ b/capchild/capture_sync.c @@ -127,7 +127,7 @@ static void (*fetch_dumpcap_pid)(int) = NULL; void -capture_session_init(capture_session *cap_session, void *cf) +capture_session_init(capture_session *cap_session, struct _capture_file *cf) { cap_session->cf = cf; cap_session->fork_child = -1; /* invalid process handle */ |