annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

load a .pcap file

Hi All,

 

I want to load a wireshark trace, process it and dump out the required details.  I was using wireshark to do this but since I discovered sequencing issues that wireshark cannot handle, I though the easiest way to do this would be to use labVIEW.

 

I was looking through the example on winpcap but it doesn't show how to load a file.  

 

Rather than reinvent the wheel, does anyone know if there is a way to load pcap files into LabVIEW?

 

Ciao,

Seán

 

 

0 Compliments
Message 1 sur 14
10 796 Visites

Basically you will have to edit the CPP source code and add a new function lvwpcap_open_capturefile() or something similar which works similar to lvwpcap_open_interface() but instead of calling in there pcap_open_live() it would call pcap_open_offline() from the pcap library. Then create a new DLL from that and write a wrapper VI to call this new function.

0 Compliments
Message 2 sur 14
10 786 Visites

Thanks RPE,

 

However, as far as I can see, the source files are not included:

 

http://www.ni.com/example/27660/en/

 

Rgds,

S

0 Compliments
Message 3 sur 14
10 772 Visites

Well, the lvwpcap.cpp is. That is the important one. You'll have to decide what C compiler you're gonna use and create the according DLL project for it.

Message 4 sur 14
10 763 Visites

Oops! Just found  lvwpcap.cpp

 

I'll try your recommendation later when I get a chance.

 

In the meantime, I was trying to parse a pcap file

 

The first 46bytes apepars similar to that shown below:

 

AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA 1231 3C0A ABCD

 

 

I have blanked the first 40 bytes, (time stamp ?).  Following this, (bytes 41-43), what I expected to be the MAC address : 

Actual MAC address: 1231 3C0D ABCD

(ABCD inserted for security)

 

However, the Actual MAC address is 1231 3C0D ABCD which is strange and something I cannot explain.  I didn't glean much from the manual either.

 

The good news is the data payload matches, (at least on the first packet I tried).  This means I should be able to strip out the interesting packets and create a new pcap file.  

 

Still don't understand why the MAC addresses do not match but this is probably a winpcap question...

 

 

0 Compliments
Message 5 sur 14
10 755 Visites

If you read a binary file you shouldn't use the Read Text File node but rather the Read Binary File node. And if you use the Read Text File node anyways you should at least disable "convert end of line" mode on it!

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 6 sur 14
10 749 Visites

Doh!

 

Thanks rolfk, mystery solved.  Now reading 1231 3C0D ABCD

 

Rgds,

Seán

0 Compliments
Message 7 sur 14
10 743 Visites

 Did you have any success at all loading a .pcap file into Labview using the .cpp method ? I'm currently looking at doing the same using recorded LIDAR data in .pcap format but haven't had any luck myself.

0 Compliments
Message 8 sur 14
10 505 Visites

You migth want to check this out:

 

http://www.kroosec.com/2012/10/a-look-at-pcap-file-format.html

 

It appears to be pretty much step-by-step instructions on how to parse these files.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 9 sur 14
10 495 Visites

Dear sir,

If Have Edited lvwpcap.cpp file for offline data capure..plz attach to us so that it will be great help to us...

 

 

Thanks & regargs,

Muniraju

0 Compliments
Message 10 sur 14
10 392 Visites