History

netfilter: nf_tables: add hash expression

This patch adds a new hash expression, this provides jhash support but this can be extended to support for other hash functions. The modulus and seed already comes embedded into this new expression. Use case example: ... meta mark set hash ip saddr mod 10

Laura Garcia Liebana committed 10 years ago

Commit cb1b69b1 parent 0ed63894 files · +163 −0Browse files

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

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+20−0
@@ -723,6 +723,26 @@ enum nft_meta_keys { · 722 unmodified lines
723723 NFT_META_PRANDOM,
724724 };
725725
726+/**
727+ * enum nft_hash_attributes - nf_tables hash expression netlink attributes
728+ *
729+ * @NFTA_HASH_SREG: source register (NLA_U32)
730+ * @NFTA_HASH_DREG: destination register (NLA_U32)
731+ * @NFTA_HASH_LEN: source data length (NLA_U32)
732+ * @NFTA_HASH_MODULUS: modulus value (NLA_U32)
733+ * @NFTA_HASH_SEED: seed value (NLA_U32)
734+ */
735+enum nft_hash_attributes {
736+ NFTA_HASH_UNSPEC,
737+ NFTA_HASH_SREG,
738+ NFTA_HASH_DREG,
739+ NFTA_HASH_LEN,
740+ NFTA_HASH_MODULUS,
741+ NFTA_HASH_SEED,
742+ __NFTA_HASH_MAX,
743+};
744+#define NFTA_HASH_MAX (__NFTA_HASH_MAX - 1)
745+
726746 /**
727747 * enum nft_meta_attributes - nf_tables meta expression netlink attributes
728748 *

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