On Sat, Jul 07, 2018 at 09:18:44PM +0200, spyff wrote:
>  
> 
> Hi! 
> 
> There is multiple options to attach a BPF program (BPF.attach_kprobe(),
> BPF.attach_uprobe(), etc) but currently possible to attach BPF program
> to socket with the BCC python frontend?

There's a BPF.attach_raw_socket method to help you with that.  For examples,
see https://github.com/iovisor/bcc/tree/master/examples/networking/http_filter,
https://github.com/iovisor/bcc/tree/master/examples/networking/vlan_filter,
and 
https://github.com/iovisor/bcc/blob/master/examples/networking/dns_matching/dns_matching.py.

> In C its easy with setsockopt SO_ATTACH_BPF but I'm not sure if its
> supported in BCC python. 
> 
> Thanks,
> Ferenc

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#1363): https://lists.iovisor.org/g/iovisor-dev/message/1363
Mute This Topic: https://lists.iovisor.org/mt/23184759/21656
Group Owner: [email protected]
Unsubscribe: https://lists.iovisor.org/g/iovisor-dev/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to