This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

can anybody paste a sample c++ or c code to decode the data captured from wireshark ??

asked 26 May '11, 23:42

sagu072's gravatar image

sagu072
35232428
accept rate: 0%

retagged 27 May '11, 20:43

helloworld's gravatar image

helloworld
3.1k42041


the source-code for wireshark or tshark is freely available sample code that does exactly what you want.

permanent link

answered 27 May '11, 00:21

martyvis's gravatar image

martyvis
8911525
accept rate: 7%

edited 27 May '11, 00:21

This is the tutorial I used to learn libpcap capture, parse. Save Wireshark data as pcap and parse it with this code.

http://yuba.stanford.edu/~casado/pcap/section1.html

permanent link

answered 27 May '11, 00:23

jakan's gravatar image

jakan
1112
accept rate: 0%

edited 27 May '11, 00:23

There are several resources that show you how to write your own Wireshark dissector. The difficulty level depends on the chosen language. I prefer Lua because it's easier to work with (other than debugging for which I rely on print-outs to the console), Lua doesn't require installing a bunch of packages to setup a build environment; Lua just needs a Wireshark installation.

Writing a dissector in C:

Writing a dissector in Lua:

permanent link

answered 27 May '11, 20:42

helloworld's gravatar image

helloworld
3.1k42041
accept rate: 28%

edited 27 May '11, 20:45

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×637
×13

question asked: 26 May '11, 23:42

question was seen: 5,727 times

last updated: 27 May '11, 20:45

p​o​w​e​r​e​d by O​S​Q​A