Is there any way to get interface statistics using bpf. More specifically im looking for getting virtual interface stats using bpf.
I know it can be done using iptable chain but i want to do it specifically with bpf.
Thanks
Update : Iamable to get count of TCP , UDP and ICMP packets separately. I want to know in_octets , out_octets , in_pkts and out_pkts count now.