NAME
Net::Radius::Dictionary - RADIUS dictionary parser
SYNOPSIS
use Net::Radius::Dictionary;
my $dict = new Net::Radius::Dictionary "/etc/radius/dictionary";
$dict->readdict("/some/other/file");
my $num = $dict->attr_num('User-Name');
my $name = $dict->attr_name(1);
my $vsa_num = $dict->vsattr_num(9, 'cisco-avpair');
my $vsa_name = $dict->vsattr_name(9, 1);
DESCRIPTION
This is a simple module that reads a RADIUS dictionary file and parses it, allowing conversion between dictionary names and numbers. Vendor-Specific attributes are supported in a way consistent to the standards.
METHODS
new
Returns a new instance of a Net::Radius::Dictionary object. If given an (optional) filename, it calls readdict for you.
->readdict
Parses a dictionary file and learns the name<->number mappings.
->attr_num($attrname)
Returns the number of the named attribute.
->attr_type($attrname)
Returns the type (string, integer, ipaddr, or time) of the named attribute.
->attr_name($attrnum)
Returns the name of the attribute with the given number.
->attr_numtype($attrnum)
Returns the type of the attribute with the given number.
->attr_has_val($attrnum)
Returns a true or false value, depending on whether or not the numbered attribute has any known value constants.
->val_has_name($attrnum)
Alternate (bad) name for attr_has_val.
->val_num($attrnum, $valname)
Returns the number of the named value for the attribute number supplied.
->val_name
Returns the name of the numbered value for the attribute number supplied.
There's an equivalent family of accessor methods for Vendor-Specific attributes and its values. Those methods are identical to their standard attributes counterparts with two exceptions. Their names have a vsa prepended to the accessor name and the first argument to each one is the vendor code on which they apply.
CAVEATS
This module is mostly for the internal use of Net::Radius::Packet, and may otherwise cause insanity and/or blindness if studied.
AUTHOR
Christopher Masto <chris@netmonger.net>, Luis E. Munoz <lem@cantv.net> contributed the VSA code.
SEE ALSO
Net::Radius::Packet