libbpf attaching a raw socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I looked in the samples and header files, but could not find an
example for this. How does one convert this from bcc to libbpf. This
is the userspace code.

bpf = BPF(src_file = "socket_filter.c", debug=0)
socket_filter = bpf.load_func("socket_filter", BPF.SOCKET_FILTER)
BPF.attach_raw_socket(socket_filter, "eth2")
socket_fd = socket_filter.sock

I can do the following to set the type:

err = bpf_program__set_socket_filter(obj);

Is there any sample I can follow or any header files where I can look
for attaching a socket to the bpf code.

Thanks
Mohan



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux