[Winpcap-users] Problem with PCAP_OPENFLAG_NOCAPTURE_LOCAL on windows 2000

Larry Leo leo0888 at gmail.com
Mon Sep 10 22:13:54 GMT 2007


Hi all,

I am having problem using pcap_open() with PCAP_OPENFLAG_NOCAPTURE_LOCAL on
windows 2000.  I  modified basic_dump.c with code from sendpack.c to send
100 bytes to the selected network adapter, but used pcap_open() (from
userlevelbridge) instead of pcap_open_live().  I resulted exe works on win
xp but not on win 2000. I compiled on cygwin and verified using ethereal to
capture the packet.  The pcap_open code from userlevelbridge is:

if((adhandle = pcap_open(d->name,    // name of the device
             65536,        // portion of the packet to capture.
                    // 65536 grants that the whole packet will be captured
on every link layer.
             PCAP_OPENFLAG_PROMISCUOUS |    // flags. We specify that we
don't want to capture loopback packets, and that the driver should deliver
us the packets as fast as possible
             PCAP_OPENFLAG_NOCAPTURE_LOCAL |
             PCAP_OPENFLAG_MAX_RESPONSIVENESS,
             500,        // read timeout
             NULL,        // remote authentication
             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 -1;
}

If I commented out the PCAP_OPENFLAG_NOCAPTURE_LOCAL flag, then it would
work on both win XP and 2000 platforms, but the packet is looped back.

Any help to make the PCAP_OPENFLAG_NOCAPTURE_LOCAL flag work on win 2000
would be appreciated.

Regards,

Larry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20070910/ad9556e9/attachment.htm


More information about the Winpcap-users mailing list