diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-10-16 17:50:55 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-10-16 21:28:13 +0200 |
commit | 1cfe3cf24db29bd9274c2e59587cc0960e9db47c (patch) | |
tree | 4e71628daab46e7197d15960cbfd7618a5976db2 /include |
intial import of libnetfilter_acct
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 1 | ||||
-rw-r--r-- | include/libnetfilter_acct/libnetfilter_acct.h | 19 | ||||
-rw-r--r-- | include/linux/netfilter/Makefile.am | 1 | ||||
-rw-r--r-- | include/linux/netfilter/nfnetlink_acct.h | 35 |
4 files changed, 56 insertions, 0 deletions
diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..9760a52 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = libnetfilter_acct linux diff --git a/include/libnetfilter_acct/libnetfilter_acct.h b/include/libnetfilter_acct/libnetfilter_acct.h new file mode 100644 index 0000000..5a162b3 --- /dev/null +++ b/include/libnetfilter_acct/libnetfilter_acct.h @@ -0,0 +1,19 @@ +#ifndef _LIBNETFILTER_ACCT_H_ +#define _LIBNETFILTER_ACCT_H_ + +#include <sys/types.h> +#include <linux/netfilter/nfnetlink_acct.h> + +struct nfacct { + char name[NFACCT_NAME_MAX]; + uint64_t pkts; + uint64_t bytes; +}; + +struct nlmsghdr *nfacct_add(char *buf, struct nfacct *nfacct); +struct nlmsghdr *nfacct_list(char *buf); +int nfacct_list_cb(const struct nlmsghdr *nlh, void *data); +struct nlmsghdr *nfacct_flush(char *buf); +struct nlmsghdr *nfacct_delete(char *buf, const char *filter_name); + +#endif diff --git a/include/linux/netfilter/Makefile.am b/include/linux/netfilter/Makefile.am new file mode 100644 index 0000000..05c1924 --- /dev/null +++ b/include/linux/netfilter/Makefile.am @@ -0,0 +1 @@ +noinst_HEADERS = nfnetlink_acct.h diff --git a/include/linux/netfilter/nfnetlink_acct.h b/include/linux/netfilter/nfnetlink_acct.h new file mode 100644 index 0000000..99c68eb --- /dev/null +++ b/include/linux/netfilter/nfnetlink_acct.h @@ -0,0 +1,35 @@ +#ifndef _NFNL_ACCT_H_ +#define _NFNL_ACCT_H_ +#include <linux/netfilter/nfnetlink.h> + +/* FIXME: tweak to get it working with external headers. */ +#define NFNL_SUBSYS_ACCT NFNL_SUBSYS_OSF + +#define NFACCT_NAME_MAX 64 + +enum nfnl_acct_msg_types { + NFNL_MSG_ACCT_NEW, + NFNL_MSG_ACCT_GET, + NFNL_MSG_ACCT_DEL, + NFNL_MSG_ACCT_MAX +}; + +enum nfnl_acct_type { + NFACCT_UNSPEC, + NFACCT_NAME, + NFACCT_PKTS, + NFACCT_BYTES, + __NFACCT_MAX +}; +#define NFACCT_MAX (__NFACCT_MAX - 1) + +#ifdef __KERNEL__ + +struct nf_acct; + +extern struct nf_acct *nfnl_acct_find_get(char *filter_name); +extern void nfnl_acct_put(struct nf_acct *acct); + +#endif /* __KERNEL__ */ + +#endif /* _NFNL_ACCT_H */ |