The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::Radius::Server::Rule - Rules for Net::Radius::Server

SYNOPSIS

use Net::Radius::Server::Rule;
my $rule = new Net::Radius::Server::Rule({
  match_methods => \@match_methods,
  set_methods => \@set_methods,
});

# Deep within the bowels of a RADIUS server...
my $ret = $rule->eval(\%info);
...

DESCRIPTION

Net::Radius::Server::Rule implements a simple mechanism to evaluate RADIUS request packets using match methods. After the match methods determine that the given rule applies to the request, the set methods can modify a response packet to be sent to the RADIUS client.

Evaluation and application of the rule is done by the ->eval() method. This is normally invoked within the server code. \%info is a hashref with the same structure described in Net::Radius::Server.

The following attributes are available for object creation or manipulation via accessors created with Class::Accessor:

match_methods

A reference to a list of match methods to be invoked in order. All the provided methods must match (ie, return NRS_MATCH_OK) in order for the rule to be applied.

set_methods

A reference to a list of match methods to be invoked in order, in case the rule can be applied to the current request. The return value of the last set method executed will be returned by the ->eval() method.

If no set methods are specified, Net::Radius::Server::Rule returns NRS_SET_DISCARD by default.

description

This attribute is inherited, and allows for the specification of a name for this rule. Defaults to the class, file and line where this rule has been created.

The return value of the ->eval() method is defined by the last set method executed. undef is returned if the rule did not match.

EXPORT

None by default.

HISTORY

$Log$
Revision 1.7  2006/12/14 16:33:17  lem
Rules and methods will only report failures in log level 3 and
above. Level 4 report success and failure, for deeper debugging

Revision 1.6  2006/12/14 15:52:25  lem
Fix CVS tags

SEE ALSO

Perl(1), Class::Accessor(3), Net::Radius::Server(3).

AUTHOR

Luis E. Muñoz, <luismunoz@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Luis E. Muñoz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl 5.8.6 itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 146:

Non-ASCII character seen before =encoding in 'Muñoz,'. Assuming UTF-8