From 81c51fc1ab699fb6e417ada77221657ca34efd0b Mon Sep 17 00:00:00 2001 From: Eric Jallot Date: Wed, 30 Oct 2019 18:06:19 +0100 Subject: src: flowtable: add support for named flowtable listing This patch allows you to dump a named flowtable. # nft list flowtable inet t f table inet t { flowtable f { hook ingress priority filter + 10 devices = { eth0, eth1 } } } Also: libnftables-json.adoc: fix missing quotes. Fixes: db0697ce7f60 ("src: support for flowtable listing") Fixes: 872f373dc50f ("doc: Add JSON schema documentation") Signed-off-by: Eric Jallot Signed-off-by: Pablo Neira Ayuso --- include/rule.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/rule.h b/include/rule.h index ba40db88..a718923b 100644 --- a/include/rule.h +++ b/include/rule.h @@ -45,6 +45,11 @@ struct set_spec { const char *name; }; +struct flowtable_spec { + struct location location; + const char *name; +}; + struct obj_spec { struct location location; const char *name; @@ -69,7 +74,7 @@ struct handle { struct chain_spec chain; struct set_spec set; struct obj_spec obj; - const char *flowtable; + struct flowtable_spec flowtable; struct handle_spec handle; struct position_spec position; struct position_spec index; @@ -470,6 +475,10 @@ extern struct flowtable *flowtable_alloc(const struct location *loc); extern struct flowtable *flowtable_get(struct flowtable *flowtable); extern void flowtable_free(struct flowtable *flowtable); extern void flowtable_add_hash(struct flowtable *flowtable, struct table *table); +extern struct flowtable *flowtable_lookup(const struct table *table, const char *name); +extern struct flowtable *flowtable_lookup_fuzzy(const char *ft_name, + const struct nft_cache *cache, + const struct table **table); void flowtable_print(const struct flowtable *n, struct output_ctx *octx); @@ -535,7 +544,6 @@ enum cmd_ops { * @CMD_OBJ_QUOTAS: multiple quotas * @CMD_OBJ_LIMIT: limit * @CMD_OBJ_LIMITS: multiple limits - * @CMD_OBJ_FLOWTABLES: flow tables * @CMD_OBJ_SECMARK: secmark * @CMD_OBJ_SECMARKS: multiple secmarks * @CMD_OBJ_SYNPROXY: synproxy -- cgit v1.2.3