summaryrefslogtreecommitdiffstats
path: root/include/libnetfilter_cttimeout
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-02-29 02:55:00 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2012-02-29 03:27:49 +0100
commitf3d2a5ee1af6fc4e548f02e4bc4e143d7d0c8d90 (patch)
tree0b9505f57ca42303a80e0d827897823ae07c6977 /include/libnetfilter_cttimeout
initial commit
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/libnetfilter_cttimeout')
-rw-r--r--include/libnetfilter_cttimeout/Makefile.am1
-rw-r--r--include/libnetfilter_cttimeout/libnetfilter_cttimeout.h106
2 files changed, 107 insertions, 0 deletions
diff --git a/include/libnetfilter_cttimeout/Makefile.am b/include/libnetfilter_cttimeout/Makefile.am
new file mode 100644
index 0000000..63c9eea
--- /dev/null
+++ b/include/libnetfilter_cttimeout/Makefile.am
@@ -0,0 +1 @@
+pkginclude_HEADERS = libnetfilter_cttimeout.h
diff --git a/include/libnetfilter_cttimeout/libnetfilter_cttimeout.h b/include/libnetfilter_cttimeout/libnetfilter_cttimeout.h
new file mode 100644
index 0000000..be37636
--- /dev/null
+++ b/include/libnetfilter_cttimeout/libnetfilter_cttimeout.h
@@ -0,0 +1,106 @@
+#ifndef _LIBNETFILTER_CTTIMEOUT_H_
+#define _LIBNETFILTER_CTTIMEOUT_H_
+
+#include <sys/types.h>
+#include <linux/netfilter/nfnetlink_conntrack.h>
+
+struct nfct_timeout;
+
+struct nfct_timeout *nfct_timeout_alloc(void);
+void nfct_timeout_free(struct nfct_timeout *);
+
+enum nfct_timeout_attr {
+ NFCT_TIMEOUT_ATTR_NAME= 0,
+ NFCT_TIMEOUT_ATTR_L3PROTO,
+ NFCT_TIMEOUT_ATTR_L4PROTO,
+ NFCT_TIMEOUT_ATTR_POLICY,
+ NFCT_TIMEOUT_ATTR_MAX
+};
+
+enum nfct_timeout_tcp_attr {
+ NFCT_TIMEOUT_ATTR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P_COOKIE_ECHOED,
+ NFCT_TIMEOUT_ATTR_SCTP_ESTABLISHED,
+ NFCT_TIMEOUT_ATTR_SCTP_SHUTDOWN_SENT,
+ NFCT_TIMEOUT_ATTR_SCTP_SHUTDOWN_RECD,
+ NFCT_TIMEOUT_ATTR_SCTP_SHUTDOWN_ACK_SENT,
+ NFCT_TIMEOUT_ATTR_SCTP_MAX
+};
+
+enum nfct_timeout_icmp_attr {
+ NFCT_TIMEOUT_ATTR_ICMP = 0,
+ NFCT_TIMEOUT_ATTR_ICMP_MAX
+};
+
+enum nfct_timeout_icmpv6_attr {
+ NFCT_TIMEOUT_ATTR_ICMPV6 = 0,
+ NFCT_TIMEOUT_ATTR_ICMPV6_MAX
+};
+
+enum nfct_timeout_gre_attr {
+ NFCT_TIMEOUT_ATTR_GRE_UNREPLIED = 0,
+ NFCT_TIMEOUT_ATTR_GRE_REPLIED,
+ NFCT_TIMEOUT_ATTR_GRE_MAX
+};
+
+enum nfct_timeout_generic_attr {
+ NFCT_TIMEOUT_ATTR_GENERIC = 0,
+ NFCT_TIMEOUT_ATTR_GENERIC_MAX
+};
+
+int nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data);
+int nfct_timeout_attr_set_u8(struct nfct_timeout *t, uint32_t type, uint8_t data);
+int nfct_timeout_attr_set_u16(struct nfct_timeout *t, uint32_t type, uint16_t data);
+void nfct_timeout_attr_unset(struct nfct_timeout *t, uint32_t type);
+
+int nfct_timeout_policy_attr_set_u32(struct nfct_timeout *, uint32_t type, uint32_t data);
+void nfct_timeout_policy_attr_unset(struct nfct_timeout *t, uint32_t type);
+
+struct nlmsghdr;
+
+struct nlmsghdr *nfct_timeout_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq);
+void nfct_timeout_nlmsg_build_payload(struct nlmsghdr *, struct nfct_timeout *);
+int nfct_timeout_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfct_timeout *);
+
+int nfct_timeout_snprintf(char *buf, size_t size, struct nfct_timeout *, unsigned int flags);
+
+#endif