]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nfnetlink_acct: add filter support to nfacct counter list/reset
authorAlexey Perevalov <a.perevalov@samsung.com>
Wed, 20 Aug 2014 18:03:18 +0000 (22:03 +0400)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 26 Aug 2014 19:36:19 +0000 (21:36 +0200)
commitccbde3e2bd91c7879a8af6cec7565fbbb7586283
treedc21c997ab1e17b5605f2141980ad3e9c46b96d5
parent45fa4c1b72d2671d4aeb9b6f9c84cb3fec346ada
netfilter: nfnetlink_acct: add filter support to nfacct counter list/reset

You can use this to skip accounting objects when listing/resetting
via NFNL_MSG_ACCT_GET/NFNL_MSG_ACCT_GET_CTRZERO messages with the
NLM_F_DUMP netlink flag. The filtering covers the following cases:

1. No filter specified. In this case, the client will get old behaviour,
2. List/reset counter object only: In this case, you have to use
   NFACCT_F_QUOTA as mask and value 0.
3. List/reset quota objects only: You have to use NFACCT_F_QUOTA_PKTS
   as mask and value - the same, for byte based quota mask should be
   NFACCT_F_QUOTA_BYTES and value - the same.

If you want to obtain the object with any quota type
(ie. NFACCT_F_QUOTA_PKTS|NFACCT_F_QUOTA_BYTES), you need to perform
two dump requests, one to obtain NFACCT_F_QUOTA_PKTS objects and
another for NFACCT_F_QUOTA_BYTES.

Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/netfilter/nfnetlink_acct.h
net/netfilter/nfnetlink_acct.c