Re: [tcpdump-workers] Libpcap - pcapfindalldevs

2009-02-02 Thread Guy Harris
On Feb 2, 2009, at 5:39 AM, Johan Mazel wrote: My problem is that when I'm not running the program as root, I got the "Erreur de bus" in French (or "Bus Error" in english I guess) and my program suddenly stops. That is either a bug in your program, a bug in libpcap, or a bug in some othe

Re: [tcpdump-workers] Libpcap - pcapfindalldevs

2009-02-02 Thread Johan Mazel
Hi The problem is during the execution of the pcap_findalldevs command. As I explained it (maybe not clearly enough), I can't get the return code of this command, the program simply crash without seding a return code. I know that for sure because I tried to do like this: cout << "test" << endl; re

Re: [tcpdump-workers] Libpcap - pcapfindalldevs

2009-02-02 Thread Benoit
Yeah this is true, however you could try a simple loop on the interface, If there are NULL you must run as root. /* Retrieve the device list on the local machine */ if (pcap_findalldevs(&alldevs, errbuf) == -1) { printf("Error in pcap_findalldevs: %s\n", errbuf); return -1;

[tcpdump-workers] Libpcap - pcapfindalldevs

2009-02-02 Thread Johan Mazel
Hi I'm trying to use pcap_findalldevs in order to scan the device available on my host to capture. My code (in C++) looks like that: result = pcap_findalldevs(&found_devices, errbuf); if(result < 0) { FindAllDevsException myFindAllDevsException(errbuf); cout << "Scan error" << endl