Re: parameter arrays
"Guy Harris" <[email protected]>
| Newsgroups | gmane.network.ethereal.devel |
|---|---|
| Message-ID | <[email protected]> |
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.