From 18bd29733fb67f975fcce1ae8c1aaed22220cd4d Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 11 Jan 2016 19:38:24 +0100 Subject: expr: limit: add support for flags This patch adds the limit flags, the first client of this is the inversion flag that allows us to match overlimit. Signed-off-by: Pablo Neira Ayuso --- tests/nft-expr_limit-test.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/nft-expr_limit-test.c b/tests/nft-expr_limit-test.c index bbc82c1..29fb489 100644 --- a/tests/nft-expr_limit-test.c +++ b/tests/nft-expr_limit-test.c @@ -43,6 +43,9 @@ static void cmp_nftnl_expr(struct nftnl_expr *rule_a, if (nftnl_expr_get_u64(rule_a, NFTNL_EXPR_LIMIT_TYPE) != nftnl_expr_get_u64(rule_b, NFTNL_EXPR_LIMIT_TYPE)) print_err("Expr TYPE mismatches"); + if (nftnl_expr_get_u32(rule_a, NFTNL_EXPR_LIMIT_FLAGS) != + nftnl_expr_get_u32(rule_b, NFTNL_EXPR_LIMIT_FLAGS)) + print_err("Expr FLAGS mismatches"); } int main(int argc, char *argv[]) @@ -66,6 +69,7 @@ int main(int argc, char *argv[]) nftnl_expr_set_u64(ex, NFTNL_EXPR_LIMIT_UNIT, 0x123456789abcdef0); nftnl_expr_set_u32(ex, NFTNL_EXPR_LIMIT_BURST, 0x89123456); nftnl_expr_set_u32(ex, NFTNL_EXPR_LIMIT_TYPE, 0xdef01234); + nftnl_expr_set_u32(ex, NFTNL_EXPR_LIMIT_FLAGS, 0xdef01234); nftnl_rule_add_expr(a, ex); -- cgit v1.2.3