From 655fb611aecca135a3f09fe9a4c50ddb2c76a122 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Thu, 16 Jan 2014 17:11:12 +0000 Subject: segtree: only use prefix expressions for ranges for selected datatypes It is uncommon to represent f.i. port number ranges as prefix expressions. Introduce a datatype DTYPE_F_PREFIX flag to indicate that the preferred representation of a range is a prefix and use it for segtree decomposition to decide whether to use a range or prefix expression. The ipaddr, ip6addr, mark and realm datatypes are changed to include the DTYPE_F_PREFIX flag. This fixes completely unreadable output in cases where the ranges are representable as prefixes, f.i. in case of port number: { 0/6 => jump chain1, 0/5 => jump chain2, 0/4 => continue} becomes: { 0-1023 => jump chain1, 1024-2047 => jump chain2, 2048-4095 => continue} Signed-off-by: Patrick McHardy --- include/datatype.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/datatype.h') diff --git a/include/datatype.h b/include/datatype.h index 239d5ea5..84dcdc8c 100644 --- a/include/datatype.h +++ b/include/datatype.h @@ -83,8 +83,15 @@ enum byteorder { struct expr; +/** + * enum datatype_flags + * + * @DTYPE_F_ALLOC: datatype is dynamically allocated + * @DTYPE_F_PREFIX: preferred representation for ranges is a prefix + */ enum datatype_flags { DTYPE_F_ALLOC = (1 << 0), + DTYPE_F_PREFIX = (1 << 1), }; /** -- cgit v1.2.3