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

Using Wireshark libraries in C#

0

I want to make my own application using Wireshark libs. I did it already with NetworkMonitor API, but Wireshark offers some protocolls (i.e. S7comm).

The only one possibility I've found is to use Wireshark indirectly, using Lua. (Set a reference on LuaInterface.dll then "using LuaInterface" etc.) http://www.dreamincode.net/forums/topic/240886-integrating-lua-with-c%23-using-luainterface/

Is it posiible without Lua? I want to make a reference to Wireshark in my project and to use all benefits of C#.

asked 11 May '12, 02:49

ZvDj's gravatar image

ZvDj
1333
accept rate: 0%

edited 11 May '12, 14:22

helloworld's gravatar image

helloworld
3.1k42041


2 Answers:

0

Using libwireshark.dll from C# should be like using any other native DLL from C#. See here for some details on how to do that in general.

However, using libwireshark is not for the faint-hearted, expect some bumps. The API hasn't really been designed for external consumption, more for the Wireshark project as a whole. There have been some other folks successfully using it in other apps (not C# IRC) so it can be done.

Remember the licensing of libwireshark is GPL, so think about the implications of that and read the FAQ on that for starters.

answered 11 May '12, 03:04

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Which kind of invoking would you recommend: Explicit, Implicit, Dynamic or "Converting C++ DLL to COM Server"?

Unfortunatelly are the links on the site, you have send me, not valid. Can you possibly send me links to some Examples of using of libwireshark.dll in C#?

Thanks in advance

(11 May '12, 03:57) ZvDj

I converted your "answer" to a comment as that's how this site works, please read the FAQ for more info.

The links works for me, here's what they point to: Invoke Native C++ DLL from .NET Code

I have no links to examples of using libwireshark.dll from C#. Google may have some, try that.

(11 May '12, 04:22) grahamb ♦

Sorry, I can open yout Link, but when I try to download (Download the All-In-One Code Framework (Library) package), I receive the message "The specified release was not found."

(11 May '12, 04:35) ZvDj

So it is. You'll have to contact MS about that.

(11 May '12, 05:06) grahamb ♦

Anyway, thank you very much

(11 May '12, 05:09) ZvDj

0

you should be able to create an execute command function in c# that expects a string... then execute the tshark command from the execute command function which invokes tshark and it's respective arguments :-)

answered 25 Mar '13, 06:58

fdfvo's gravatar image

fdfvo
111
accept rate: 0%