diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-08-03 17:31:48 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-10-11 15:15:02 +0200 |
commit | 00c179b4c9f9f9394cc6f79e5f2a68410631fd72 (patch) | |
tree | 00057636d125f3c89e2b9485c67c4283a98d91b2 /include/libnftables/table.h |
initial version of libnftables
It adds support for table, chain and rule handling.
This also includes expression handling for each rule.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/libnftables/table.h')
-rw-r--r-- | include/libnftables/table.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/libnftables/table.h b/include/libnftables/table.h new file mode 100644 index 0000000..de34c42 --- /dev/null +++ b/include/libnftables/table.h @@ -0,0 +1,51 @@ +#ifndef _TABLE_H_ +#define _TABLE_H_ + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct nft_table; + +struct nft_table *nft_table_alloc(void); +void nft_table_free(struct nft_table *); + +enum { + NFT_TABLE_ATTR_NAME = 0, + NFT_TABLE_ATTR_FAMILY, +}; + +void nft_table_attr_set(struct nft_table *t, uint16_t attr, void *data); +const void *nft_table_attr_get(struct nft_table *t, uint16_t attr); + +void nft_table_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nft_table *t); + +enum { + NFT_TABLE_O_DEFAULT = 0, +}; + +int nft_table_snprintf(char *buf, size_t size, struct nft_table *t, uint32_t type, uint32_t flags); + +struct nlmsghdr *nft_table_nlmsg_build_hdr(char *buf, uint16_t cmd, uint16_t family, uint16_t type, uint32_t seq); +int nft_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nft_table *t); + +struct nft_table_list; + +struct nft_table_list *nft_table_list_alloc(void); +void nft_table_list_free(struct nft_table_list *list); + +void nft_table_list_add(struct nft_table *r, struct nft_table_list *list); + +struct nft_table_list_iter; + +struct nft_table_list_iter *nft_table_list_iter_create(struct nft_table_list *l); +struct nft_table *nft_table_list_iter_next(struct nft_table_list_iter *iter); +void nft_table_list_iter_destroy(struct nft_table_list_iter *iter); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _TABLE_H_ */ |