summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Jallot <ejallot@gmail.com>2019-10-30 18:06:19 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-10-31 14:16:42 +0100
commit81c51fc1ab699fb6e417ada77221657ca34efd0b (patch)
treea0deb244f9e69ba8b6013162a1293cc2ec517de2 /include
parent909e297ed430c3d7be0ad06bb002913e766115f1 (diff)
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 <ejallot@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/rule.h12
1 files changed, 10 insertions, 2 deletions
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