summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-02-18 14:09:23 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-02-19 18:26:42 +0100
commitec3622b075300727d8349d7db0b116a41981b703 (patch)
tree22e99ed7807af81d5091eaf888def5ef70606999 /include
parent629ee38dca48651bc8c0eedf2f3a0066a6c0aa5b (diff)
src: add nftnl_*_{get,set}_array()HEADmaster
The original intention in eb58f53372e7 ("src: add flowtable support") was to introduce this helper function. Add helper to set and to get array of strings. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'include')
-rw-r--r--include/libnftnl/chain.h2
-rw-r--r--include/libnftnl/flowtable.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/include/libnftnl/chain.h b/include/libnftnl/chain.h
index 33d04e1..2eb22cc 100644
--- a/include/libnftnl/chain.h
+++ b/include/libnftnl/chain.h
@@ -46,6 +46,7 @@ void nftnl_chain_set_u32(struct nftnl_chain *t, uint16_t attr, uint32_t data);
void nftnl_chain_set_s32(struct nftnl_chain *t, uint16_t attr, int32_t data);
void nftnl_chain_set_u64(struct nftnl_chain *t, uint16_t attr, uint64_t data);
int nftnl_chain_set_str(struct nftnl_chain *t, uint16_t attr, const char *str);
+int nftnl_chain_set_array(struct nftnl_chain *t, uint16_t attr, const char **data);
const void *nftnl_chain_get(const struct nftnl_chain *c, uint16_t attr);
const void *nftnl_chain_get_data(const struct nftnl_chain *c, uint16_t attr,
@@ -55,6 +56,7 @@ uint8_t nftnl_chain_get_u8(const struct nftnl_chain *c, uint16_t attr);
uint32_t nftnl_chain_get_u32(const struct nftnl_chain *c, uint16_t attr);
int32_t nftnl_chain_get_s32(const struct nftnl_chain *c, uint16_t attr);
uint64_t nftnl_chain_get_u64(const struct nftnl_chain *c, uint16_t attr);
+const char *const *nftnl_chain_get_array(const struct nftnl_chain *c, uint16_t attr);
void nftnl_chain_rule_add(struct nftnl_rule *rule, struct nftnl_chain *c);
void nftnl_chain_rule_del(struct nftnl_rule *rule);
diff --git a/include/libnftnl/flowtable.h b/include/libnftnl/flowtable.h
index bdff114..168f833 100644
--- a/include/libnftnl/flowtable.h
+++ b/include/libnftnl/flowtable.h
@@ -41,7 +41,7 @@ void nftnl_flowtable_set_u32(struct nftnl_flowtable *t, uint16_t attr, uint32_t
void nftnl_flowtable_set_s32(struct nftnl_flowtable *t, uint16_t attr, int32_t data);
void nftnl_flowtable_set_u64(struct nftnl_flowtable *t, uint16_t attr, uint64_t data);
int nftnl_flowtable_set_str(struct nftnl_flowtable *t, uint16_t attr, const char *str);
-void nftnl_flowtable_set_array(struct nftnl_flowtable *t, uint16_t attr, const char **data);
+int nftnl_flowtable_set_array(struct nftnl_flowtable *t, uint16_t attr, const char **data);
const void *nftnl_flowtable_get(const struct nftnl_flowtable *c, uint16_t attr);
const void *nftnl_flowtable_get_data(const struct nftnl_flowtable *c, uint16_t attr,
@@ -50,7 +50,7 @@ const char *nftnl_flowtable_get_str(const struct nftnl_flowtable *c, uint16_t at
uint32_t nftnl_flowtable_get_u32(const struct nftnl_flowtable *c, uint16_t attr);
int32_t nftnl_flowtable_get_s32(const struct nftnl_flowtable *c, uint16_t attr);
uint64_t nftnl_flowtable_get_u64(const struct nftnl_flowtable *c, uint16_t attr);
-const char **nftnl_flowtable_get_array(const struct nftnl_flowtable *t, uint16_t attr);
+const char *const *nftnl_flowtable_get_array(const struct nftnl_flowtable *t, uint16_t attr);
struct nlmsghdr;