Ethereal-dev: Re: [Ethereal-dev] parameter arrays

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: Wed, 24 May 2006 18:58:37 -0700 (PDT)
John R. wrote:
> How do others handle dissection of parameter arrays? Basically, I have
> type (indicates basic type like UINT16 or SINT8, etc.) and a length
> field (in bytes). Dividing the length field by the basic type size
> gives me the number of elements.
>
> For most of my parameters I register a field in the hf table and then
> add the tree node in the usual way. However, since this is a
> many-to-one relationship, I'm confused. I'm not sure how to do it
> since the hf table is "static," i.e. I guess I cannot add
> myprot.ufield.0, myprot.ufield.1, etc.

No, you can't.

Typically, for an array of N myprot.ufield values, they just put each one
in as a myprot.ufield value, perhaps using proto_tree_add_XXX_format() so
that each one could be tagged with the instance number.

It might be useful to have a call to do the tagging for you; no such call
currently exists.


_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev