summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2017-12-03 21:27:03 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2018-03-05 16:30:15 +0100
commitfa42f2118746f35ae6883ef5b0d4758863282fc9 (patch)
treebac51951392313ae1a4b2bff0af5bfc2bd0c60a8 /include
parentf1f6c326d78594fd0dc279d4870502addcd6fcc2 (diff)
src: flow offload support
This patch allows us to refer to existing flowtables: # nft add rule x x flow offload @m Packets matching this rule create an entry in the flow table 'm', hence, follow up packets that get to the flowtable at ingress bypass the classic forwarding path. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/ct.h2
-rw-r--r--include/statement.h9
2 files changed, 11 insertions, 0 deletions
diff --git a/include/ct.h b/include/ct.h
index ec5d55d8..2c3392d3 100644
--- a/include/ct.h
+++ b/include/ct.h
@@ -29,6 +29,8 @@ extern struct expr *ct_expr_alloc(const struct location *loc,
extern void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr);
extern struct stmt *notrack_stmt_alloc(const struct location *loc);
+extern struct stmt *flow_offload_stmt_alloc(const struct location *loc,
+ const char *table_name);
extern const struct datatype ct_dir_type;
extern const struct datatype ct_state_type;
diff --git a/include/statement.h b/include/statement.h
index 379d99e4..27c73567 100644
--- a/include/statement.h
+++ b/include/statement.h
@@ -10,6 +10,12 @@ extern struct stmt *expr_stmt_alloc(const struct location *loc,
extern struct stmt *verdict_stmt_alloc(const struct location *loc,
struct expr *expr);
+struct flow_stmt {
+ const char *table_name;
+};
+
+struct stmt *flow_stmt_alloc(const struct location *loc, const char *name);
+
struct objref_stmt {
uint32_t type;
struct expr *expr;
@@ -231,6 +237,7 @@ extern struct stmt *xt_stmt_alloc(const struct location *loc);
* @STMT_NOTRACK: notrack statement
* @STMT_OBJREF: stateful object reference statement
* @STMT_EXTHDR: extension header statement
+ * @STMT_FLOW_OFFLOAD: flow offload statement
*/
enum stmt_types {
STMT_INVALID,
@@ -256,6 +263,7 @@ enum stmt_types {
STMT_NOTRACK,
STMT_OBJREF,
STMT_EXTHDR,
+ STMT_FLOW_OFFLOAD,
};
/**
@@ -316,6 +324,7 @@ struct stmt {
struct fwd_stmt fwd;
struct xt_stmt xt;
struct objref_stmt objref;
+ struct flow_stmt flow;
};
};