[Winpcap-users] winpcap and ip change

Fish" (David B. Trout fish at infidels.org
Thu Sep 23 14:35:52 PDT 2010


Thorsten Stoffregen wrote:

[...]
> I found the following solution:
> Close and reopen the capture device with pcap:
> 
> pcap_close(pcap_t ...);
> changeIp(.....);
> Sleep(5000);
> pcap_open(pcap_t ...);
> 
> But now I have to wait several seconds between close and open!
> Without the Waiting it will not work, wait for 5 seconds
> and it works. So it's a solution, but waiting for 5 seconds....
> Seems not a very good solution for me.

May open a new capture BEFORE you change the IP and read from BOTH streams during that 5 second period?

Then once the 5 seconds have passed, close the original stream and continue reading from only the new stream?

Or maybe there's a way to change the IP address of the adapter WITHOUT using netsh? (Maybe there's a command (OID?) you can send to the adapter to assign a new IP without disabling/re-enabling (unbinding/rebinding) the adapter (which is what I believe netsh is probably doing))??  I haven't looked but there might be something better than netsh.

<shrug>

-- 
"Fish" (David B. Trout) 
 fish at softdevlabs.com






More information about the Winpcap-users mailing list