From 5ca4eb30d62e0ab2768d64de5c70931292213338 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 21 Feb 2017 18:11:31 +0100 Subject: src: add initial ct helper support This adds initial support for defining conntrack helper objects which can then be assigned to connections using the objref infrastructure: table ip filter { ct helper ftp-standard { type "ftp" protocol tcp } chain y { tcp dport 21 ct helper set "ftp-standard" } } Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- src/statement.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/statement.c') diff --git a/src/statement.c b/src/statement.c index 7ffd25f9..d824dc0b 100644 --- a/src/statement.c +++ b/src/statement.c @@ -174,6 +174,7 @@ struct stmt *counter_stmt_alloc(const struct location *loc) static const char *objref_type[NFT_OBJECT_MAX + 1] = { [NFT_OBJECT_COUNTER] = "counter", [NFT_OBJECT_QUOTA] = "quota", + [NFT_OBJECT_CT_HELPER] = "cthelper", }; static const char *objref_type_name(uint32_t type) @@ -186,7 +187,14 @@ static const char *objref_type_name(uint32_t type) static void objref_stmt_print(const struct stmt *stmt) { - printf("%s name ", objref_type_name(stmt->objref.type)); + switch (stmt->objref.type) { + case NFT_OBJECT_CT_HELPER: + printf("ct helper set "); + break; + default: + printf("%s name ", objref_type_name(stmt->objref.type)); + break; + } expr_print(stmt->objref.expr); } -- cgit v1.2.3