ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] Autogenerating dissectors ...

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sat, 26 May 2001 20:52:35 -0700
On Fri, May 25, 2001 at 06:19:00AM +0900, Richard Sharpe wrote:
> Perhaps I can push code like:
> 
>   if (tree) {
> 
>     # Handle tree view display
> 
>  } else {
> 
>    # Handle summary view display
> 
>  }

Actually, code like that isn't necessarily correct, as a single call to
a dissector may be required to generate both protocol tree information
*and* summary view information - it's more like

	if (check_col(pinfo->fd, COL_PROTOCOL))
		handle summary view information for Protocol column;
	if (check_col(pinfo->fd, COL_INFO))
		handle summary view information for Info column;
	if (tree != NULL) {
		handle tree view display;
	}

Don't forget also that, if the dissector calls any sub-dissectors, it
should do so *regardless* of whether the "tree" argument is null or not.