Using libnl to create u32 hashkey
Adrian Ban
adrian.ban at mantech.ro
Wed Nov 23 19:01:31 EST 2011
Ups .. I've already found a little bug:
hash mask ff000000 at 0
vs
hash mask ff000000 at 16
Seems that the offset for the hash mask doesn't work correctly. I'll
check this tomorrow and I'll return with a feedback :).
Regards,
Adrian
On 11/22/2011 1:25 PM, Thomas Graf wrote:
> 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