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.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -28,9 +28,17 @@ enum nfnl_acct_type { · 27 unmodified lines | ||
| 28 | 28 | NFACCT_USE, |
| 29 | 29 | NFACCT_FLAGS, |
| 30 | 30 | NFACCT_QUOTA, |
| 31 | + NFACCT_FILTER, | |
| 31 | 32 | __NFACCT_MAX |
| 32 | 33 | }; |
| 33 | 34 | #define NFACCT_MAX (__NFACCT_MAX - 1) |
| 34 | 35 | |
| 36 | +enum nfnl_attr_filter_type { | |
| 37 | + NFACCT_FILTER_UNSPEC, | |
| 38 | + NFACCT_FILTER_MASK, | |
| 39 | + NFACCT_FILTER_VALUE, | |
| 40 | + __NFACCT_FILTER_MAX | |
| 41 | +}; | |
| 42 | +#define NFACCT_FILTER_MAX (__NFACCT_FILTER_MAX - 1) | |
| 35 | 43 | |
| 36 | 44 | #endif /* _UAPI_NFNL_ACCT_H_ */ |