Using libnl to create u32 hashkey

Adrian Ban adrian.ban at mantech.ro
Mon Nov 21 16:18:09 EST 2011


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?

Best regards,
Adrian




More information about the libnl mailing list