Why won't libpcap find my device? - TechRepublic
Question
May 1, 2011 at 01:28 PM
sanks4545

Why won’t libpcap find my device?

by sanks4545 . Updated 15 years, 2 months ago

Hello,

I have just started using libpcap, the C library for network monitoring but it won’t even recognize my device!

#include stdio.h
#include pcap.h

int main(int argc, char *argv[])
{
char *dev, errbuf[PCAP_ERRBUF_SIZE];

dev = pcap_lookupdev(errbuf);
if (dev == NULL) {
fprintf(stderr, “Couldn’t find default device: %s\n”, errbuf);
return(2);
}
printf(“Device: %s\n”, dev);
return(0);
}

Any hints? I have both an ethernet jack and a wireless card (Using a macbook pro late 2010)

Many Thanks!

This discussion is locked

All Comments