diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-11-24 21:26:27 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-01-31 22:32:18 +0100 |
commit | 6f137a2db3419e961e41eda28668cd99e8a3f2e2 (patch) | |
tree | a53b45962d657c1c02363d9b248aa944840a9134 /src/statement.c | |
parent | 8a236ef68cd43af81fac10c5b58658514273a14e (diff) |
src: add fwd statement for netdev
This patch add support for the forward statement, only available at the
netdev family.
# nft add table netdev filter
# nft add chain netdev filter ingress { type filter hook ingress device eth0 priority 0\; }
# nft add rule netdev filter ingress fwd to dummy0
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/statement.c')
-rw-r--r-- | src/statement.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/statement.c b/src/statement.c index 153e93be..ca924410 100644 --- a/src/statement.c +++ b/src/statement.c @@ -490,3 +490,26 @@ struct stmt *dup_stmt_alloc(const struct location *loc) { return stmt_alloc(loc, &dup_stmt_ops); } + +static void fwd_stmt_print(const struct stmt *stmt) +{ + printf("fwd to "); + expr_print(stmt->fwd.to); +} + +static void fwd_stmt_destroy(struct stmt *stmt) +{ + expr_free(stmt->fwd.to); +} + +static const struct stmt_ops fwd_stmt_ops = { + .type = STMT_FWD, + .name = "fwd", + .print = fwd_stmt_print, + .destroy = fwd_stmt_destroy, +}; + +struct stmt *fwd_stmt_alloc(const struct location *loc) +{ + return stmt_alloc(loc, &fwd_stmt_ops); +} |