Question Locked

Why won't libpcap find my device?

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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!

1 reply

This discussion is closed to new replies.