From b97f45c2ebaa60ec5c3e8781937ce8ac3bba1251 Mon Sep 17 00:00:00 2001 From: Laura Garcia Liebana Date: Sun, 22 Apr 2018 11:04:56 +0200 Subject: expr: add map lookups for numgen statements This patch introduces two new attributes for numgen to allow map lookups where the number generator will be the key. Two new attributes needs to be included: NFTNL_EXPR_NG_SET_NAME and NFTNL_EXPR_NG_SET_ID in order to identify the given map. Signed-off-by: Laura Garcia Liebana Signed-off-by: Pablo Neira Ayuso --- include/libnftnl/expr.h | 2 ++ include/linux/netfilter/nf_tables.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/libnftnl/expr.h b/include/libnftnl/expr.h index 76df942..25d4103 100644 --- a/include/libnftnl/expr.h +++ b/include/libnftnl/expr.h @@ -57,6 +57,8 @@ enum { NFTNL_EXPR_NG_MODULUS, NFTNL_EXPR_NG_TYPE, NFTNL_EXPR_NG_OFFSET, + NFTNL_EXPR_NG_SET_NAME, + NFTNL_EXPR_NG_SET_ID, }; enum { diff --git a/include/linux/netfilter/nf_tables.h b/include/linux/netfilter/nf_tables.h index b904e33..54e35c1 100644 --- a/include/linux/netfilter/nf_tables.h +++ b/include/linux/netfilter/nf_tables.h @@ -1448,6 +1448,8 @@ enum nft_trace_types { * @NFTA_NG_MODULUS: maximum counter value (NLA_U32) * @NFTA_NG_TYPE: operation type (NLA_U32) * @NFTA_NG_OFFSET: offset to be added to the counter (NLA_U32) + * @NFTA_NG_SET_NAME: name of the map to lookup (NLA_STRING) + * @NFTA_NG_SET_ID: if of the map (NLA_U32) */ enum nft_ng_attributes { NFTA_NG_UNSPEC, @@ -1455,6 +1457,8 @@ enum nft_ng_attributes { NFTA_NG_MODULUS, NFTA_NG_TYPE, NFTA_NG_OFFSET, + NFTA_NG_SET_NAME, + NFTA_NG_SET_ID, __NFTA_NG_MAX }; #define NFTA_NG_MAX (__NFTA_NG_MAX - 1) -- cgit v1.2.3