diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-01-20 10:26:57 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-01-20 10:43:45 +0100 |
commit | 59e949294f4688bafe44b7def2972987224520c8 (patch) | |
tree | 0eccb41d605f64c88b9488879d34100ad9f17823 /include/libnftnl/ruleset.h | |
parent | 8460aa61e7136973ea01c40098f348b13d9af26f (diff) |
rename library to libnftnllibnftnl-1.0.0
We plan to use this library name for the higher layer library.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/libnftnl/ruleset.h')
-rw-r--r-- | include/libnftnl/ruleset.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/libnftnl/ruleset.h b/include/libnftnl/ruleset.h new file mode 100644 index 0000000..6f89110 --- /dev/null +++ b/include/libnftnl/ruleset.h @@ -0,0 +1,44 @@ +#ifndef _LIBNFTNL_RULESET_H_ +#define _LIBNFTNL_RULESET_H_ + +#include <stdio.h> + +#include <stdbool.h> +#include <stdint.h> +#include <sys/types.h> + +#include <libnftnl/common.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct nft_ruleset; + +struct nft_ruleset *nft_ruleset_alloc(void); +void nft_ruleset_free(struct nft_ruleset *r); + +enum { + NFT_RULESET_ATTR_TABLELIST = 0, + NFT_RULESET_ATTR_CHAINLIST, + NFT_RULESET_ATTR_SETLIST, + NFT_RULESET_ATTR_RULELIST, +}; + +bool nft_ruleset_attr_is_set(const struct nft_ruleset *r, uint16_t attr); +void nft_ruleset_attr_unset(struct nft_ruleset *r, uint16_t attr); +void nft_ruleset_attr_set(struct nft_ruleset *r, uint16_t attr, void *data); +const void *nft_ruleset_attr_get(const struct nft_ruleset *r, uint16_t attr); + +int nft_ruleset_parse(struct nft_ruleset *rs, enum nft_parse_type type, + const char *data, struct nft_parse_err *err); +int nft_ruleset_parse_file(struct nft_ruleset *rs, enum nft_parse_type type, + FILE *fp, struct nft_parse_err *err); +int nft_ruleset_snprintf(char *buf, size_t size, const struct nft_ruleset *rs, uint32_t type, uint32_t flags); +int nft_ruleset_fprintf(FILE *fp, const struct nft_ruleset *rs, uint32_t type, uint32_t flags); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _LIBNFTNL_RULESET_H_ */ |