Using libnl to create u32 hashkey

Thomas Graf tgraf at infradead.org
Tue Nov 22 06:25:32 EST 2011


On Mon, Nov 21, 2011 at 11:18:09PM +0200, Adrian Ban wrote:
> Hi,
> 
> I'm using libnl3 to a little project. My problem is that I didn't
> find any documentation about u32 hashkey filters.
> I want to build something like this:
> 
> $TC filter add dev $DEVin  parent 0x01:0x0000 prio 1 protocol ip u32
> $TC filter add dev $DEVin  parent 0x01:0x0000 prio 1 protocol ip
> handle 1: u32 divisor 256
> 
> $TC filter add dev $DEVin parent 0x01:0x0000 prio 2 protocol ip u32 \
>       match ip dst 0.0.0.0/0 \
>       hashkey mask 0xff000000 at 16 \
>       link 1:
> $TC filter add dev $DEVin parent 0x01:0x0000 prio 1 protocol ip
> handle 2: u32 divisor 256
> $TC filter add dev $DEVin parent 0x01:0x0000 prio 1 protocol ip u32
> ht 1:a: \
>       match ip dst 10.0.0.0/8 \
>       hashkey mask 0x00FF0000 at 16 \
>       link 2:
> $TC filter add dev $DEVin parent 0x01:0x0000 prio 1 protocol ip
> handle 3: u32 divisor 256
> $TC filter add dev $DEVin parent 0x01:0x0000 prio 1 protocol ip u32
> ht 1:2e: \
>       match ip dst 46.0.0.0/8 \
>       hashkey mask 0x00FF0000 at 16 \
>       link 3:
> 
> There is any solution to make such things with libnl?

This is not yet fully implemented. For example there is no function that
would allow setting the divisor yet.



More information about the libnl mailing list