Ethereal-dev: Re: [ethereal-dev] Heuristic dissectors and tvbuff

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: Thu, 17 Aug 2000 09:46:52 -0700
On Thu, Aug 17, 2000 at 11:52:27AM +0200, andreas.sikkema@xxxxxxxxxxx wrote:
> Shouldn't the heursitic dissectors be able to use the tvbuff?

They can, in the code in the CVS tree (or, therefore, in the nightly
snapshots).

Heuristic dissectors can be registered either with
"old_heur_dissector_add()", if they're old-style dissectors with "const
u_char *pd, int offset, frame_data *fd, proto_tree *tree" arguments, or
with "heur_dissector_add()", if they're new-style dissectors with
"tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree" arguments.

The same is true of port-based dissectors - they can be registered with
"old_dissector_add()" or "dissector_add()".

In addition, both old-style and new-style dissectors can look up and
call heuristic or port-based dissectors, regardless of the type of the
dissector being called; they can call "old_dissector_try_port()" or
"dissector_try_port()", or can call "old_dissector_try_heuristic()" or
"dissector_try_heuristic()", and the routines in question will translate
the arguments as necessary.