[Winpcap-users] Problems With Newly compiled Winpcap/Libpcap
Varuna De Silva
varunax at gmail.com
Mon Oct 8 12:17:35 GMT 2007
Hello,
We have had several problems when trying to integrate our device
with wireshark on windows. The following are the changes we made
to the source tree of Libpcap
We have done the following changes to fad-win32
int
pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
{
....
if (ret != -1) {
/*
* We haven't had any errors yet; do any platform-specific
* operations to add devices.
*/
if (pcap_platform_finddevs(&devlist, errbuf) < 0)
ret = -1;
}
.....
This comes just before.
if (ret == -1) {
/*
* We had an error; free the list we've been constructing.
*/
if (devlist != NULL) {
pcap_freealldevs(devlist);
devlist = NULL;
}
}
Then we did the change to pcap-win32 as following..
We added a pacp_find_devs() function in to it. As following
int
pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
{
#ifdef HAVE_USB
if (muwis_platform_finddevs(alldevsp, errbuf) < 0)
return (-1);
#endif /* HAVE_USB */
return (0);
}
and in our pcap-muwis.c file we have a function like below
int
muwis_platform_finddevs(pcap_if_t **devlistp, char *errbuf)
{
const char description[512]= "MUWIS";
char name[512]="muwis" ;
int ret = 0;
if (pcap_add_if(devlistp, name, 0, description, errbuf) < 0){
/*
* Failure.
*/
ret = -1;
}
return (ret);
}
and in the pacp_open_live() we added code to accept our device as following
#ifdef HAVE_USB
if (strstr(device, "muwis")) {
return muwis_open_live(device, snaplen, promisc, to_ms, ebuf);
}
#endif
This is just after, #ifdef HAVE_REMOTE ..... #endif Block.
This muwis_open_live() just fills the pcap_t structure and
opens our device.
When we run wireshark with our own wpcap.dll when our device is
attached to the USB port, and when we try to start our capture,
through capture->interfaces, in windows we get an error saying
'dumpcap needs to be closed', and there after we cannot see any
device in the interfaces list.
What is this dumpcap ? Or why this is the problem that we face?
Please tell us of any experiences?
As I found out dumpcap is a program to get the network packets.
But why does it crashes when I have set my device to be opened
in muwis_open_live() function.
Thanks
Varuna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20071008/0d517680/attachment.htm
More information about the Winpcap-users
mailing list