Re: [tcpdump-workers] Libpcap - pcapfindalldevs

2009-09-05 Thread Johan Mazel
Ok. Thanks a lot for the explanation. Regards. Johan Mazel 2009/9/4 Guy Harris > > On Sep 4, 2009, at 8:45 AM, Johan Mazel wrote: > > I wrote a short piece of code in C to show the problem. >> >> My code is the following one: >> *#include >> #include >> >> int main(){ >> struct pcap_if * fo

Re: [tcpdump-workers] Libpcap - pcapfindalldevs

2009-09-04 Thread Guy Harris
On Sep 4, 2009, at 8:45 AM, Johan Mazel wrote: I wrote a short piece of code in C to show the problem. My code is the following one: *#include #include int main(){ struct pcap_if * found_devices; int result; char * errbuf; printf("Scanning\n"); result = pcap_findalldevs(&foun

Re: [tcpdump-workers] Libpcap - pcapfindalldevs

2009-09-04 Thread Johan Mazel
Sorry for the second mail Correction : My machine runs on Ubuntu 9.04. My libpcap version is 1.0.0-1. Johan Mazel 2009/9/4 Johan Mazel > I wrote a short piece of code in C to show the problem. > > My code is the following one: > *#include > #include > > int main(){ > struct pcap_if * fou

Re: [tcpdump-workers] Libpcap - pcapfindalldevs

2009-09-04 Thread Johan Mazel
I wrote a short piece of code in C to show the problem. My code is the following one: *#include #include int main(){ struct pcap_if * found_devices; int result; char * errbuf; printf("Scanning\n"); result = pcap_findalldevs(&found_devices, errbuf); printf("Scan finished\

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