libpcap problems

rufelt

Registered
Hi,

I'm trying to make a c program using libpcap, but pcap_lookupdev() returns a "no suitable device found" error. I don't think that the problem is in my program, since "tcpdump" in "/usr/sbin" gives me the same error.
I've tried on an iMac and on a blue and white G3, both which have MacOS X 10.1.5 installed on them.

I read somewhere that there might be a problem with libpcap on MacOS X, so I've tried to find a newer version of libpcap on the internet but I havent found any. I've found the source code at apples developer site, but it won't build, the configure script says "installation or configuration problem: C compiler cannot create executables".

Anyone has any idea on how to make libpcap work, how to make the source build, or where I can find a newer binary? =)

Thanks,
/Erik
 
You need superuser privileges in order to use libpcap or tcpdump. This means you'll have to run your program (and tcpdump) using sudo. I suppose another solution is to muck with the permissions on /dev/bpf, but I wouldn't recommend it.
 
Hi,

Thanks for the reply, though unfotunately that's not the problem, I'm doing everything as root =)

/Erik
 
Back
Top