summaryrefslogtreecommitdiffstats
path: root/src/statement.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2017-11-23 15:14:01 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2017-11-24 15:03:28 +0100
commit48661c54357aea271bf87ab2b6ef907eafc97e9a (patch)
tree9222b459849f9db7332b71866df33225d9b12920 /src/statement.c
parent932847e0c3df8f6ee3dc4478f1ef0728926d9544 (diff)
src: deprecate "flow table" syntax, replace it by "meter"
According to bugzilla 1137: "flow tables" should not be syntactically unique. "Flow tables are always named, but they don't conform to the way sets, maps, and dictionaries work in terms of "add" and "delete" and all that. They are also "flow tables" instead of one word like "flows" or "throttle" or something. It seems weird to just have these break the syntactic expectations." Personally, I never liked the reference to "table" since we have very specific semantics in terms of what a "table" is netfilter for long time. This patch promotes "meter" as the new keyword. The former syntax is still accepted for a while, just to reduce chances of breaking things. At some point the former syntax will just be removed. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1137 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
Diffstat (limited to 'src/statement.c')
-rw-r--r--src/statement.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/statement.c b/src/statement.c
index 11d067f8..1f93260b 100644
--- a/src/statement.c
+++ b/src/statement.c
@@ -107,42 +107,42 @@ struct stmt *verdict_stmt_alloc(const struct location *loc, struct expr *expr)
return stmt;
}
-static void flow_stmt_print(const struct stmt *stmt, struct output_ctx *octx)
+static void meter_stmt_print(const struct stmt *stmt, struct output_ctx *octx)
{
- nft_print(octx, "flow ");
- if (stmt->flow.set) {
- expr_print(stmt->flow.set, octx);
+ nft_print(octx, "meter ");
+ if (stmt->meter.set) {
+ expr_print(stmt->meter.set, octx);
nft_print(octx, " ");
}
nft_print(octx, "{ ");
- expr_print(stmt->flow.key, octx);
+ expr_print(stmt->meter.key, octx);
nft_print(octx, " ");
octx->stateless++;
- stmt_print(stmt->flow.stmt, octx);
+ stmt_print(stmt->meter.stmt, octx);
octx->stateless--;
nft_print(octx, "} ");
}
-static void flow_stmt_destroy(struct stmt *stmt)
+static void meter_stmt_destroy(struct stmt *stmt)
{
- expr_free(stmt->flow.key);
- expr_free(stmt->flow.set);
- stmt_free(stmt->flow.stmt);
+ expr_free(stmt->meter.key);
+ expr_free(stmt->meter.set);
+ stmt_free(stmt->meter.stmt);
}
-static const struct stmt_ops flow_stmt_ops = {
- .type = STMT_FLOW,
- .name = "flow",
- .print = flow_stmt_print,
- .destroy = flow_stmt_destroy,
+static const struct stmt_ops meter_stmt_ops = {
+ .type = STMT_METER,
+ .name = "meter",
+ .print = meter_stmt_print,
+ .destroy = meter_stmt_destroy,
};
-struct stmt *flow_stmt_alloc(const struct location *loc)
+struct stmt *meter_stmt_alloc(const struct location *loc)
{
- return stmt_alloc(loc, &flow_stmt_ops);
+ return stmt_alloc(loc, &meter_stmt_ops);
}
static void counter_stmt_print(const struct stmt *stmt, struct output_ctx *octx)