On 04/03/2017 03:40 PM, Mauricio Vasquez via iovisor-dev wrote:
Dear All,

I am trying to inject a BPF_PROG_TYPE_SCHED_ACT program and attach it to the TC 
using C++.

Out of curiosity, why not .._SCHED_CLS program in direct-action mode
(same functionality wrt BPF and would save you additional layers of
indirection in tc at least), or are you required to run something
different as a classifier entity?

I had no particular problems compiling and injecting the program, however I 
haven't been able to attach it to TC, I know that in go I can use the netlink 
library [1] or in python pyroute2 [2], unfortunately it appears not to be a 
similar library in C++

Is there a library that implements this functionality for C or C++? in case of 
negative, does some body have a example code of how to achieve this using the 
netlink protocol?

Not aware of a C++ lib (but I also haven't looked much). You could
check the iproute2 code, f.e. tc/f_bpf.c to set up the nl message.

Thanks in Advance,

Mauricio

[1] https://github.com/vishvananda/netlink

[2] http://docs.pyroute2.org/

_______________________________________________
iovisor-dev mailing list
[email protected]
https://lists.iovisor.org/mailman/listinfo/iovisor-dev

_______________________________________________
iovisor-dev mailing list
[email protected]
https://lists.iovisor.org/mailman/listinfo/iovisor-dev

Reply via email to