ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] Modifying a dissector query

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 10 Sep 2003 11:52:57 -0700

On Sep 9, 2003, at 9:58 AM, Grenville and Benita Fernandes wrote:

     Firstly, I am not a developer. However, to try
and figure out how things work in Ethereal, I was
modifying parts of the code for the HSRP dissector. I
then decided that I wanted to get rid of
packet-hsrp.c, and put in my own version,
packet-myhsrp.c.

Well, you've modified Ethereal code, so you're a developer now. :-)

1. I modified Makefile.am and Makefile.nmake, and did
a `make'. For some reason, when I looked at
Makefile.in, I could see the old hsrp and not my new
code. I did a lot of searching, found some link to
autogen.sh, ran it and somehow it worked, and I got a
packet-myhsrp.o after running make. If someone could
explain why it worked after running autogen.sh, that
would be great.

A "make" in that situation has always regenerated Makefile.in, and Makefile, for me.

However, I build from CVS, not from a release tarball; it might be that the release tarball version (which is different - the GNU automake stuff generates a Makefile.in with a "dist" rule that generates a release tarball that doesn't require all the tools that the CVS version does, so that you can distribute your software to people who don't have all the GNU auto* stuff installed) doesn't make Makefile.in dependent on Makefile.am (perhaps because, as per the previous parenthetical note, they don't want to depend on the user having the GNU auto* stuff installed).

More importantly, now I have my HSRP code in, but when
I decode HSRP packets, it still decodes using the
original HSRP code. ( I know, because I modified all
the text that should be in the info columns )

If you have more than one dissector registering for the same "port" number, you might not get the one you want. Did you really get rid of packet-hsrp.c - and packet-hsrp.o, and the reference to packet-hsrp.c in Makefile.am? If not, either

	1) do so

or

2) call your "packet-myhsrp.c" just "packet-hsrp.c", and put the original Makefile.am back

so that Ethereal doesn't have both dissectors in it.

Perhaps you didn't actually get rid of packet-hsrp.c - try removing it and packet-hsrp.o, removing it fr