netfilter: nft_limit: allow to invert matching criteria
This patch allows you to invert the ratelimit matching criteria, so you can match packets over the ratelimit. This is required to support what hashlimit does. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
@@ -780,6 +780,10 @@ enum nft_limit_type {
|
||||
NFT_LIMIT_PKT_BYTES
|
||||
};
|
||||
|
||||
enum nft_limit_flags {
|
||||
NFT_LIMIT_F_INV = (1 << 0),
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nft_limit_attributes - nf_tables limit expression netlink attributes
|
||||
*
|
||||
@@ -787,6 +791,7 @@ enum nft_limit_type {
|
||||
* @NFTA_LIMIT_UNIT: refill unit (NLA_U64)
|
||||
* @NFTA_LIMIT_BURST: burst (NLA_U32)
|
||||
* @NFTA_LIMIT_TYPE: type of limit (NLA_U32: enum nft_limit_type)
|
||||
* @NFTA_LIMIT_FLAGS: flags (NLA_U32: enum nft_limit_flags)
|
||||
*/
|
||||
enum nft_limit_attributes {
|
||||
NFTA_LIMIT_UNSPEC,
|
||||
@@ -794,6 +799,7 @@ enum nft_limit_attributes {
|
||||
NFTA_LIMIT_UNIT,
|
||||
NFTA_LIMIT_BURST,
|
||||
NFTA_LIMIT_TYPE,
|
||||
NFTA_LIMIT_FLAGS,
|
||||
__NFTA_LIMIT_MAX
|
||||
};
|
||||
#define NFTA_LIMIT_MAX (__NFTA_LIMIT_MAX - 1)
|
||||
|
Reference in New Issue
Block a user