diff options
author | Eric Leblond <eric@regit.org> | 2013-12-29 19:28:10 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-01-04 01:07:39 +0100 |
commit | 079041bd477f444d29e02c6442351c0ed6ffaa1e (patch) | |
tree | b4472282e4aaab269d4425af453e957c1e82a008 /src/netlink_delinearize.c | |
parent | 35f9338e6ae0169b9a8fd665d4f02608224010c5 (diff) |
src: add support for queue
This patch adds support for the queue target. It is now possible
to specify rule sending packet to a given queue and using load
balancing:
nft add rule filter output queue num 3 total 2 options fanout
Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/netlink_delinearize.c')
-rw-r--r-- | src/netlink_delinearize.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c index d1d35f85..b771da59 100644 --- a/src/netlink_delinearize.c +++ b/src/netlink_delinearize.c @@ -508,6 +508,20 @@ static void netlink_parse_nat(struct netlink_parse_ctx *ctx, list_add_tail(&stmt->list, &ctx->rule->stmts); } +static void netlink_parse_queue(struct netlink_parse_ctx *ctx, + const struct location *loc, + const struct nft_rule_expr *nle) +{ + struct stmt *stmt; + + stmt = queue_stmt_alloc(loc); + stmt->queue.queuenum = nft_rule_expr_get_u16(nle, NFT_EXPR_QUEUE_NUM); + stmt->queue.queues_total = + nft_rule_expr_get_u16(nle, NFT_EXPR_QUEUE_TOTAL); + stmt->queue.flags = nft_rule_expr_get_u16(nle, NFT_EXPR_QUEUE_FLAGS); + list_add_tail(&stmt->list, &ctx->rule->stmts); +} + static const struct { const char *name; void (*parse)(struct netlink_parse_ctx *ctx, @@ -528,6 +542,7 @@ static const struct { { .name = "limit", .parse = netlink_parse_limit }, { .name = "reject", .parse = netlink_parse_reject }, { .name = "nat", .parse = netlink_parse_nat }, + { .name = "queue", .parse = netlink_parse_queue }, }; static const struct input_descriptor indesc_netlink = { |