From 4437682babe86de7435d4fc839437f99e998b79c Mon Sep 17 00:00:00 2001 From: Alexey Perevalov Date: Fri, 12 Sep 2014 14:56:58 +0400 Subject: nfacct: add filter in to the list operation Filter feature is working through NFACCT_FILTER netlink attribute. If kernel doesn't support it, client will not get an error and silently will work as before. This patch adds following command line arguments: counters, overquota, bytes-quota, pkts-quota. Which could be used with list operation. Combination of these command line options isn't allowed. For example. user@root:/#nfacct list counters will show counters without byte/packet based quota user@root:/#nfacct list reset overquota will reset value for overquoted counters only Signed-off-by: Alexey Perevalov Signed-off-by: Pablo Neira Ayuso --- src/nfacct.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/nfacct.c') diff --git a/src/nfacct.c b/src/nfacct.c index e58b9af..2546a6e 100644 --- a/src/nfacct.c +++ b/src/nfacct.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -181,6 +182,7 @@ static int nfacct_cmd_list(int argc, char *argv[]) struct nlmsghdr *nlh; unsigned int seq, portid; int ret, i; + uint32_t mask = 0, value = 0; for (i=2; i