netfilter: nft_quota: dump consumed quota
Add a new attribute NFTA_QUOTA_CONSUMED that displays the amount of quota that has been already consumed. This allows us to restore the internal state of the quota object between reboots as well as to monitor how wasted it is. This patch changes the logic to account for the consumed bytes, instead of the bytes that remain to be consumed. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
@@ -988,12 +988,14 @@ enum nft_quota_flags {
|
||||
*
|
||||
* @NFTA_QUOTA_BYTES: quota in bytes (NLA_U16)
|
||||
* @NFTA_QUOTA_FLAGS: flags (NLA_U32)
|
||||
* @NFTA_QUOTA_CONSUMED: quota already consumed in bytes (NLA_U64)
|
||||
*/
|
||||
enum nft_quota_attributes {
|
||||
NFTA_QUOTA_UNSPEC,
|
||||
NFTA_QUOTA_BYTES,
|
||||
NFTA_QUOTA_FLAGS,
|
||||
NFTA_QUOTA_PAD,
|
||||
NFTA_QUOTA_CONSUMED,
|
||||
__NFTA_QUOTA_MAX
|
||||
};
|
||||
#define NFTA_QUOTA_MAX (__NFTA_QUOTA_MAX - 1)
|
||||
|
Reference in New Issue
Block a user