Dict Module
The dict
module registers expansions which query the dictionaries.
Expansions
The following expansions allow querying the dictionaries.
%dict.attr(<string>)
Takes an attribute name, and returns the canonicalized name of the attribute.
If the attribute does not exist, nothing is returned.
%dict.attr.by_num(<uint32>)
Takes an attribute number, and returns the canonicalized name of the attribute.
If the attribute does not exist, nothing is returned.
This function is useful only for "top level" attributes such as User-Name
.
Where the attribute is nested, use %dict.attr.by_oid()
instead.
%dict.attr.by_oid(<string>)
Takes a full OID reference (e.g. 26.9.1
), and returns the name of
the attribute.
If the attribute does not exist, nothing is returned.
%dict.attr.num(<string>)
Takes an attribute name, and returns the number of the attribute.
If the attribute does not exist, nothing is returned.
Note that only the final attribute number is returned. For example, the OID
for Vendor-Specific.Cisco.AVPair
is 26.9.1
. This function will return
1
, and not the full OID.
%dict.attr.type(<string>)
Takes an attribute name, and returns the data type of the attribute.
If the attribute does not exist, nothing is returned.