POE::Component::Server::TacacsPlus - POE Tacacs+ server component
use POE::Component::Server::TacacsPlus; use Net::TacacsPlus::Constants; POE::Component::Server::TacacsPlus->spawn( 'server_port' => 4949, 'key' => 'secret', 'handler_for' => { TAC_PLUS_AUTHEN() => { TAC_PLUS_AUTHEN_TYPE_PAP() => \&check_pap_authentication, }, }, ); POE::Kernel->run(); sub check_pap_authentication { my $username = shift; my $password = shift; return 1 if $password = $username.'123'; return 0; }
This component will listen on $server_port for Tacacs+ client reqests and dispatch them to the local functions handlers.
Currently only PAP requests can be dispatched as this is HIGHLY experimental and more like idea then functional code even that the pap is working fine.
I'm looking forward to you comments and suggestions until i'll invest more time on it.
Accepts following parameters:
key : tacacs secret key server_port : port on which to listen (optional) - default 49 handler_for : hash ref of handlers. keies are one of TAC_PLUS_AUTHEN, TAC_PLUS_AUTHOR and TAC_PLUS_ACCT
Component _start function.
Component _stop function.
On client connect setup function. Will setup POE::Session to handle client input using child_* function.
Tidy up and print out error message if accept failed.
Setup POE::Wheel::ReadWrite with POE::Filter::TacacsPlus so that child_input will receive directly Net::TacacsPlus::Packet objects as input.
Just print out the debug message that the child is finished.
Process incomming Net::TacacsPlus::Packet and call propper handler.
Cleanup after child is done.
Print out error and do cleanup.
tac-rfc.1.78.txt
Complete server script Net-TacacsPlus/examples/server.pl.
Net-TacacsPlus/examples/server.pl
To install POE::Component::Server::TacacsPlus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::Server::TacacsPlus
CPAN shell
perl -MCPAN -e shell install POE::Component::Server::TacacsPlus
For more information on module installation, please visit the detailed CPAN module installation guide.