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

So I've set out to make a plugin that displays(parses, whatever you want to call it) CDMI information for network traffic. But the protocol is not important.

I've been told the API is extensive so I can write it in whatever language I want. With some base work in C.

Now I'm not comfortable using C but by the looks of the docs(part 2) there is a nice guide written in C.

I heard Lua is another viable option and wireshark has it's own built-in lua interpretor. I've never worked with it before but by the looks of the syntax and such I can tell I'd be more comfortable writing in that as opposed to C.

So to put it formally: what should I expect as move along on this project. Keeping in mind, I'm somewhat of a beginner to writing software for software.

Ps: I use ubuntu

asked 03 Feb '11, 15:25

Rodayo's gravatar image

Rodayo
61111115
accept rate: 0%


By far, the best way to write a dissector is in C, and especially since you don't already know Lua. Learning to program well in C will likely have a much larger return on your efforts than learning to program in Lua. Not only will you be able to write a much faster and more complete dissector, but you will learn skills that will allow you to participate in other open source projects, including Linux itself and most of the tools you use daily in Ubuntu.

There are many ways to learn C and many books available on the topic. (I originally learned by reading the first edition of "The C Programming Language" by Kernighan and Ritchie back in 1978.) Once you get a good grasp of the basics of C, you can quickly transfer this knowledge into writing your Wireshark dissector by starting with a copy of an existing dissector and then modifying it to suit your purposes.

You are likely to find that once you know C well, it will be that much easier to learn many other programming languages, including Lua.

permanent link

answered 04 Feb '11, 09:06

beroset's gravatar image

beroset
2261213
accept rate: 33%

I don't plan to become a programmer in the future. Becoming proficient in any language doesn't interest me. I just want to get the job done. Now, you're saying C is the better choice, but could you elaborate on why it's a better choice?

permanent link

answered 04 Feb '11, 11:55

Rodayo's gravatar image

Rodayo
61111115
accept rate: 0%

The alternative is to write a dissector in Lua. The problems with this are that there are not as many working examples to start with, that you may need to look at the Lua implementation (written in C) to figure out how to do what you want and that a C implementation will run faster and be easier for you and others to maintain since the debugging tools are better. Those are the task-specific advantages. The generic advantages I think I already covered.

(04 Feb '11, 13:36) beroset

Hmm, well my project partner wants to go with C as well. I researched some more languages but it looks like C is the optimal choice whether I like it or not. Thank you for insight, and sorry if I came off a bit snippy before =P

(07 Feb '11, 08:40) Rodayo

No apology necessary! I didn't have any problem with the way you asked the question. It's good to state concisely what you do and do not want, and that's what you did. If you're satisfied with the answer, you can mark it as "answered" and that way it no longer shows up as an unanswered question for those of us who filter that way.

(07 Feb '11, 11:48) beroset

sorry, how do you mark it as answered? I only see options for upvoting individual answers

(07 Feb '11, 12:04) Rodayo

nevermind.

(07 Feb '11, 12:05) Rodayo
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:

×431
×37
×3

question asked: 03 Feb '11, 15:25

question was seen: 3,608 times

last updated: 07 Feb '11, 12:05

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