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.

Date: Mon, 18 Sep 2000 16:53:08 +0200
> 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.

This works very well.

-- 
Andreas Sikkema
andreas.sikkema@xxxxxxxxxxx
"Standing barefoot in a river of clues, most people would 
         not get their toes wet." - Brian Kantor in a.s.r.