05-24-2017 12:57 PM
The version posted 06-24-2016 which has 'timeouts' doesn't work correctly. Turns out that the pcap timeout functions don't really work on windows machines.
10-19-2017 06:55 AM
I have a new version of this that:
- does correctly have timeouts
- uses eclipse/mingw to compile the dll
- and also has much much better performance (i was forgetting to set the winpcap buffer size... oops)
I will try and get around to posting it at some point, I've got to clean it up to remove some proprietary bits at whatnot.
07-30-2018 04:52 AM
Hello.
Please, can you share with me with the new version of code, which includes timeouts.
Thank you.
03-27-2020 06:26 AM - edited 03-27-2020 06:50 AM
Hi there.
Because I needed this DLL for LabView 64 bit, I made some small modifications (the pointers "pcap" have to changed to uInt64 or better to uintptr_t in the VIs) and used the actual NPCAP SDK for the build.
It is build with VS 2019 and the latest SDK and WDK.
I also added the pcap_set_buffer_size function as an extra function in the DLL.
You need to install the latest NPCAP for this, with winpcap API compabilty...
Example for buffer size:
BR
Marcus
05-14-2020 12:35 PM
Hi Marcus,
This is great, thank you.
I installed the last version of wireshark (which includes the last version of npcap), enable the winpcap API compatibility mode, change the VIs to call your dll, and change all the pcap handles.
It doesn't work for me.
As an example with your dll I get 1 interfaces + 2 dummy interfaces, whereas with the previous one I got 6 (which is the good value).
Are the pointers "pcap" the only thing you changed in the wrappers VIs ?
What is your version of npcap ?
Would it be possible for you to share your updated VIs ?
Did you include the last jjjcjj modifications (not included in his last posted DLL) ? :
""-does correctly have timeouts
- and also has much much better performance (i was forgetting to set the winpcap buffer size... oops)""
Thanks,
05-14-2020 01:52 PM
Sorry, I never got around to posting it and I since left the job that I had all the source code at.
The buffer size is just some winpcap library function call you have to make. I don't remeber it off hand but its something you should be able to look up. I /think/ it might just be this: https://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#ga124bde25ccd9e39017ff2abec2dda623
I don't remember what I did to make the timeouts work. I don't recall whether I found a workaround or implemented it myself with busy waits.
05-14-2020 03:03 PM
Sorry I'm late to the game. Could you catch me up on why you are trying to use WinPcap?
05-14-2020 04:57 PM
- Promiscuous packet capture
- Considerably higher packet rate and total throughput than the built in function
- The relatively easy ability to offload some low level manipulation to C (i.e. proprietary de-interleaving of data)
- The ability to combine packets in C, lowering the loop rate that labview has to run at.
05-15-2020 01:27 AM - edited 05-15-2020 01:32 AM
I must be half asleep. The original post didn't make much sense. (Deleted.)
05-15-2020 03:09 AM - edited 05-15-2020 03:10 AM
Hi Sébastien.
In the attachment you find the complete directory modificated in that way, that the Packet Sniffer ecample works in 64bit.
All the other SubVis, that are not needed for this example, I did not touch but could be modified in the same way I guess.
My version of npcap is 0.9989 but as the API does not change (WinAPI compatible) there is no need for a special version.
I only changed the pointer-size, yes.
You can change the buffer-size, but it is not nesccary, because the default value works pretty well here. The timeouts I did not change.
You can try the example (I ripped all the filter and displaying off for speed, but could also work with).
Anyway, I decide to use the built-in UDP VI from LabView and rebuild the ethernet header for myself and write this to a pcap file (with the pcap-vis here), because I don't need the exact time-stamps and I don't need to filter the stream afterwards.
BR
Marcus