* [PATCH libnftnl] src: ct: add average bytes per packet counter support
@ 2016-12-25 12:02 Liping Zhang
2017-01-03 14:03 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Liping Zhang @ 2016-12-25 12:02 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel, Liping Zhang
From: Liping Zhang <zlpnobody@gmail.com>
Similar to ct packets/bytes ...
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
---
include/linux/netfilter/nf_tables.h | 5 +++++
src/expr/ct.c | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/linux/netfilter/nf_tables.h b/include/linux/netfilter/nf_tables.h
index 881d49e..b00a05d 100644
--- a/include/linux/netfilter/nf_tables.h
+++ b/include/linux/netfilter/nf_tables.h
@@ -860,6 +860,10 @@ enum nft_rt_attributes {
* @NFT_CT_PROTOCOL: conntrack layer 4 protocol
* @NFT_CT_PROTO_SRC: conntrack layer 4 protocol source
* @NFT_CT_PROTO_DST: conntrack layer 4 protocol destination
+ * @NFT_CT_LABELS: conntrack labels
+ * @NFT_CT_PKTS: conntrack packets
+ * @NFT_CT_BYTES: conntrack bytes
+ * @NFT_CT_AVGPKT: conntrack average bytes per packet
*/
enum nft_ct_keys {
NFT_CT_STATE,
@@ -878,6 +882,7 @@ enum nft_ct_keys {
NFT_CT_LABELS,
NFT_CT_PKTS,
NFT_CT_BYTES,
+ NFT_CT_AVGPKT,
};
/**
diff --git a/src/expr/ct.c b/src/expr/ct.c
index e680738..d3d352e 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -32,7 +32,7 @@ struct nftnl_expr_ct {
#define IP_CT_DIR_REPLY 1
#ifndef NFT_CT_MAX
-#define NFT_CT_MAX (NFT_CT_BYTES + 1)
+#define NFT_CT_MAX (NFT_CT_AVGPKT + 1)
#endif
static int
@@ -169,6 +169,7 @@ static const char *ctkey2str_array[NFT_CT_MAX] = {
[NFT_CT_LABELS] = "label",
[NFT_CT_PKTS] = "packets",
[NFT_CT_BYTES] = "bytes",
+ [NFT_CT_AVGPKT] = "avgpkt",
};
static const char *ctkey2str(uint32_t ctkey)
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-03 14:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-25 12:02 [PATCH libnftnl] src: ct: add average bytes per packet counter support Liping Zhang
2017-01-03 14:03 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).