From 48661c54357aea271bf87ab2b6ef907eafc97e9a Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 23 Nov 2017 15:14:01 +0100 Subject: 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 Acked-by: Arturo Borrero Gonzalez --- src/statement.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/statement.c') 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) -- cgit v1.2.3