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: 

packet sniffer example - how to save as .pcap files?

I have downloaded the packet sniffer example from here. In the program "raw data" was the output exactly required. I have to save this data as a log file in .pcap format suitable to open in Ethereal for debugging purpose.

 

I don't know how to save that raw data in a file with extension .pcap

 

All suggestions are appreciated.

 

Thanks a lot,

Mathan

Message 1 of 12
(8,602 Views)

Hi mathan,

in this link http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html you can see the description of this format.

 

Mike

Message 2 of 12
(8,599 Views)

Dear Mike,

 

Thanks a lot for that link. Got more informations from it.

 

But in our program, the raw data itself is coming in the required format including ipheader.....everything.......

 

From LabVIEW i can save the data in a text file. But Ethereal can parse only .pcap file. Hence i need something that converts text to .pcap file.

 

Thanks,

Mathan

0 Kudos
Message 3 of 12
(8,580 Views)

Dear Mike,

 

I found one utility named text2pcap.exe that will do something like i require. But i can't able to save my data fully. Only data from first line in the text file is saved in .pcap file. I can't able to understand the options available with this utility. Could you please help me out.

 

 

Message Edited by mathan on 03-19-2009 05:57 AM
0 Kudos
Message 4 of 12
(8,575 Views)

Hi mathan,

maybe your text file isn't correct.

 

Mike

Message 5 of 12
(8,560 Views)

Dear Mike,

 

See the attached picture i am using the same format as required by the utility as shown here. But no guess where is wrong.

 

000000 12 34 dc 23 12 32 56 76
000008 43 bc 3c 7d cd ad 34 99
000010 23 44 64 76 12 00 cb ae
000018 ab 23 45 bc 5d e8 cc 00

Message Edited by mathan on 03-19-2009 07:14 AM
0 Kudos
Message 6 of 12
(8,557 Views)

Bump!

 

Anybody know something about this text2pcap.exe utility coming along with ethereal.

 

[Edit: I saw Smercurio replying lot of posts related to winpcap. Smiley Happy Maybe he will have a look at this by chance and help me out. Smiley Sad

Message Edited by mathan on 03-20-2009 06:56 AM
0 Kudos
Message 7 of 12
(8,533 Views)

Hi Mathan,

 

I wish I had the time to dig into this with but I don't. When I am trying to do these types of projects I start out with files from the original source and work to emulate them exactly. From what you have posted it look like one of your fields is wrong (I know, Duh!). Since your file is so small you could change one field at a time until you see the eror message change (techniclly that is hacking) then you will know which filed is is complaining about. It alomost looks like you have an extra character somewhere.

 

Sorry to be of so little service.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 12
(8,518 Views)

mathan wrote:

Dear Mike,

 

See the attached picture i am using the same format as required by the utility as shown here. But no guess where is wrong.

 

000000 12 34 dc 23 12 32 56 76
000008 43 bc 3c 7d cd ad 34 99
000010 23 44 64 76 12 00 cb ae
000018 ab 23 45 bc 5d e8 cc 00


Add a space at the end of each line. (Yeah, I know.)

Message Edited by smercurio_fc on 03-20-2009 04:30 PM
Message 9 of 12
(8,500 Views)

Any one find solution on this?

 

or still it is pending?

 

 

0 Kudos
Message 10 of 12
(6,842 Views)