netfilter: nft_limit: add per-byte limiting
This patch adds a new NFTA_LIMIT_TYPE netlink attribute to indicate the type of limiting. Contrary to per-packet limiting, the cost is calculated from the packet path since this depends on the packet length. The burst attribute indicates the number of bytes in which the rate can be exceeded. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
8bdf362642
commit
d2168e849e
2 changed files with 66 additions and 4 deletions
|
|
@ -756,18 +756,25 @@ enum nft_ct_attributes {
|
|||
};
|
||||
#define NFTA_CT_MAX (__NFTA_CT_MAX - 1)
|
||||
|
||||
enum nft_limit_type {
|
||||
NFT_LIMIT_PKTS,
|
||||
NFT_LIMIT_PKT_BYTES
|
||||
};
|
||||
|
||||
/**
|
||||
* enum nft_limit_attributes - nf_tables limit expression netlink attributes
|
||||
*
|
||||
* @NFTA_LIMIT_RATE: refill rate (NLA_U64)
|
||||
* @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)
|
||||
*/
|
||||
enum nft_limit_attributes {
|
||||
NFTA_LIMIT_UNSPEC,
|
||||
NFTA_LIMIT_RATE,
|
||||
NFTA_LIMIT_UNIT,
|
||||
NFTA_LIMIT_BURST,
|
||||
NFTA_LIMIT_TYPE,
|
||||
__NFTA_LIMIT_MAX
|
||||
};
|
||||
#define NFTA_LIMIT_MAX (__NFTA_LIMIT_MAX - 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue