Ethereal-dev: Re: [Ethereal-dev] IPv6 Question

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Tue, 8 Oct 2002 00:41:34 -0700
On Tue, Oct 08, 2002 at 10:27:59AM +0300, Antti Tuominen wrote:
> So I should see if another dissector is registered, if so unregister
> it, register my own, and then if I don't know how to handle the packet
> pass it to the other dissector?

No, as there's no way to see if another dissector is registered.

> I would guess this is a quite common problem that you have IPv4 and
> IPv6 versions of a protocol which use the same port, but different
> messages.

I don't know of any protocols that do that other than, apparently, AODV
and OLSR.  Perhaps there are others.

> Is there a way in ethereal to register a protocol to
> e.g. UDP(654) + IPv6 only?

No, you can only register a protocol to a particular port, not to a
particular port+network-layer type.

However, you could have the dissector for that port check the type of
the source or destination address for the packet, and behave differently
if it's IPv4 or IPv6.  Check "pinfo->src.type" or "pinfo->dst.type" to
see whether it's AT_IPv4, AT_IPv6, or something else.