python to sniff live traffic.
capture=sniff(iface="<My Interface>", filter="tcp")
But this sniffs each packet and adds it to the list
capture which can be processed later.
I want to process a packet and display few fields of the packet, as soon as it's sniffed. i.e. upon sniffing a packet, it'll trigger a function where I can analyse that packet. And this would continue for few packets.
I've the function ready which I'm using with the captured packet list. But I'm unable to use it for each live packet.
How to achieve that? Is it possible with
scapy or do I need to install any other package?