diff options
author | Florian Westphal <fw@strlen.de> | 2015-12-12 01:10:04 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2015-12-12 01:10:04 +0100 |
commit | 0bfbe6146418d93b2523ea56b43213cac5d6620c (patch) | |
tree | e2bbc41841c648c69357c9dc66be1102ca6a8ffd /src/ct.c | |
parent | 757b3ab08b8b22f230fb8e481bec78ecbfbb335a (diff) |
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 <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/ct.c')
-rw-r--r-- | src/ct.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) |