No, you don't add the dissector to the port, you need to call your
dissector from the http one.
Look at how the diameter dissector calls the mobile-ip one. Of course
the mobile-ip payload is encapsulated, so you would be calling your own
dissector with the whole packet.
So, if I remember correctly (I don't have access to the source at the
moment), you have to do the following:
1) Register your dissector as a subdissector.
2) In the http dissector, in it's initialization, lookup your
subdissector.
3) In the http dissector, in it's dissect routine, do quick check to
see if the traffic is yours. If it is, call your subdissector with
the data.
Good luck with my extremely un-detailed descriptions ;)
-Dave
On Monday, 17 Feb 2003, Giles Scott wrote:
> I was thinking along those lines. There is something I can look for, and I
> see where I would need to add some code to make the choice just having a
> little trouble in working out how I register this 'new' protocol (do I need
> to?).
>
>
> Currently I have this;
> void
> proto_reg_handoff_dssp(void)
> {
> dissector_handle_t dssp_handle;
>
> dssp_handle = create_dissector_handle(dissect_dssp, proto_dssp);
> dissector_add("tcp.port", 80, dssp_handle);
> }
>
> Which obviously does not work when I have http port set to 80.
>
>
> Cheers
>
> Giles
>
>
> -----Original Message-----
> From: David Frascone [mailto:dave@xxxxxxxxxxxx]
> Sent: Monday, February 17, 2003 10:28 AM
> To: Scott, Giles [BRAM:9295:EXCH]
> Cc: ethereal-dev@xxxxxxxxxxxx
> Subject: Re: [Ethereal-dev] advice?
>
>
> If there is some reliable way to identify your protocol from http, then all
> you have to do is put a check in the http dissector to identify your
> protocol, then if the packet is yours, call your subdissector.
>
> -Dave
>
> On Monday, 17 Feb 2003, Giles Scott wrote:
> > Hi
> >
> > I'm writing a dissector which shares a port with another dissector.
> >
> > I'm looking for the best way for the two dissectors to co-exist.
> >
> > The 'new' protocol is on tcp port 80 which obviously shares with HTTP.
> >
> > Any advice?
> >
> > Cheers
> >
> > Giles Scott
> >
> >
> >
>
>
> --
> David Frascone
>
> I'm not even going to ignore that.
--
David Frascone
Join the army, meet interesting people, kill them.