Hi all,<br><br>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:
<br><br>if((adhandle = pcap_open(d->name, // name of the device<br> 65536, // portion of the packet to capture. <br> // 65536 grants that the whole packet will be captured on every link layer.
<br> 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<br> PCAP_OPENFLAG_NOCAPTURE_LOCAL |
<br> PCAP_OPENFLAG_MAX_RESPONSIVENESS,<br> 500, // read timeout<br> NULL, // remote authentication<br> errbuf // error buffer<br> )) == NULL)
<br>{<br> fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name);<br> /* Free the device list */<br> pcap_freealldevs(alldevs);<br> return -1;<br>}<br><br>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.
<br><br>Any help to make the PCAP_OPENFLAG_NOCAPTURE_LOCAL flag work on win 2000 would be appreciated.<br><br>Regards,<br><br>Larry<br>