Net::Radius::SSG - Perl extension for communicating with a Cisco SSG (Service Selection Gateway) router.
use Net::Radius::SSG; my $ssg = new Net::Radius::SSG($ssg_ip, $ssg_port, $ssg_shared_secret, $dictionary); my $radius_packet = $ssg->action(SSG_ACCOUNT_LOGON, { user_ip => '1.2.3.4', user_id => 'testuser', password => 'password' }); if ($radius_packet->code eq 'Access-Accept') { print "User successfully logged on to the SSG\n"; } ...
Net::Radius::SSG is for communicating with a Cisco SSG router via the Service Selection Dashboard (SSD) protocol which is implemented over RADIUS. This module requires Net::Radius and Net::UDP.
$ssg_object = new Net::Radius::SSG($ip,$port,$secret, $dictionary_file);
Creates a new SSG (Service Selection Gateway) object. Requires the SSG IP address (or hostname), the Radius port that the SSG is listening on, the Radius shared secret and the location of a Merit dictionary file. Please see the Net::Radius::Dictionary documentation for further information on dictionary files.
my $radius_packet = $ssg_object->action(ACTION, \%params);
Requires an action (one of SSG_ACCOUNT_LOGON, SSG_ACCOUNT_LOGOFF, SSG_ACCOUNT_PING, SSG_SERVICE_LOGON or SSG_SERVICE_LOGOFF) plus a hash containing the parameters. The action function returns a Net::Radius::Packet object. The params hash differs for each action. All actions understand the {timeout => SECONDS} option. The timeout parameter specifies how long the action function will wait for a reply from the SSG.
The list of parameters are: user_id => $username, user_ip => $ip_address, service => $service_name, timeout => $seconds.
The various actions are:
This action sends an 'account ping' command code to the SSG, used to return the username of the person logged in on a particular IP address.
$rp = $ssg_object->action(SSG_ACCOUNT_PING, { user_ip => '1.2.3.4' });
if ($rp->code eq 'Access-Accept') {
if (defined $rp->attr('User-Name')) { print $rp->attr('User-Name'); }
}
This action sends an 'account logon' command code to the SSG. Requires the user_id, user_ip and password values to be set.
This action sends an 'account logoff' command code to the SSG. Requires the user_id and user_ip values to be set.
This action sends a 'service logon' command code to the SSG. Requires the user_ip and service values to be supplied.
This action sends a 'service logoff' command code to the SSG. Requires the user_ip and service values to be supplied.
SSG_ACCOUNT_PING SSG_ACCOUNT_LOGON SSG_ACCOUNT_LOGOFF SSG_SERVICE_LOGON SSG_SERVICE_LOGOFF
Net::Radius::Packet, Net::Radius::Dictionary, Net::UDP
Chris Myers, <c.myers@its.uq.edu.au>
Copyright 2004 by Chris Myers
This software comes with no warranty whatsoever and the author is not liable for the outcomes of the use of this software.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::Radius::SSG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Radius::SSG
CPAN shell
perl -MCPAN -e shell install Net::Radius::SSG
For more information on module installation, please visit the detailed CPAN module installation guide.