Ethereal-dev: Re: [ethereal-dev] dynamic dissector_add/rem

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

From: Frank Singleton <frank.singleton@xxxxxxxxxxxx>
Date: Mon, 18 Sep 2000 14:22:57 -0500
andreas.sikkema@xxxxxxxxxxx wrote:
> 
> > Can I use the dissector_add/rem functions at other
> > times besides inside  proto_reg_handoff() to allow
> > my dissector to register/handle this new dynamic port
> > in the "tcp.port" dissector table or are there
> > restrictions ??
> 
> I seem to remember this was impossible....
> 
> What I do a lot in my H.323 dissector is this:
> 
> 1. I find a port and ip address in a packet
> 2. I call a function for the protocol I want to use on that new port
>    and ip address
> 3. The function initializes it's dissector as a heuristic dissector
>    for either UDP or TCP
> 4. the function creates a conversation with one ip-address and one
>    port. I got into problems when I wanted to add two protocols
>    using UDP, so I also added the protocol name to the data part in
>    the conversation
> 5. When a TCP or UDP packet is received from now on, the dissector
>    checks if the ip address, port and data part are correct and then
>    dissects the packet.

Ok, thanks for the info.

Just out of curiosity, why cant we use
dissector_add() during dissection ??

/Frank
-- 
EUS/SV/Z Frank Singleton      ASO Americas BSS
Office : +1 972 583 3251      ECN 800 33251  
Pager  : +1 800 651 1184      Email : eusfrsi@xxxxxxxxxxxxxxx 
Amateur Radio: VK3FCS/KM5WS   Email : frank.singleton@xxxxxxxxxxxx

Hardware: HP Omnibook 4150 running Redhat Linux 6.2 (2.2.16 kernel).