[Winpcap-users] Pcap_open locks

Jos Groot jos.groot at rfx-solutions.nl
Tue Mar 20 16:28:56 UTC 2018


Hi,

I tried this example for opening an adapter and capturing packets:

https://www.winpcap.org/docs/docs_412/html/group__wpcap__tut3.html

It prints the adapter list but after that pcap_open does not
return and locks Matlab. I have to quit and restart Matlab to continue.

If I do not pass the correct devicename to pcap_open but
something like "dummy", I get the correct error message.

Windump and WireShark function perfectly, so the installed WinPcap 4.1.3
is o.k.

I use Microsoft Windows SDK 7.1 (C) and compile in Matlab with:

mex -I.\WinPcap_developers_pack\Include 
.\WinPcap_developers_pack\Lib\x64\wpcap.lib ReadPackets.c

The defines and includes are:

#define WIN32 // otherwise the Unix branch is selected in pcap.h
#define HAVE_REMOTE // needed according to Q-23 of the WinPcap FAQ

#include "mex.h" // needed for Matlab
#include "pcap.h" // straight from this WinPcap example

Any ideas?

Thanks,
Jos





More information about the Winpcap-users mailing list