All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nft,RFC,PoC 0/2] typeof support for set / map
@ 2019-07-30 14:16 Pablo Neira Ayuso
  2019-07-30 14:16 ` [PATCH nft,RFC,PoC 1/2] parser: add typeof keyword for declarations Pablo Neira Ayuso
  2019-07-30 14:16 ` [PATCH nft,RFC,PoC 2/2] src: restore typeof datatype when listing set definition Pablo Neira Ayuso
  0 siblings, 2 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2019-07-30 14:16 UTC (permalink / raw)
  To: netfilter-devel; +Cc: fw, bmastbergen

Hi,

One topic that keeps coming back and forth is support for using integers
from the set / map definitions, see:

https://patchwork.ozlabs.org/patch/1089728/

The following example shows how PoC/RFC patchset works:

# cat test.nft
table filter {
            set blacklist {
                    typeof ip saddr
            }

            chain input {
                    ip saddr @blacklist counter drop
            }
    }
# nft -f test.nft
# nft list ruleset
table ip filter {
        set blacklist {
                typeof ip saddr
        }

        chain input {
                ip saddr @blacklist counter packets 0 bytes 0 drop
        }
}

This patchset provides a proof-of-concept, it's a quick hack, I dislike
to deliver things in a raw shape like this, but anyway...

Support for concatenations and object maps are missing. The
representation of the expression into the TLV still needs to be defined
(it could be a structure whose first field specifies the expression
type and an union with the specific fields for this expression,
encapsulated in the TLV).

Pablo Neira Ayuso (2):
  parser: add typeof keyword for declarations
  src: restore typeof datatype when listing set definition

 include/rule.h     |  3 +++
 src/mnl.c          | 27 +++++++++++++++++++++++++++
 src/netlink.c      |  9 ++++++++-
 src/parser_bison.y | 20 ++++++++++++++++++++
 src/rule.c         |  9 +++++++--
 src/scanner.l      |  1 +
 6 files changed, 66 insertions(+), 3 deletions(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-30 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 14:16 [PATCH nft,RFC,PoC 0/2] typeof support for set / map Pablo Neira Ayuso
2019-07-30 14:16 ` [PATCH nft,RFC,PoC 1/2] parser: add typeof keyword for declarations Pablo Neira Ayuso
2019-07-30 14:16 ` [PATCH nft,RFC,PoC 2/2] src: restore typeof datatype when listing set definition Pablo Neira Ayuso
2019-07-30 14:41   ` Florian Westphal
2019-07-30 14:48     ` Pablo Neira Ayuso
2019-07-30 14:56       ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.