From 0bfbe6146418d93b2523ea56b43213cac5d6620c Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Sat, 12 Dec 2015 01:10:04 +0100 Subject: ct: add packet/byte counter support packets and bytes need special treatment -- we want to be able to get packet/byte counter in either direction, but also express 'fetch in *BOTH* directions', i.e. ct packets original + ct packets reply > 1000 This either requires a '+' expression, a new 'both' direction, or keys where direction is optional, i.e. ct packets > 12345 ; original + reply ct original packets > 12345 ; original Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- src/ct.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ct.c') diff --git a/src/ct.c b/src/ct.c index ff6cd61b..b971ba16 100644 --- a/src/ct.c +++ b/src/ct.c @@ -203,6 +203,10 @@ static const struct ct_template ct_templates[] = { [NFT_CT_LABELS] = CT_TEMPLATE("label", &ct_label_type, BYTEORDER_HOST_ENDIAN, CT_LABEL_BIT_SIZE), + [NFT_CT_BYTES] = CT_TEMPLATE("bytes", &integer_type, + BYTEORDER_HOST_ENDIAN, 64), + [NFT_CT_PKTS] = CT_TEMPLATE("packets", &integer_type, + BYTEORDER_HOST_ENDIAN, 64), }; static void ct_expr_print(const struct expr *expr) -- cgit v1.2.3