All of lore.kernel.org
 help / color / mirror / Atom feed
* nftables type for ipv4_addr -> packetmark map?
@ 2015-04-24 17:25 Miroslav Kratochvil
  0 siblings, 0 replies; only message in thread
From: Miroslav Kratochvil @ 2015-04-24 17:25 UTC (permalink / raw)
  To: netfilter

Hello list,

this is (probably) a very simple user question so if there's already a
solution available elsewhere, don't hesitate to send me RTFM with a
link or so.

The problem statement is really simple - I've been trying to create a
permanent, "named" map/dict using nftables that would be usuable for
similar marking like from this example:

# nft mangle output mark set ip saddr map {  192.168.0.0/24 : 0x1,
192.168.1.0-192.168.1.64 : 0x2, 192.168.2.1 : 0x3 }

Creating the map as any persistent object fails, because I'm unable to
find the name of the mapping type from documentation. So, for example,
this (packetmark type name taken from manpage) fails:

 # nft add map mangle mydict { type ipv4_addr : packetmark\; }
<cmdline>:1:42-51: Error: unknown datatype packetmark
<cmdline>:1:23-52: Error: map definition does not specify key data type

From nftables sources, it would be obvious to use "mark" type as
defined in `nftables/src/datatype.c' line ~687:

 # nft add map mangle mydict { type ipv4_addr : mark\; }
<cmdline>:1:42-45: Error: syntax error, unexpected mark, expecting string
<cmdline>:1:23-46: Error: map definition does not specify key data type

...seems a bit like quoting/keyword conflict parsing-related issue to
me, but that's a wild guess. What then is the correct datatype name
for ipv4_addr -> mark map?

Thanks in advance for any help.

-mk

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-24 17:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-24 17:25 nftables type for ipv4_addr -> packetmark map? Miroslav Kratochvil

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.