summaryrefslogtreecommitdiffstats
path: root/src/expr/dynset.c
Commit message (Collapse)AuthorAgeFilesLines
* src: Fix nftnl_*_get_data() to return the real attribute lengthCarlos Falgueras García2016-07-111-0/+3
| | | | | | | | | | | All getters must set the memory size of the attributes, ie. this includes the nul-termination in strings. For references to opaque objects hidden behind the curtain, report a zero size. Signed-off-by: Carlos Falgueras García <carlosfg@riseup.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: check for strdup() errors from setters and parsersPablo Neira Ayuso2016-06-151-0/+4
| | | | | | And pass up an error to the caller. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* libnftnl: constify object arguments to various functionsPatrick McHardy2016-05-091-5/+5
| | | | | | | | | flow table support needs constant object arguments to printing functions to avoid ugly casts. While at it, also constify object arguments to message construction, destructor and a few helper functions. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* libnftnl: allow any set name lengthPablo Neira Ayuso2016-05-051-8/+12
| | | | | | | | Unfortunately libnftnl restricts the set names in the lookup and dynset expressions to 16 bytes. Remove this restriction so this can work with the upcoming 4.7 Linux kernel. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: rename nftnl_rule_expr to nftnl_exprPablo Neira Ayuso2015-09-071-38/+38
| | | | | | | Use a shorter name for this, morever this can be used from sets so the _rule_ is misleading. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* src: rename existing functions to use the nftnl_ prefixPablo Neira Ayuso2015-09-071-109/+109
| | | | | | | | | So we can use the nft_* prefix anytime soon for our upcoming higher level library. After this patch, the nft_* symbols become an alias of the nftnl_* symbols. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* dynset: support expression templatesPatrick McHardy2015-04-141-0/+38
| | | | | | | Support expression templates for the dynset expression for dynamic expression instantiation. Signed-off-by: Patrick McHardy <kaber@trash.net>
* expr: dynset: fix json/xml parsingArturo Borrero Gonzalez2015-04-131-14/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expr/dynset.c: In function 'nft_rule_expr_dynset_json_parse': expr/dynset.c:194:3: warning: implicit declaration of function 'nft_rule_expr_dynset_str' [-Wimplicit-function-declaration] nft_rule_expr_dynset_str(e, NFT_EXPR_DYNSET_SET, set_name); ^ expr/dynset.c:194:31: error: 'NFT_EXPR_DYNSET_SET' undeclared (first use in this function) nft_rule_expr_dynset_str(e, NFT_EXPR_DYNSET_SET, set_name); ^ expr/dynset.c:194:31: note: each undeclared identifier is reported only once for each function it appears in expr/dynset.c:197:3: warning: implicit declaration of function 'nft_rule_expr_dynset_u32' [-Wimplicit-function-declaration] nft_rule_expr_dynset_u32(e, NFT_EXPR_DYNSET_SREG, sreg); ^ expr/dynset.c:197:31: error: 'NFT_EXPR_DYNSET_SREG' undeclared (first use in this function) nft_rule_expr_dynset_u32(e, NFT_EXPR_DYNSET_SREG, sreg); ^ expr/dynset.c:200:31: error: 'NFT_EXPR_DYNSET_DREG' undeclared (first use in this function) nft_rule_expr_dynset_u32(e, NFT_EXPR_DYNSET_DREG, dreg); ^ expr/dynset.c: In function 'nft_rule_expr_dynset_xml_parse': expr/dynset.c:220:31: error: 'NFT_EXPR_DYNSET_SET' undeclared (first use in this function) nft_rule_expr_dynset_str(e, NFT_EXPR_DYNSET_SET, set_name); ^ expr/dynset.c:224:31: error: 'NFT_EXPR_DYNSET_SREG' undeclared (first use in this function) nft_rule_expr_dynset_u32(e, NFT_EXPR_DYNSET_SREG, sreg); ^ expr/dynset.c:228:31: error: 'NFT_EXPR_DYNSET_DREG' undeclared (first use in this function) nft_rule_expr_dynset_u32(e, NFT_EXPR_DYNSET_DREG, dreg); ^ Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
* expr: add support for the dynset exprPatrick McHardy2015-04-121-0/+317
Signed-off-by: Patrick McHardy <kaber@trash.net>