NAME

POE::Component::Server::TacacsPlus - POE Tacacs+ server component

SYNOPSIS

        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;
        }

DESCRIPTION

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.

FUNCTIONS

spawn

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

server_start

Component _start function.

server_stop

Component _stop function.

accept_new_client

On client connect setup function. Will setup POE::Session to handle client input using child_* function.

accept_failed

Tidy up and print out error message if accept failed.

child_start

Setup POE::Wheel::ReadWrite with POE::Filter::TacacsPlus so that child_input will receive directly Net::TacacsPlus::Packet objects as input.

child_stop

Just print out the debug message that the child is finished.

child_input

Process incomming Net::TacacsPlus::Packet and call propper handler.

child_done

Cleanup after child is done.

child_error

Print out error and do cleanup.

SEE ALSO

tac-rfc.1.78.txt

Complete server script Net-TacacsPlus/examples/server.pl.