diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-10 18:52:45 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-05-11 21:39:01 +0200 |
commit | 419d196886889e9b37f76f8c803cb08dcbc05505 (patch) | |
tree | eed1e42837a4a55d8cf16e65914b9ae961adddcd /src/mergesort.c | |
parent | 62b02808594d962f83e8b76f4da32da0673c7cfe (diff) |
src: add set element catch-all support
Add a catchall expression (EXPR_SET_ELEM_CATCHALL).
Use the asterisk (*) to represent the catch-all set element, e.g.
table x {
set y {
type ipv4_addr
counter
elements = { 1.2.3.4 counter packets 0 bytes 0, * counter packets 0 bytes 0 }
}
}
Special handling for segtree: zap the catch-all element from the set
element list and re-add it after processing.
Remove wildcard_expr deadcode in src/parser_bison.y
This patch also adds several tests for the tests/py and tests/shell
infrastructures.
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/mergesort.c')
-rw-r--r-- | src/mergesort.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mergesort.c b/src/mergesort.c index 41f35856..152b0556 100644 --- a/src/mergesort.c +++ b/src/mergesort.c @@ -44,6 +44,10 @@ static void expr_msort_value(const struct expr *expr, mpz_t value) case EXPR_CONCAT: concat_expr_msort_value(expr, value); break; + case EXPR_SET_ELEM_CATCHALL: + /* max value to ensure listing shows it in the last position */ + mpz_bitmask(value, expr->len); + break; default: BUG("Unknown expression %s\n", expr_name(expr)); } |