Mailing List Archive

More "register to a port".
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);

?

--
Mark Atwood | Freedom from want, freedom from fear, freedom from choice.
mra@pobox.com | Is that the freedom you want?
http://www.pobox.com/~mra
Re: More "register to a port". [ In reply to ]
> 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).