NAME

AnyEvent::Radius::Server - module to implement AnyEvent based RADIUS server

SYNOPSYS

use AnyEvent;
use AnyEvent::Radius::Server;

sub radius_reply {
    # $h is hash-ref { request_id, type, av_list }
    my ($self, $h) = @_;
    ...
    return ($reply_type, $reply_av_list);
}

my $dict = AnyEvent::Radius::Server->load_dictionary('radius/dictionary');

my $server = AnyEvent::Radius::Server->new(
                ip => $ip,
                port => $port,
                read_timeout => 60,
                on_read => \&radius_reply,
                dictionary => $dict,
                secret => 'topsecret',
            );
AnyEvent->condvar->recv;

DESCRIPTION

The AnyEvent::Radius::Server module allows to handle RADIUS requests in non-blocking way

CONSTRUCTOR

new (...options hash ...)
ip - listen on ip, mandatory
port - listen on port (default 1812)
secret - RADIUS secret string
dictionary - optional, dictionary loaded by load_dictionary() method
on_read - called with parsed packed, in hash-ref {type, request_id, av_list, from}
on_read_raw - called with raw binary packet as an argument
on_wrong_request - received packet is not of request type (no reply sent)
on_error - low-lever socket error occured

METHODS

load_dictionary ($dictionary-file)

Class method to load dictionary - returns the object to be passed to constructor

SEE ALSO

AnyEvent::Radius::Client

AUTHOR

Sergey Leschenko <sergle.ua at gmail.com>

PortaOne Development Team <perl-radius at portaone.com> is the current module's maintainer at CPAN.