summaryrefslogtreecommitdiffstats
path: root/input/flow/ulogd_inpflow_CTNL.c
diff options
context:
space:
mode:
authorlaforge <laforge>2005-07-31 10:11:28 +0000
committerlaforge <laforge>2005-07-31 10:11:28 +0000
commit0d90e29bd252f7c75846d92ab394fc78b399d299 (patch)
treeb470b69c93378994bb2cc4e7ff9b1d3664d7344a /input/flow/ulogd_inpflow_CTNL.c
parent775ca90e2c53b70c78521efb87dd2c218cf6bc8b (diff)
unfinished ctnetlink -> nfnetlink_conntrack changes
Diffstat (limited to 'input/flow/ulogd_inpflow_CTNL.c')
-rw-r--r--input/flow/ulogd_inpflow_CTNL.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/input/flow/ulogd_inpflow_CTNL.c b/input/flow/ulogd_inpflow_CTNL.c
index 3f602ff..6f47bad 100644
--- a/input/flow/ulogd_inpflow_CTNL.c
+++ b/input/flow/ulogd_inpflow_CTNL.c
@@ -10,12 +10,13 @@
*/
#include <ulogd/ulogd.h>
-#include <libnfnetlink.h>
-#include <libctnetlink.h>
+#include <libnfnetlink/libnfnetlink.h>
+#include <libnfnetlink_conntrack/libnfnetlink_conntrack.h>
static struct ulogd_ctnl_pluginstance {
struct ulogd_pluginstance upi;
struct ctnl_handle cth;
+ struct ulogd_fd ctnl_fd;
};
static int ctnl_parser(struct ulogd_pluginstance *pi,
@@ -79,6 +80,18 @@ static struct ctnl_msg_Handler destroy_h = {
.handler = event_handler,
};
+static int read_cb_ctnl(int fd, unsigned int what, void *param)
+{
+ struct ulogd_ctnl_pluginstance *cpi =
+ (struct ulogd_ctnl_pluginstance *) param;
+
+ if (!(what & ULOGD_FD_READ))
+ return 0;
+
+ /* FIXME: implement this */
+ ctnl_event_conntrack(&cpi->cth, AF_INET);
+}
+
static struct ulogd_pluginstance *constructor_ctnl(struct ulogd_plugin *pl)
{
struct ulogd_ctnl_pluginstance *cpi = malloc(sizeof *cpi);
@@ -99,7 +112,14 @@ static struct ulogd_pluginstance *constructor_ctnl(struct ulogd_plugin *pl)
ctnl_register_handler(&cpi->cth, &new_h);
ctnl_register_handler(&cpi->cth, &destroy_h);
- //ctnl_event_conntrack(&cth, AF_INET);
+
+ /* FIXME: ctnl interface must allow usage of external select
+ * loop */
+ cpi->ctnl_fd.fd = ctnl_get_fd(&cpi->cth);
+ cpi->ctnl_fd.cb = &read_cb_ctnl;
+ cpi->ctnl_fd.data = cpi;
+
+ ulogd_register_fd(&cpi->ctnl_fd);
return &cpi->upi;
}