Hi,<br><br>We need to add support for our device in libpcap, it is a USB device with a custom driver.<br><br><ul><li>I am in the Windows platform & Working with VS2005 (C++)</li><li>I have downloaded WinPcap and compiled the
packet.dll (Though not used) and then wpcap.dll from source successfully </li><li>The build configuration is Debug_REMOTE</li></ul><br>As I was previously educated I wrote my own program with including pcap.h and other <br>
necessary headers for the driver. Within it I gave my device the name "usb_ss7_if". <br>And next I want to call the pcap_open_live() in libpcap.<br><br><span style="font-weight: bold;">What I did In my program</span>
<br>I wrote my own program usb.c in VS2005 in a new project. <br>This had the initialization of the device name and I called pcap_open_live().<br>I linked the wpcap.lib (and other necessary libraries for the driver) in winpcap\wpcap\LIB which is refreshed every time I build wpcap entire solution
<br><br><span style="font-weight: bold;">What I did to Pcap-win32.c</span><br><ul><li>I changed the project properties to include my own preprocesser directive HAVE_USBSS7_API in project window</li><li>I changed the pcap_open_live() in this c file as below
</li></ul><br>pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, char *ebuf)<br>{<br> register pcap_t *p;<br> NetType type;<br><br><br>#ifdef HAVE_REMOTE<br> char host[PCAP_BUF_SIZE + 1];<br>
char port[PCAP_BUF_SIZE + 1];<br> char name[PCAP_BUF_SIZE + 1];<br> int srctype;<br><br><span style="font-weight: bold;">#ifdef HAVE_USBSS7_API</span><br style="font-weight: bold;"><span style="font-weight: bold;">
printf("I am inside the Win32 \n");</span><br style="font-weight: bold;"><span style="font-weight: bold;"> return NULL;</span><br style="font-weight: bold;"><span style="font-weight: bold;">#endif</span><br>
<br>..............................................continued....<br><br>I added my piece of code inside the HAVE_REMOTE because I am using that build configuration. <br>I just want to know when I call pcap_open_live to which program does it get called which has that
<br>routine (In windows)<br><br>I know that the routine gets called since I get an error message when I call pcap_open_live(),<br>But I doubt if it is the routine in Pcap-win32.c<br><br><span style="font-weight: bold;">The error message
</span><br><span style="font-weight: bold;">Error opening adapter: The system cannot find the device specified. (20)</span><br><br>In seeing this message I just changed the occurrence of this statement in pcap-win32.c<br>
<br>if (p->adapter == NULL)<br> {<br> free(p);<br> /* Adapter detected but we are not able to open it. Return failure. */<br> snprintf(ebuf, PCAP_ERRBUF_SIZE, "Error opening adapter <font size="4">
<span style="font-weight: bold;">ss7_usb</span></font>: %s", pcap_win32strerror());<br> return NULL;<br> }<br><br>Just to see if it works .... Unfortunately not:-) the error message stays the same<br><br><br>
The error message is alright cause I have done nothing to open the device,<br>But I want to know from where I get this message. Is it not the <br>Pcap-win32.c in winpcap\libpcap<br><br>Does Pcap-win32.c.orig has anything to do with it ? I didnt mingled with it
<br>since that is not is the project tree. <br><br>Please Help me out with this....<br><br>I have no way out from here!<br><br>Thank you all<br><br>Xavier<br><br><br><br><br><br>