History

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.

Laura Garcia Liebana committed 10 years ago

Commit 91dbc6b1 parent 3d2f30a4 files · +223 −0Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+24−0
@@ -1121,4 +1121,28 @@ enum nft_trace_types { · 1120 unmodified lines
11211121 __NFT_TRACETYPE_MAX
11221122 };
11231123 #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+
11241148 #endif /* _LINUX_NF_TABLES_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t