Wireshark-dev: Re: [Wireshark-dev] Makefile for wireshark dissector
From: Ankith Agarwal <ankitha@xxxxxxx>
Date: Mon, 11 Jul 2011 16:16:23 +0530 (IST)
On Mon, Jul 11, 2011, sagar sg <sagu072@xxxxxxxxx> said:

> Hi,
>      I have written a dissector plug in in windows and it works fine, now i
> want to compile it in linux to get the .so file, please help me how do i
> write a make file for the wireshark dissector. i got one example file but
> there i saw something like .TSN compiler which  i dint understand of how it
> is written, please give some suggestions.
> 
> Thanks and Regards
> Saagar



Hi,
   For doing this firstly, you have to download the latest source of
wireshark.
   You have two options that can be done for your code to be included in
wireshark--

i) Compile your code into the wireshark main dissectors...
--> for this just take your .c file and paste it in the
(root)/epan/dissectors directory, where all the other dissectors are
placed. Now, to make changes in the makefile to reflect in the
compilation, just add your .c filename in the Makefile.common file in this
directory.
-->Makefile.common is the common part of the makefile in both Windows and
Linux platform.
-->Just go and edit the label DISSECTOR_SRC of this file and add your
filename in this list.
-->If your code also contains a header file then add it in the
DISSECTOR_INCLUDES label.
--> compile the wireshark source from the root directory of wireshark.

ii) compile a plugin for wireshrk(.so file)
-->Assumption here is that your plugin already contains the required
makefiles(ie, makefile.am and makefile.common)
-->Now these are the places where you have to edit the wireshark code for
telling it to compile and execute your plugin...
    a)root_direc/configure.in - somewhere near line 1861 - add path to
makefile of your plugin
    b)root_direc/Makefile.am - line 277 - add the path to .la file of your
plugin.
    c)root_direc/epan/Makefile.am - line 221 - add path to the .c file of
the dissector.
    d)root_direc/plugin/Makefile.am - line 35 - add your module in the
list of plugins.
-->compile the wireshark as usual.
-->new files will be generated in your plugin folder.
-->Now just copy the mih.la file and mih.so (inside .libs folder in
plugins folder) from the plugin and paste it into the
/usr/local/lib/wireshark/plugins/ folder.
Now run the wireshark tool and your plugin should start working.

Let me know if there are further problems

Regards
Ankith



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.