From 0d90e29bd252f7c75846d92ab394fc78b399d299 Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 31 Jul 2005 10:11:28 +0000 Subject: unfinished ctnetlink -> nfnetlink_conntrack changes --- input/flow/ulogd_inpflow_CTNL.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'input/flow/ulogd_inpflow_CTNL.c') 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 -#include -#include +#include +#include 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; } -- cgit v1.2.3