aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/processing/watcher.h
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-09-24 11:20:53 +0200
committerMartin Willi <martin@revosec.ch>2014-09-24 11:20:53 +0200
commitb3accbe2cb600a47cf7a184d6271d9e61f7c5e30 (patch)
treefea915e3c07cb4e81186f5b09d16e1969fe9716d /src/libstrongswan/processing/watcher.h
parent6fe02dda752cbb2c2389a3367a3b6e04add43425 (diff)
parent5ea627bdfad4026ca6cc4fe87f6f1959b8b057fe (diff)
downloadstrongswan-b3accbe2cb600a47cf7a184d6271d9e61f7c5e30.tar.bz2
strongswan-b3accbe2cb600a47cf7a184d6271d9e61f7c5e30.tar.xz
Merge branch 'netlink-cleanups'
In preparation for larger parallelization changes in kernel-netlink, this merge does some general code cleanup in that plugin.
Diffstat (limited to 'src/libstrongswan/processing/watcher.h')
-rw-r--r--src/libstrongswan/processing/watcher.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libstrongswan/processing/watcher.h b/src/libstrongswan/processing/watcher.h
index 6e158cec2..f5ecceeb7 100644
--- a/src/libstrongswan/processing/watcher.h
+++ b/src/libstrongswan/processing/watcher.h
@@ -23,6 +23,7 @@
typedef struct watcher_t watcher_t;
typedef enum watcher_event_t watcher_event_t;
+typedef enum watcher_state_t watcher_state_t;
#include <library.h>
@@ -57,6 +58,18 @@ enum watcher_event_t {
};
/**
+ * State the watcher currently is in
+ */
+enum watcher_state_t {
+ /** no watcher thread running or queued */
+ WATCHER_STOPPED = 0,
+ /** a job has been queued for watching, but not yet started */
+ WATCHER_QUEUED,
+ /** a watcher thread is active, dispatching socket events */
+ WATCHER_RUNNING,
+};
+
+/**
* Watch multiple file descriptors using select().
*/
struct watcher_t {
@@ -86,6 +99,13 @@ struct watcher_t {
void (*remove)(watcher_t *this, int fd);
/**
+ * Get the current watcher state
+ *
+ * @reutrn currently active watcher state
+ */
+ watcher_state_t (*get_state)(watcher_t *this);
+
+ /**
* Destroy a watcher_t.
*/
void (*destroy)(watcher_t *this);