Ethereal-dev: Re: [Ethereal-dev] More "register to a port".

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Thu, 12 Oct 2000 17:20:07 -0700 (PDT)
> What is the difference between
> 
> 	dissector_add( "tcp.port", PORT_NUMBER, DISSECT_MY_PROTO);
> 
> and 
> 
> 	old_dissector_add( "tcp.port", PORT_NUMBER, DISSECT_MY_PROTO);
> 
> ?

The first one is used if your dissector is a new-style dissector using
tvbuffs; the second one is used if your dissector is an old-style
dissector.

The compiler should print a warning if the wrong call is used (assuming
that a function prototype for the dissector is in scope - but one should
always arrange that prototypes for functions are in scope whenever the
function is used, so that the compiler can check not only for calls that
pass a pointer to that function as an argument but can also check direct
calls to the function).