From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

WinPCAP for LabView v 0.1 alpha

Hey folks,

Attached is my work to-date on a wrapper for WinPCAP to be used in LabView. Contained in the attachment is the *.vi file, the DLL and the source files for the DLL.

This still requires WinPCAP to be loaded on your machine in order to run. You can get WinPCAP here at: http://www.winpcap.org/

The DLL was compiled using gcc under MinGW, and does not (I believe) require anything extra to run. If you encounter a problem, please let me know.

Right now this project is in a very early stage. Reading packets may not work and will always cause a fatal (to Labview) memory error after a short time running. I have a solution in mind, and hope to have it in place very soon. Findalldevs_ex() works reliably, although it is probably not very useful for any application you might have in mind presently.

Eventually, it's my hope to implement all of the WinPCAP API calls in some LabView-accessible form.
Message 1 of 36
(15,003 Views)
This update resolves the instability problem by using fixed-length 255 character arrays.

It is possible they need to be longer for packet reads-and-writes.

My next update will add more hooks to the PCAP API, add error handling, and incorporate any change requests.


Message 2 of 36
(14,950 Views)
A few fixes to the weekend release:

- Expanded packet reserved memory to 65535 bytes; which is equal to the maximum packet size reported on ethereal-dev in 1999.
- Also fixed a bug in the *.vi that caused the timed loop to stop after the first pass instead of continue looping.


Message Edited by jh_mclellan on 04-11-2006 08:06 AM

Message 3 of 36
(14,914 Views)

The lack of responses does not mean that people are not interested.
You may have noticed the 5 star ratings on your posts. These should tell you that people think this is a worth while project.

I would strongly suggest that you post this to the LAVA forums as well, because it has a lot less traffic and some of the users there are very advanced. An email to the info LabVIEW mailing list with a link to the wrapper should also help in letting people know about this. Eventually, if it works out OK, you might want to try releasing it as an OpenG package. One last thing - if possible, post the next versions for 7.0 and you will have even more people who will be able to test it. Keep it up!


___________________
Try to take over the world!
Message 4 of 36
(14,898 Views)


@jh_mclellan wrote:
A few fixes to the weekend release:

- Expanded packet reserved memory to 65535 bytes; which is equal to the maximum packet size reported on ethereal-dev in 1999.
- Also fixed a bug in the *.vi that caused the timed loop to stop after the first pass instead of continue looping.

Message Edited by jh_mclellan on 04-11-2006 08:06 AM


Since you are creating a LabVIEW DLL wrapper anyhow it would be a good idea to place some of the LabVIEW array resizing and allocation into that DLL too. This makes the LabVIEW code more simple and allows to manage memory more efficiently. You would then include the LabVIEW extcode.h file and use memory manager functions of LabVIEW in your DLL  (and link to labview.lib too).

I might try to have a go at this sometimes but at the moment I'm swamped with other work.

Rolf Kalbermatter

Message Edited by rolfk on 04-11-2006 03:42 PM

Rolf Kalbermatter
My Blog
Message 5 of 36
(14,895 Views)
Hello
Although I know this post is in the LV forum, I'll ask this question anyway, hoping that someone could help me.  I'm trying to use the winpcap library with CVI.  Is there any way to do this without wrapping this dll into an other dll that can be used by the CVI compiler.  When I try to compile it with CVI I get some errors because CVI looks for h files that are packed with VC.
Thanks a lot
Carlos Arcediano del Amo
0 Kudos
Message 6 of 36
(14,833 Views)
Hi, Carlos.

Can you tell me a little more about the missing h files? By "VC," do you mean Visual C++? If so, it sounds like you'll just need to put those h files in the appropriate directory.

If I'm misunderstanding you or you're still having problems, let me know. Have a nice afternoon!
Sarah K.
Search PME
National Instruments
0 Kudos
Message 7 of 36
(14,804 Views)
jh - This is awesome!  I need to play around with it more, but good work here.  I'd been wanting to do the same thing a while back.

You rock,
berto
0 Kudos
Message 8 of 36
(14,783 Views)
Hello, Sarah

The .h file is the fcntl.h. 
Yes, I mean Visual C++ 6.0.
The main problem is that I hadn't VC installed (now I have it, and I use it to do the encapsulation).  I would like to compile my CVI application without using the VC++.  Is it possible?  Has anyone achieved this goal?

Thank you very much
Carlos Arcediano del Amo
0 Kudos
Message 9 of 36
(14,746 Views)
Rolfk-

Thanks for the suggestions. They aren't in this latest version. However, I'm going to take a crack at them next time I have a free weekend (instead of a few spare hours).

-James
0 Kudos
Message 10 of 36
(14,704 Views)