[PATCH nft 0/7] prepare for EXPR_SET_ELEM removal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Currently EXPR_MAPPING contains EXPR_SET_ELEM in the lhs:

                      EXPR_SET_ELEM -> EXPR_VALUE
                     /
        EXPR_MAPPING |
                     \
                      EXPR_VALUE

this series normalizes the expression for mappings:

                                       EXPR_SET_ELEM -> EXPR_VALUE
                                      /
        EXPR_SET_ELEM -> EXPR_MAPPING |
                                      \
                                       EXPR_VALUE

After this update, expr_set(expr)->expressions always contains
EXPR_SET_ELEM.

Another patch in this series moves expr->flags for EXPR_SET_ELEM to
expr->key->flags.

Midterm goal is to reduce memory footprint by introducing a struct
set_elem for expr_set() whose size is smaller that struct expr,
structure location is already provided by expr->key, this will also
remove the largest EXPR_* type in the struct expr union, this is not yet
accomplished by this series.

Pablo Neira Ayuso (7):
  src: normalize set element with EXPR_MAPPING
  src: allocate EXPR_SET_ELEM for EXPR_SET in embedded set declaration in sets
  src: assert on EXPR_SET only contains EXPR_SET_ELEM in the expressions list
  evaluate: simplify sets as set elems evaluation
  evaluate: clean up expr_evaluate_set()
  segtree: rename set_elem_add() to set_elem_expr_add()
  src: move flags from EXPR_SET_ELEM to key

 include/expression.h      |   4 +-
 src/datatype.c            |   1 +
 src/evaluate.c            | 126 +++++++++++------------
 src/expression.c          |  45 ++++++--
 src/intervals.c           | 209 ++++++++++++++++++++++----------------
 src/json.c                |  42 ++++++--
 src/monitor.c             |   2 +-
 src/netlink.c             | 105 ++++++++++---------
 src/netlink_delinearize.c |  18 +++-
 src/optimize.c            |  52 ++++++----
 src/parser_bison.y        |  12 ++-
 src/parser_json.c         |  14 ++-
 src/segtree.c             |  75 +++++++-------
 13 files changed, 415 insertions(+), 290 deletions(-)

-- 
2.30.2





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux