Radius...ionary(3pm)
π NAME π
Net::Radius::Dictionary β bestie, it's a RADIUS dictionary parser. That's the whole vibe β¨
π SYNOPSIS π
use Net::Radius::Dictionary;
my $dict = new Net::Radius::Dictionary "/etc/radius/dictionary";
$dict->readfile("/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);
Look at that. Clean. Gorgeous. No notes. π
π¦ DESCRIPTION π¦
okay so, this is a simple module that reads a RADIUS dictionary file and parses it, which means it can convert between dictionary names and numbers, both directions, no drama. Vendor-Specific attributes are supported in a way that's consistent with the standards. iykyk π
Now the tea β: a few earlier versions of this module tried to make dictionaries case-insensitive. That proved to be a very bad decision. From this version on, that tendency is reverted: dictionaries and their contents are to be case-sensitive, to prevent random, hard-to-debug failures in production code. Not me getting haunted by case bugs at 3am π periodt, keep your case correct.
β¨ METHODS β¨
new($dict_file, ...)β returns a new instance of aNet::Radius::Dictionaryobject. This object will have no attributes defined, as expected.
If you give it an (optional) list of filenames, it calls readfile for you for all of them, in the given order. so thoughtful π«Ά
->readfile($dict_file)β parses a dictionary file and learns the mappings to use. It can be called multiple times on the same object. The result will be that new entries override older ones, so you could load a default dictionary and then have a smaller dictionary that overrides specific entries. stacking dictionaries like outfits, iconic π->vendor_num($vendorname)β returns the vendor number for the given vendor name.->attr_num($attrname)β returns the number of the named attribute.->attr_type($attrname)β returns the type (string,integer,ipaddr, ortime) 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 forattr_has_val. girl. why. π->val_num($attrnum, $valname)β returns the number of the named value for the attribute number supplied.->val_name($attrnum, $valnumber)β returns the name of the numbered value for the attribute number supplied.
There is 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
vsaprepended to the accessor name. - The first argument to each one is the vendor code on which they apply.
so attr_num becomes vsattr_num, and the vendor code slides in front. slay πΈ
β οΈ CAVEATS β οΈ
This module is mostly for the internal use of Net::Radius::Packet, and may otherwise cause insanity and/or blindness if studied. ππ
bestie i'm so serious, look away. read it at your own risk. you've been warned π
π AUTHOR π
Christopher Masto <chris@netmonger.net>, and Luis E. MuΓ±oz <luismunoz@cpan.org> contributed the VSA code. giving credit where credit is due, we love to see it π«Άβ¨
π SEE ALSO π
Net::Radius::Packet
and that's the whole page, bestie! this one's from the User Contributed Perl Documentation, and the footer says perl v5.32.0, dated 2021-01-06. go forth and parse responsibly πππ¦
π¦ where this page comes from
- debian bookworm: libnet-radius-perl 2.103+dfsg-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-radius-perl 2.103+dfsg-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libnet-radius-perl 2.103+dfsg-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-radius-perl 2.103+dfsg-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms