This is a simple class that can read RADIUS dictionary files and parse
them, allowing conversion between dictionary names and numbers.
Vendor-specific attributes are supported in a way consistent with the
standards.
This class is patterned after the Net::Radius::Dictionary Perl module
written by Christopher Masto (chris@netmonger.net) and Luis E.
Munoz (lem@cantv.net)
Initialize all the instance variables. All variables start out as empty
versions of the appropriate type.
Parse a dictionary file from an IO object and learn the name<->number
mappings from it. Only the /first/ definition will apply if multiple
definitions are seen. This method may be called multiple times with
different IO objects, reading from several files.
Parameters
| fp: | IO object from which to read the data
|
Return
None. Any strangeness in the file results in a message being printed to
stderr.
Given an attribute name, return the number corresponding to it, based on
the dictionary file(s) that have been read.
Parameters
| attrname: | Name of the attribute whose number is desired.
|
Return Value
The number corresponding to the appropriate attribute name given.
Given an attribute name, return the corresponding type for it, based on the
dictionary file(s) that have been read.
Parameters
| attrname: | Name of the attribute whose type is desired.
|
Return Value
The type string corresponding to the appropriate attribute name given. This
is either string, ipaddr, integer, or date.
Given an attribute number, return the name corresponding to it, based on
the dictionary file(s) that have been read, the reverse of the attr_num method.
Parameters
| attrname: | Name of the attribute whose number is desired.
|
Return Value
The number corresponding to the appropriate attribute name given.
Given an attribute number, return the type of the attribute corresponding
to it, based on the dictionary file(s) that have been read.
Parameters
| attrnum: | Number of the attribute whose type is desired.
|
Return Value
The number corresponding to the appropriate attribute name given.
Given an attribute number, return true or false depending on whether or not
a value has been given for it.
Parameters
| attrnum: | Number of the attribute whose definition is known
|
Return Value
True or false depending on whether some value has been given to the
attribute
Alias for attr_has_val. Don't use this;
it's confusing.
Parameters
| attrname: | Name of the attribute whose number is desired.
|
Return Value
The number corresponding to the appropriate attribute name given.
Give the number of the named value for the attribute number supplied.
Parameters
| attrnum: | the attribute number
|
| valname: | the name of the value
|
Return
The number of the named value and attribute.
Returns the name of the numbered value for the attribute value supplied.
The reverse of val_num.
Parameters
| attrnum: | the attribute number
|
| valname: | the name of the value
|
Return
The name of the numbered value and attribute.
Obtains the code of a vendor-specific attribute given the Vendor-Id and the
name of the vendor-specific attribute (e.g. 9 for Cisco and
'cisco-avpair').
Parameters
| vendorid: | the Vendor-Id
|
| name: | the name of the vendor-specific attribute to query
|
Return Value
The code for the vendor-specific attribute
Obtains the type of a vendor-specific attribute given the Vendor-Id and the
name of the vendor-specific attribute.
Parameters
| vendorid: | the Vendor-Id
|
| name: | the name of the vendor-specific attribute to query
|
Return Value
The type for the vendor-specific attribute
Obtains the name of a vendor-specific attribute given the Vendor-Id and the
code of the vendor-specific attribute. The inverse of vsattr_num.
Parameters
| vendorid: | the Vendor-Id
|
| code: | the code of the vendor-specific attribute to query
|
Return Value
The name of the vendor-specific attribute
Obtains the type of a vendor-specific attribute given the Vendor-Id and the
code of the vendor-specific attribute.
Parameters
| vendorid: | the Vendor-Id
|
| code: | the code of the vendor-specific attribute to query
|
Return Value
The type of the vendor-specific attribute
Determines whether the vendor-specific attibute with the Vendor-Id and code
given has a value.
Parameters
| vendorid: | the Vendor-Id
|
| code: | the code of the vendor-specific attribute to query
|
Return Value
True or false on whether or not the vendor-specific attribute has a value
Alias for vsattr_has_val. Don't use this;
it's confusing.
Parameters
| vendorid: | the Vendor-Id
|
| attrnum: | Name of the attribute whose number is desired.
|
Return Value
The number corresponding to the appropriate attribute name given.
Give the number of the named value for the vendor-specific attribute number
supplied.
Parameters
| vendorid: | the Vendor-Id
|
| attrnum: | the attribute number
|
| valname: | the name of the value
|
Return
The number of the named value and attribute.
Returns the name of the numbered value for the vendor-specific attribute
value supplied. The reverse of val_num.
Parameters
| vendorid: | the vendor ID
|
| attrnum: | the attribute number
|
| valname: | the name of the value
|
Return
The name of the numbered value and attribute.