summaryrefslogtreecommitdiffstats
path: root/src/libct.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libct.c')
-rw-r--r--src/libct.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/libct.c b/src/libct.c
index d40c7f1..0555ec8 100644
--- a/src/libct.c
+++ b/src/libct.c
@@ -1,5 +1,6 @@
/*
- * (C) 2005 by Pablo Neira Ayuso <pablo@eurodev.net>
+ * (C) 2005 by Pablo Neira Ayuso <pablo@eurodev.net>,
+ * Harald Welte <laforge@netfilter.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -233,6 +234,28 @@ int create_conntrack(struct ip_conntrack_tuple *orig,
return 0;
}
+int create_expect(struct ip_conntrack_tuple *tuple,
+ struct ip_conntrack_tuple *mask,
+ struct ip_conntrack_tuple *master_tuple_orig,
+ struct ip_conntrack_tuple *master_tuple_reply,
+ unsigned long timeout)
+{
+ struct ctnl_handle cth;
+ int ret;
+
+ if ((ret = ctnl_open(&cth, 0)) < 0)
+ return ret;
+
+ if ((ret = ctnl_new_expect(&cth, tuple, mask, master_tuple_orig,
+ master_tuple_reply, timeout)) < 0)
+ return ret;
+
+ if ((ret = ctnl_close(&cth)) < 0)
+ return ret;
+
+ return -1;
+}
+
int delete_conntrack(struct ip_conntrack_tuple *tuple,
enum ctattr_type_t t)
{