diff options
author | Laura Garcia Liebana <nevola@gmail.com> | 2016-08-14 16:48:48 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-22 12:21:29 +0200 |
commit | 39646feffc0fc247ba8098adb33f76f0a12a9b7a (patch) | |
tree | b85c937caf4e99792be94536e2d2b20652a68b59 /include | |
parent | d2a13436aa3029333d4352e7bcddf956735ec0a8 (diff) |
expr: add number generation expression
Support for the nft ng expression within libnftnl.
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/buffer.h | 1 | ||||
-rw-r--r-- | include/libnftnl/expr.h | 6 | ||||
-rw-r--r-- | include/linux/netfilter/nf_tables.h | 27 |
3 files changed, 34 insertions, 0 deletions
diff --git a/include/buffer.h b/include/buffer.h index a753c78..8cfe377 100644 --- a/include/buffer.h +++ b/include/buffer.h @@ -82,6 +82,7 @@ int nftnl_buf_reg(struct nftnl_buf *b, int type, union nftnl_data_reg *reg, #define TOTAL "total" #define TYPE "type" #define UNIT "unit" +#define UNTIL "until" #define USE "use" #define XOR "xor" #define ADD "add" diff --git a/include/libnftnl/expr.h b/include/libnftnl/expr.h index 663cbf3..8815154 100644 --- a/include/libnftnl/expr.h +++ b/include/libnftnl/expr.h @@ -51,6 +51,12 @@ enum { }; enum { + NFTNL_EXPR_NG_DREG = NFTNL_EXPR_BASE, + NFTNL_EXPR_NG_UNTIL, + NFTNL_EXPR_NG_TYPE, +}; + +enum { NFTNL_EXPR_META_KEY = NFTNL_EXPR_BASE, NFTNL_EXPR_META_DREG, NFTNL_EXPR_META_SREG, diff --git a/include/linux/netfilter/nf_tables.h b/include/linux/netfilter/nf_tables.h index 6390d6e..0b11abf 100644 --- a/include/linux/netfilter/nf_tables.h +++ b/include/linux/netfilter/nf_tables.h @@ -667,6 +667,33 @@ enum nft_exthdr_attributes { #define NFTA_EXTHDR_MAX (__NFTA_EXTHDR_MAX - 1) /** + * enum nft_ng_attributes - nf_tables number generator expression attributes + * + * @NFTA_NG_DREG: destination register (NLA_U32) + * @NFTA_NG_UNTIL: limit value (NLA_U32) + * @NFTA_NG_TYPE: type of operation (NLA_U32) + */ +enum nft_ng_attributes { + NFTA_NG_UNSPEC, + NFTA_NG_DREG, + NFTA_NG_UNTIL, + NFTA_NG_TYPE, + __NFTA_NG_MAX +}; +#define NFTA_NG_MAX (__NFTA_NG_MAX - 1) + +/** + * enum nft_ng_type - nf_tables number generator expression reject types + * + * @NFT_NG_INCREMENTAL: Incremental number generator + * @NFT_NG_RANDOM: Random number generator + */ +enum nft_ng_type { + NFT_NG_INCREMENTAL, + NFT_NG_RANDOM +}; + +/** * enum nft_meta_keys - nf_tables meta expression keys * * @NFT_META_LEN: packet length (skb->len) |