Ethereal-dev: Re: [ethereal-dev] FW: Question about Plugins

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Olivier Abad <abad@xxxxxxxxxxxxx>
Date: Sat, 27 May 2000 10:56:03 +0200
On ven, mai 26, 2000 at 06:43:22 -0400, Ihab Hedroj wrote:
> 
> I am new to ethereal and I been asked to write a plugin for LDP. I did
> the following as a starting point:
> 
> 1- Copied the gryphon plugin to a new directory named ldp
> 2- Removed most of the code and left only what is written in the
> README.Developer document
> 3- Cleaned up the .h file
> 4- Changed the filter string to tcp.port == 6000
> 5- Changed all Makfiles*
> 6- Ran make. It compiled with no problems and generated .la, lo and .o
> files and the .libs dir.
> 7- Created the shared file by typing
>         ld -shared -o ldp packet-ldp.o.

It should be generated by make.

> 8- Copied the .so, .la and ldp files to
> /usr/local/lib/ethereal/plugins/0.8.8

make install should do it.

> 9- Started ethereal
> 10- Enabled the plugin and started the capture process.
> 
> Ethereal didn't call my plugin at all in spite of the existence of TCP
> packets with source and destination ports equal to 6000.

Try to run ethereal with gdb. In packet-tcp.c, put a breakpoint in the
loop where plugins are applied : while(pt_plug) { ... }. Plugins are
stored in a linked list (which should be short if you only have the
gryphon and ldp plugins). If your plugin is enabled, and the filter
matches the current packet, it should be called here.

> I would really appreciate if you provide me with some help.

It would be easier to help you if you could send your code.

Olivier
-- 
To get something done, a committee should consist of no more than three
persons, two of them absent.