summaryrefslogtreecommitdiffstats
path: root/src/ct.c
diff options
context:
space:
mode:
authorLiping Zhang <zlpnobody@163.com>2016-12-25 20:12:55 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2017-01-16 14:09:47 +0100
commite3ec9362f0edad08834cb8ba66bc45fdb0bf33f5 (patch)
tree383e1e10a0787e0cf10477cc493a8ea9a9ebb458 /src/ct.c
parent5d6e721c8fe31e14ddedb1a642553d072ec99bd1 (diff)
ct: add average bytes per packet counter support
Similar to connbytes extension in iptables, now you can use it to match average bytes per packet a connection has transferred so far. For example, match avgpkt in "BOTH" diretion: # nft add rule x y ct avgpkt \> 100 Match avgpkt in reply direction: # nft add rule x y ct reply avgpkt \< 900 Or match avgpkt in original direction: # nft add rule x y ct original avgpkt \> 200 Signed-off-by: Liping Zhang <zlpnobody@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/ct.c')
-rw-r--r--src/ct.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ct.c b/src/ct.c
index d0792890..31c7a4b1 100644
--- a/src/ct.c
+++ b/src/ct.c
@@ -232,6 +232,8 @@ static const struct ct_template ct_templates[] = {
BYTEORDER_HOST_ENDIAN, 64),
[NFT_CT_PKTS] = CT_TEMPLATE("packets", &integer_type,
BYTEORDER_HOST_ENDIAN, 64),
+ [NFT_CT_AVGPKT] = CT_TEMPLATE("avgpkt", &integer_type,
+ BYTEORDER_HOST_ENDIAN, 64),
};
static void ct_expr_print(const struct expr *expr)