Ethereal-dev: Re: [Ethereal-dev] packet-nfs.c using tvbuffs?

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

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Sat, 27 Jan 2001 19:41:55 -0800
On Sat, Jan 27, 2001 at 12:51:46PM -0800, Guy Harris wrote:
> Unless somebody has a better way, I'd vote for 1), as it lets you
> continue to initialize the "vsff" (or "old_vsff") tables at compile
> time; you'd then have "old_rpc_init_proc_table()", taking an "old_vsff *"
> as its last argument, and "rpc_init_proc_table()", taking a "vsff *" as
> its last argument.
> 
> A "rpc_proc_info_value" could then contain an "old or new" flag, and
> contain unions of "old_dissect_function_t *" and "dissect_function_t *"
> for "dissect_call" and "dissect_reply", with "old_rpc_init_proc_table()"
> and "rpc_init_proc_table()" initializing the newly-allocated
> "rpc_proc_info_value"s appropriately.
> 
> "dissect_rpc" would then have to have both "old_dissect_function" and
> "dissect_function" pointers, setting the appropriate one, and
> "call_dissect_function()" might take both pointers as arguments, calling
> whichever one is non-NULL and:
> 
> 	if it's "old_dissect_function", doing the "tvb_compat()"
> 	mapping it does now;
> 
> 	if it's "dissect_function", just calling it without bothering
> 	with "tvb_compat()".

I've checked that in, and finished tvbuffifying the NLM dissector (i.e.,
got rid of the last remnants of old-style dissector code in it).