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.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -1121,4 +1121,28 @@ enum nft_trace_types { · 1120 unmodified lines | ||
| 1121 | 1121 | __NFT_TRACETYPE_MAX |
| 1122 | 1122 | }; |
| 1123 | 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 | 1148 | #endif /* _LINUX_NF_TABLES_H */ |