On Thu, Apr 25, 2002 at 11:20:32PM +0200, Floris 'Tamama' van Gog wrote:
> However i get the following response:
> 
> $ ./testapp.exe
> Error opening device. (no suitable device found)
> 
> when forcing the device to rl0 (my ethernet card) i get:
> 
> $ ./testapp.exe
> Device: rl0
> could not open 'rl0'
> 
> Any insight on how to solve this would be appreciated.

Step 1 would be to have the application report the *reason* why it
couldn't open the device:

        // dev="rl0";
         printf("Device: %s\n", dev);
            handle = pcap_open_live(dev, BUFSIZ, 1, 0, errbuf);
        
         if (!handle)
          {
          printf("could not open '%s': %s\n",dev, errbuf);
          return 2;
          }

although I suspect the reason is "you're not running it as root, and you
don't have read access to the '/dev/bpf' devices".

UNIXes generally require special privileges to capture packets.  Some
UNIXes allow only the super-user to do so.  The BSDs allow anybody who
can open the "/dev/bpf" devices, such as "/dev/bpf0", for reading to do
so.

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to