From 1ebd1e974e95ea90389064265523840968f50859 Mon Sep 17 00:00:00 2001 From: Laura Garcia Liebana Date: Thu, 23 Feb 2017 12:11:08 +0100 Subject: expr: hash: support of symmetric hash This patch provides symmetric hash support according to source ip address and port, and destination ip address and port. The new attribute NFTA_HASH_TYPE has been included to support different types of hashing functions. Currently supported NFT_HASH_JENKINS through jhash and NFT_HASH_SYM through symhash. The main difference between both types are: - jhash requires an expression with sreg, symhash doesn't. - symhash supports modulus and offset, but not seed. Examples: nft add rule ip nat prerouting ct mark set jhash ip saddr mod 2 nft add rule ip nat prerouting ct mark set symhash mod 2 Signed-off-by: Laura Garcia Liebana Signed-off-by: Pablo Neira Ayuso --- include/libnftnl/expr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/libnftnl') diff --git a/include/libnftnl/expr.h b/include/libnftnl/expr.h index 7d327ea..b06d1b1 100644 --- a/include/libnftnl/expr.h +++ b/include/libnftnl/expr.h @@ -229,6 +229,7 @@ enum { NFTNL_EXPR_HASH_MODULUS, NFTNL_EXPR_HASH_SEED, NFTNL_EXPR_HASH_OFFSET, + NFTNL_EXPR_HASH_TYPE, }; enum { -- cgit v1.2.3