summaryrefslogtreecommitdiff
path: root/include/netlink.h
diff options
context:
space:
mode:
authorroot <root@build-vm.(none)>2010-06-14 15:51:25 -0700
committerroot <root@build-vm.(none)>2010-06-14 15:51:25 -0700
commitc4414d9a8b31bedfb7471cd2365aaf5ea5cf55d5 (patch)
tree86ee5befd8195f56dcd91f9fd4e06368bf507a11 /include/netlink.h
downloadconntrack-tools-c4414d9a8b31bedfb7471cd2365aaf5ea5cf55d5.tar.gz
conntrack-tools-c4414d9a8b31bedfb7471cd2365aaf5ea5cf55d5.zip
debian conntrack 0.9.14-2
Diffstat (limited to 'include/netlink.h')
-rw-r--r--include/netlink.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/netlink.h b/include/netlink.h
new file mode 100644
index 0000000..0df0cbb
--- /dev/null
+++ b/include/netlink.h
@@ -0,0 +1,33 @@
+#ifndef _NETLINK_H_
+#define _NETLINK_H_
+
+#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
+
+struct nf_conntrack;
+struct nfct_handle;
+
+struct nfct_handle *nl_init_event_handler(void);
+struct nlif_handle *nl_init_interface_handler(void);
+
+int nl_send_resync(struct nfct_handle *h);
+void nl_resize_socket_buffer(struct nfct_handle *h);
+int nl_dump_conntrack_table(struct nfct_handle *h);
+int nl_flush_conntrack_table(struct nfct_handle *h);
+int nl_get_conntrack(struct nfct_handle *h, const struct nf_conntrack *ct);
+int nl_create_conntrack(struct nfct_handle *h, const struct nf_conntrack *ct, int timeout);
+int nl_update_conntrack(struct nfct_handle *h, const struct nf_conntrack *ct, int timeout);
+int nl_destroy_conntrack(struct nfct_handle *h, const struct nf_conntrack *ct);
+
+static inline int ct_is_related(const struct nf_conntrack *ct)
+{
+ return (nfct_attr_is_set(ct, ATTR_MASTER_L3PROTO) &&
+ nfct_attr_is_set(ct, ATTR_MASTER_L4PROTO) &&
+ ((nfct_attr_is_set(ct, ATTR_MASTER_IPV4_SRC) &&
+ nfct_attr_is_set(ct, ATTR_MASTER_IPV4_DST)) ||
+ (nfct_attr_is_set(ct, ATTR_MASTER_IPV6_SRC) &&
+ nfct_attr_is_set(ct, ATTR_MASTER_IPV6_DST))) &&
+ nfct_attr_is_set(ct, ATTR_MASTER_PORT_SRC) &&
+ nfct_attr_is_set(ct, ATTR_MASTER_PORT_DST));
+}
+
+#endif