Data::Radius::Constants - export constants for Data::Radius::Packet
use Data::Radius::Constants qw(:all);
or
use Data::Radius::Constants qw(ACCESS_REQUEST ACCESS_ACCEPT ACCESS_REJECT %RADIUS_PACKET_TYPES);
Exports RADIUS RFC established constants and utilities for easy packet handling.
In addition to RFC packet type constants enables following aliases:
'COA' => COA_REQUEST, 'DM' => DISCONNECT_REQUEST, 'POD' => DISCONNECT_REQUEST, 'ACCT' => ACCOUNTING_REQUEST, 'AUTH' => ACCESS_REQUEST, my $type = ACCESS_REQUEST;
... is equivalent to
my $type = $RADIUS_PACKET_TYPES{AUTH}; # using aliases
Convenience method to test if a request was accepted by received response.
Returns true if the response type is the accepting type for the given request type. Returns 0 for corresponding rejections, undef for everything else
You can use packet type ids or its aliases as arguments
Example:
($response_type) = $response_packet->parse();
print "Accepted\n" if accepting_packet_type(ACCESS_REQUEST, $response_type);
but also
print "Accepted\n" if accepting_packet_type('AUTH', ACCESS_ACCEPT);
print "Accepted\n" if accepting_packet_type('AUTH', 'ACCESS_ACCEPT'); # same
Data::Radius::Packet
Sergey Leschenko <sergle.ua at gmail.com>
PortaOne Development Team <perl-radius at portaone.com> is the current module's maintainer at CPAN.
To install Data::Radius, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Radius
CPAN shell
perl -MCPAN -e shell install Data::Radius
For more information on module installation, please visit the detailed CPAN module installation guide.