Ethereal-dev: Re: [Ethereal-dev] dissector_add question

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: Mon, 12 Feb 2001 14:33:08 -0800 (PST)
> I presume its because I have added some new arguments to dissect_xxx

Correct.  Dissectors registered with "dissector_add()" are called by
"old_dissector_try_port()" and "dissector_try_port()", and those
routines cannot pass any arguments that they don't know about - and they
wouldn't know a GIOP message header or operation.

> So, what do you think is the best way to go get around this.
> 
> 1. Accessor method in giop to retrieve a MessageHeader * header
>    for a given packet (ditto for operation). Hmm
> 
> 2. dissect_xxx to take a variable arg list ??

That works only if you can pass the variable argument list to
"dissector_try_port()" - and you can't pass a variable argument list,
you could only pass a "va_list".

Furthermore, it then requires that *ALL* dissectors that are registered
with "dissector_add()" take a "va_list" argument, *AND*
"dissector_try_port()" and "old_dissector_try_port()" be changed to take
a variable argument list.

Variable argument list also cannot, in general, be type-checked,
reducing the chances that errors would caught at compile time.

> 3. Any other suggestions welcome

3. Have a mechanism specific to GIOP to allow dissectors to register
themselves, and for GIOP to call those dissectors, along the lines of
what ONC RPC does.