Reading from the Ethernet card.
Hello to all.
I'm developing a simple sniffer using, for now, the library set: libpcap. I'm using this functions to open the socket for reading.
This is working fine, but the problem is that my PC has two interface cards (eth0 and eth1). I would like to choose the card I want to sniff and function pcap_lookupdev() only returns the first one it finds to be up.
/*Find the Ethernet interface*/
dev = pcap_lookupdev(errbuf));
/*Show the interface name found*/
printf("Reading from: %s\n",dev);
/* Open the socket to read only Ethernet frames*/
/* Associate the socket to the interface found */
Is there another way to achieve this?