[Winpcap-users] winpcap not capturing anything

Imre Magyar Imre.Magyar at lairdtech.com
Tue Mar 23 14:20:09 PDT 2010


I was under the impression that using -1 will minimize packet reception latency. In any case, I changed it to 1000 but the problem remains. The app works just fine on one PC but fails to capture anything on another. Both interfaces are normal wired interfaces, and both PCs have the same version of winpcap installed.

--IM
________________________________
From: winpcap-users-bounces at winpcap.org [mailto:winpcap-users-bounces at winpcap.org] On Behalf Of Gianluca Varenni
Sent: Monday, March 22, 2010 4:07 PM
To: winpcap-users at winpcap.org
Subject: Re: [Winpcap-users] winpcap not capturing anything

Is there any specific reason why you are putting a read timeout of "-1". I would definitely try with something like 1000 and see if you receive packets in this case.

Have a nice day
GV

From: Imre Magyar<mailto:Imre.Magyar at lairdtech.com>
Sent: Monday, March 22, 2010 1:57 PM
To: winpcap-users at winpcap.org<mailto:winpcap-users at winpcap.org>
Subject: Re: [Winpcap-users] winpcap not capturing anything

It's a standard Ethernet card.

I'm opening the interface as such:

if ( (adhandle= pcap_open(        d->name,    // name of the device
                            1024 * 4,   // max bytes to capture
                            0,            // could be PCAP_OPENFLAG_PROMISCUOUS
                            -1,         // read timeout
                            0,            // auth struct
                            errbuf      // error buffer
                          ) ) == NULL)
    {
        fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name);
        /* Free the device list */
        pcap_freealldevs(alldevs);
        return 0;
    }


Thank-you,

I.M.


From: winpcap-users-bounces at winpcap.org [mailto:winpcap-users-bounces at winpcap.org] On Behalf Of Gianluca Varenni
Sent: Monday, March 22, 2010 3:52 PM
To: winpcap-users at winpcap.org
Subject: Re: [Winpcap-users] winpcap not capturing anything

Are you capturing on a standard ethernet/wireless card?

What parameters are you using with pcap_open?

Have a nice day
GV

From: Imre Magyar<mailto:Imre.Magyar at lairdtech.com>
Sent: Sunday, March 21, 2010 6:24 AM
To: winpcap-users at winpcap.org<mailto:winpcap-users at winpcap.org>
Subject: [Winpcap-users] winpcap not capturing anything

Hello all,

I've spent a couple weeks trying to figure this out on my own, but to no avail and no amount of searching seems to help me find answers, so I'm hoping somebody out there can help.

I have a Windows .Net application that uses multiple managed Visual C++ DLLs, one of which interfaces to winpcap. The program model is fairly simple; upon entry to the DLL I open the interface with pcap_open(), spawn a separate thread to repeatedly call pcap_next_ex() while the main thread returns to managed context to continue the main application thread.

The problem is that pcap_next_ex() never manages to see a single packet. Running wireshark on the same interface simultaneously verifies that the packets are on the wire, but I never see a single one.

But it gets stranger, because everything works fine on some Windows PCs (all running XP) yet this happens reliably on others.

If I take the DLL code and change it such that it's run as a standard standalone WIN32 application, everything works perfectly, so I think that the problem isn't winpcap itself, just something having to do with the .net application contexts.

So at the risk of asking about something that is obvious to everyone else, could someone please help me with some ideas as to what's going on?

Thank-you!

--Imre M.

________________________________
_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
________________________________
_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20100323/90e40bde/attachment.htm 


More information about the Winpcap-users mailing list