开发者

How do I compile this plugin?

开发者 https://www.devze.com 2023-02-08 22:30 出处:网络
I\'m following the foo dissector example but would like to know how to compile it. The foo dissector example i开发者_如何学Pythons shown in this link:

I'm following the foo dissector example but would like to know how to compile it.

The foo dissector example i开发者_如何学Pythons shown in this link: http://www.wireshark.org/docs/wsdg_html_chunked/ChDissectAdd.html

You'll notice it mentions that the interlink directory contains good examples of support files I can use and that I need to modify Makefile.am & makefile.common etc. I've modified those to reflect the foo module.

However, now I'd like to know how to build it. I tried running automake but it complains there there is no configure.in. Sorry I'm not too familar with the gnu build environment yet.

Also, is it possible to build this module standalone? or do I need all the other wireshark sources available? I have of course installed wireshark-dev under ubuntu.


I went through README.plugins procedure and here what I've got:

1) Under plugins directory, rename

  • Custom.m4.example to Custom.m4
  • Custom.make.example to Custom.make
  • Custom.nmake.example to Custom.nmake

2) Rename all of the foo occurrences in those files to your protocol name

3) Go to top-level wireshark directory and run autogen and configure as a root

./autogen.sh
./configure

Side Note: Make sure there is no warnings or errors during those steps. To compile your plugin properly copy following files from gryphon plugin to your newly created protocol folder along with source files and replace all gryphon occurrences with your protocol name

  • AUTHORS
  • COPYING
  • ChangeLog
  • CMakeLists.txt
  • Makefile.am
  • Makefile.common
  • Makefile.in
  • Makefile.nmake
  • moduleinfo.h
  • moduleinfo.nmake
  • plugin.c
  • plugin.rc.in

4) Compile plugins using following command. Run make install just in case

make -C plugins
make install

5) And finally run Wireshark with following command

WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 ./wireshark

6) If everything successful, you will see your plugin listed under About Wireshark, Plugins tab. I had some trouble with plugin version at first. Including following line after #include "config.h" fixed it:

#include "moduleinfo.h"


Answering my own question.

Looks like I have to follow the instructions contained in the Wireshark source. i.e. doc/README.plugins

Provides all the information required to build plugins for Wireshark.

0

精彩评论

暂无评论...
验证码 换一张
取 消