Subject: Question about arrays

From: Evangelos Haleplidis <[email-masked]>
Date: Tue, 29 Nov 2005 16:46:18 +0200

Greetings to the list,

I have a question,

In Appendix-D there is an example of:

table1: type array, ID = 3
        elements are:
        t1, type u32, ID = 1
        t2, type u32, ID = 2  // index into table 2
        KEY: nhkey, ID = 1, V = t2

From Appendix C and in page 84 it can be seen that there can exist arrays
with one element for each entry like:

SupportableVersions:  type array, ID = 30
			    elements are:
		          t1, type u8.

But there is no ID for t1.

I can point to the t1 element of the 3rd array from the Path-Data-TLV by
e.g. 30.2

Would it be wrong to have it this way:

SupportableVersions:  type array, ID = 30
			    elements are:
		          t1, type u8, ID = 1

And to point it by e.g. 30.2, ElementOf(1), lengthOf(1) and valueOf(1)?

Regards,

Evangelos Haleplidis.

---

From: "Joel M. Halpern" <[email-masked]>
Date: Tue, 29 Nov 2005 15:20:32 -0500

Either construct is possible.
The first construct occurs when you declare that the array is an array of u8.
The second construct occurs when you declare that the array is an array of 
a struct, and thaat struct happens to have only one field (id = 1) which is 
of type u8.

The difference is that in a later version of the outer object,(containing 
struct or LFB Class definition) if the array is declared the first way, 
additional fields can not be added.  If the array is declared the second 
way, additional fields can be added.

Yours,
Joel