Ethereal-dev: [Ethereal-dev] README.developer - if (tree)

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

From: Biot Olivier <Olivier.Biot@xxxxxxxxxxx>
Date: Tue, 16 Dec 2003 21:51:44 +0100
Hi list,

The following construct looks familiar to many Ethereal developers,
but not to all:

/*
 * The following code must be executed regardless of the visibility
 * of the protocol tree. This includes preparation of subdissection,
 * conversation build-up, and maybe housekeeping and comutation of
 * session state for some protocols.
 */
do_always();

if (tree) {
	/*
	 * The following computations will only be performed
	 * if protocol tree "tree" for this packet is visible.
	 */
	do_only_if_protocol_tree_is_visible();
}

The intention of this construct is not clearly written in
README.developer :)

If I remember correctly, one does not need to write an
if (tree) { } around all proto_XXX_add_YYY() as this is
already dealt with in the proto_XXX_add_YYY() functions,
right?

Regards,

Olivier