netfilter: nft_numgen: add number generation offset
Add support of an offset value for incremental counter and random. With this option the sysadmin is able to start the counter to a certain value and then apply the generated number. Example: meta mark set numgen inc mod 2 offset 100 This will generate marks with the serie 100, 101, 100, 101, ... Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
14e2dee099
commit
2b03bf7324
2 changed files with 28 additions and 6 deletions
|
|
@ -1136,12 +1136,14 @@ enum nft_trace_types {
|
|||
* @NFTA_NG_DREG: destination register (NLA_U32)
|
||||
* @NFTA_NG_MODULUS: maximum counter value (NLA_U32)
|
||||
* @NFTA_NG_TYPE: operation type (NLA_U32)
|
||||
* @NFTA_NG_OFFSET: offset to be added to the counter (NLA_U32)
|
||||
*/
|
||||
enum nft_ng_attributes {
|
||||
NFTA_NG_UNSPEC,
|
||||
NFTA_NG_DREG,
|
||||
NFTA_NG_MODULUS,
|
||||
NFTA_NG_TYPE,
|
||||
NFTA_NG_OFFSET,
|
||||
__NFTA_NG_MAX
|
||||
};
|
||||
#define NFTA_NG_MAX (__NFTA_NG_MAX - 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue