diff options
| author | Laura Garcia Liebana <nevola@gmail.com> | 2016-08-18 06:13:13 -0400 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-22 05:42:22 -0400 |
| commit | 91dbc6be0a62d3bcea98287734d593610aed507d (patch) | |
| tree | 99b45cb0fc627a16fa2418f806b13ea1c7b0669e /include/uapi/linux | |
| parent | 3d2f30a1df907e3ef4175121f0d21456630a72aa (diff) | |
netfilter: nf_tables: add number generator expression
This patch adds the numgen expression that allows us to generated
incremental and random numbers, this generator is bound to a upper limit
that is specified by userspace.
This expression is useful to distribute packets in a round-robin fashion
as well as randomly.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/netfilter/nf_tables.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h index 784fbf15ab3d..8c9d6ff70ec0 100644 --- a/include/uapi/linux/netfilter/nf_tables.h +++ b/include/uapi/linux/netfilter/nf_tables.h | |||
| @@ -1121,4 +1121,28 @@ enum nft_trace_types { | |||
| 1121 | __NFT_TRACETYPE_MAX | 1121 | __NFT_TRACETYPE_MAX |
| 1122 | }; | 1122 | }; |
| 1123 | #define NFT_TRACETYPE_MAX (__NFT_TRACETYPE_MAX - 1) | 1123 | #define NFT_TRACETYPE_MAX (__NFT_TRACETYPE_MAX - 1) |
| 1124 | |||
| 1125 | /** | ||
| 1126 | * enum nft_ng_attributes - nf_tables number generator expression netlink attributes | ||
| 1127 | * | ||
| 1128 | * @NFTA_NG_DREG: destination register (NLA_U32) | ||
| 1129 | * @NFTA_NG_UNTIL: source value to increment the counter until reset (NLA_U32) | ||
| 1130 | * @NFTA_NG_TYPE: operation type (NLA_U32) | ||
| 1131 | */ | ||
| 1132 | enum nft_ng_attributes { | ||
| 1133 | NFTA_NG_UNSPEC, | ||
| 1134 | NFTA_NG_DREG, | ||
| 1135 | NFTA_NG_UNTIL, | ||
| 1136 | NFTA_NG_TYPE, | ||
| 1137 | __NFTA_NG_MAX | ||
| 1138 | }; | ||
| 1139 | #define NFTA_NG_MAX (__NFTA_NG_MAX - 1) | ||
| 1140 | |||
| 1141 | enum nft_ng_types { | ||
| 1142 | NFT_NG_INCREMENTAL, | ||
| 1143 | NFT_NG_RANDOM, | ||
| 1144 | __NFT_NG_MAX | ||
| 1145 | }; | ||
| 1146 | #define NFT_NG_MAX (__NFT_NG_MAX - 1) | ||
| 1147 | |||
| 1124 | #endif /* _LINUX_NF_TABLES_H */ | 1148 | #endif /* _LINUX_NF_TABLES_H */ |
