mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
![Alexey Perevalov](/assets/img/avatar_default.png)
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>
44 lines
839 B
C
44 lines
839 B
C
#ifndef _UAPI_NFNL_ACCT_H_
|
|
#define _UAPI_NFNL_ACCT_H_
|
|
|
|
#ifndef NFACCT_NAME_MAX
|
|
#define NFACCT_NAME_MAX 32
|
|
#endif
|
|
|
|
enum nfnl_acct_msg_types {
|
|
NFNL_MSG_ACCT_NEW,
|
|
NFNL_MSG_ACCT_GET,
|
|
NFNL_MSG_ACCT_GET_CTRZERO,
|
|
NFNL_MSG_ACCT_DEL,
|
|
NFNL_MSG_ACCT_OVERQUOTA,
|
|
NFNL_MSG_ACCT_MAX
|
|
};
|
|
|
|
enum nfnl_acct_flags {
|
|
NFACCT_F_QUOTA_PKTS = (1 << 0),
|
|
NFACCT_F_QUOTA_BYTES = (1 << 1),
|
|
NFACCT_F_OVERQUOTA = (1 << 2), /* can't be set from userspace */
|
|
};
|
|
|
|
enum nfnl_acct_type {
|
|
NFACCT_UNSPEC,
|
|
NFACCT_NAME,
|
|
NFACCT_PKTS,
|
|
NFACCT_BYTES,
|
|
NFACCT_USE,
|
|
NFACCT_FLAGS,
|
|
NFACCT_QUOTA,
|
|
NFACCT_FILTER,
|
|
__NFACCT_MAX
|
|
};
|
|
#define NFACCT_MAX (__NFACCT_MAX - 1)
|
|
|
|
enum nfnl_attr_filter_type {
|
|
NFACCT_FILTER_UNSPEC,
|
|
NFACCT_FILTER_MASK,
|
|
NFACCT_FILTER_VALUE,
|
|
__NFACCT_FILTER_MAX
|
|
};
|
|
#define NFACCT_FILTER_MAX (__NFACCT_FILTER_MAX - 1)
|
|
|
|
#endif /* _UAPI_NFNL_ACCT_H_ */
|