libnl api to add Src/Dst Port and fwmark as TC filter to a class

Thomas Haller thaller at redhat.com
Fri Apr 22 08:09:00 PDT 2016


On Wed, 2016-04-20 at 19:53 +0530, Sunil Vasanta wrote:
> Hi All,
> 
> I'm able to add source IP, Destination IP and protocol as filter to 
> Qdisc classing using libnl API's.
> 
> rtnl_u32_add_key_uint32(cls, n,  0xffffffff,12, 0);
>         rtnl_u32_add_key_uint32(cls, n,  0xffffffff,16, 0);
>         rtnl_u32_add_key_uint8(cls, 6,  0xff,9, 0);
> 
> But unable to find documentation or any pointer to add source PORT, 
> Destination PORT and fwmark as filter to classify packet in to Qdisc.
> 
> *Can any share some pointer or details on how to add source port, 
> destination port and fwmark as filter.
> *
> 

Hi,


Sorry, I don't know the answer to this.

Is it already clear what exactly you want to configure?

I would first try to configure it via `iproute2` and in a second step
see how I can achieve the same thing programatically (using libnl).

The man pages from iproute2 for tc, tc-u32, etc. got improved recently.
I would check out the newest version and read it there:
  git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git


Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20160422/fd1fe6a5/attachment.sig>


More information about the libnl mailing list