conntrackd: cthelper: add DHCPv6 support
[email protected]
maintainerPATCH 1/1 conntrackd: cthelper: add DHCPv6 support
From: Pablo Neira Ayuso <[email protected]>
This patch adds the DHCPv6 helper.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- include/helper.h | 2 + src/expect.c | 20 +++++++++ src/helpers/Makefile.am | 7 +++- src/helpers/dhcpv6.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 src/helpers/dhcpv6.c
include/helper.h +2 -0
@@ -46,6 +46,8 @@ extern int cthelper_expect_init(struct nf_expect *exp, struct nf_conntrack *mastextern int cthelper_add_expect (struct nf_expect *exp);extern int cthelper_del_expect (struct nf_expect *exp); +extern int cthelper_update_ct (struct nf_conntrack *ct); +extern void cthelper_get_addr_src (struct nf_conntrack *ct,int dir,union nfct_attr_grp_addr *addr);extern void cthelper_get_addr_dst (struct nf_conntrack *ct,int dir,union nfct_attr_grp_addr *addr);
src/expect.c +20 -0
@@ -175,6 +175,26 @@ static int cthelper_expect_cmd(struct nf_expect *exp, int cmd)return ret; } +static int cthelper_ct_cmd (struct nf_conntrack *ct,int cmd) +{ +int ret; +struct nfct_handle *h; + + h =nfct_open (CONNTRACK ,0 ); +if (!h) +return -1 ; + + ret =nfct_query (h, cmd, ct); + +nfct_close (h); +return ret; +} + +int cthelper_update_ct (struct nf_conntrack *ct) +{ +return cthelper_ct_cmd (ct,NFCT_Q_UPDATE ); +} +int cthelper_add_expect (struct nf_expect *exp) {return cthelper_expect_cmd (exp,NFCT_Q_CREATE_UPDATE );
src/helpers/Makefile.am +6 -1
@@ -2,7 +2,8 @@ include $(top_srcdir)/Make_global.am pkglib_LTLIBRARIES = ct_helper_ftp.la \ ct_helper_rpc.la \ - ct_helper_tns.la + ct_helper_tns.la \ + ct_helper_dhcpv6.la ct_helper_ftp_la_SOURCES = ftp.c ct_helper_ftp_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_CONNTRACK_LIBS)
@@ -15,3 +16,7 @@ ct_helper_rpc_la_CFLAGS = $(AM_CFLAGS) $(LIBNETFILTER_CONNTRACK_CFLAGS) ct_helper_tns_la_SOURCES = tns.c ct_helper_tns_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_CONNTRACK_LIBS) ct_helper_tns_la_CFLAGS = $(AM_CFLAGS) $(LIBNETFILTER_CONNTRACK_CFLAGS) + +ct_helper_dhcpv6_la_SOURCES = dhcpv6.c +ct_helper_dhcpv6_la_LDFLAGS = -avoid-version -module $(LIBNETFILTER_CONNTRACK_LIBS) +ct_helper_dhcpv6_la_CFLAGS = $(AM_CFLAGS) $(LIBNETFILTER_CONNTRACK_CFLAGS)
src/helpers/dhcpv6.c new file +104 -0
104 lines not on this page · raw message
Signature · 1 line
1.7.10.4