The BEGIN-TLV keyword
BEGIN-TLV <name>
The BEGIN-TLV
keyword starts a "nested" set of
ATTRIBUTE definitions wwhich are all
for a particular parent attribute of type tlv
.
- <name>
-
The name of the parent attribute.
The tlv must have previously been created in anref:dictionary/attribute.adoc[ATTRIBUTE] definition.
The BEGIN-TLV
keyword must always be paired with a matching END-TLV keyword.
Within the context of a `BEGIN-TLV
block, the numbers for each
ATTRIBUTE definition are relative to
the parent TLV.
ATTRIBUTE Foo 2 tlv BEGIN-TLV Foo ATTRIBUTE Bar 1 string END-TLV Foo
This example defines an attribute Foo.Bar
, with OID 2.1
.
Purpose
The BEGIN-TLV
keyword exists for efficiency. It is not strictly
needed, but without a BEGIN-TLV
keyword, every
ATTRIBUTE name would need to contain
the parent attribute name, as in the following
example.
ATTRIBUTE Foo.bar 2.1 string
Nesting
It is possible to nest multiple BEGIN-TLV
keywords, so long as each
one is paired with a matching END-TLV keyword.
ATTRIBUTE Foo 2 tlv BEGIN-TLV Foo ATTRIBUTE Bar 1 string ATTRIBUTE Baz 2 tlv BEGIN-TLV Baz ATTRIBUTE Such 4 ipaddr END-TLV Baz END-TLV Foo
The above example is equivalent to the example below.
ATTRIBUTE Foo 2 tlv ATTRIBUTE Foo.Bar 2.1 string ATTRIBUTE Foo.Baz 2.2 tlv ATTRIBUTE Foo.Baz.Such 2.2.4 ipaddr
For short entries, it can be simpler to use the full name an OID.
However, for complex dictionaries, it is almost always clearer to use
BEGIN-TLV
and END-TLV.