



Annotate this POD


New  1
Open  1
View/Report Bugs
Module Version: 1.075   Source  


Net::Radius::Server::Match - Base class for match methods


  package My::Radius::Match;
  use base 'Net::Radius::Server::Match';


  sub match_foo { ... }
  sub match_bar { ... }
  sub match_baz { ... }

  # Meanwhile, in a configuration file nearby...
  my $match = My::Radius::Match->new({ foo => 'x', bar => 'y' });
  my $match_sub = $match->mk;

  # Alternatively, in a more compact notation...
  my $match_sub = My::Radius::Match->mk({ foo => 'x', bar => 'y' });


Net::Radius::Server::Match is a base class for developing "match" methods to be used in Net::Radius::Server rules.


Creates a new Net::Radius::Server::Match object. $hashref referenes a hash with the attributes that will apply to this object, so that multiple match methods (that will share the same underlying object) can be created and given to different rules.


This method returns a sub suitable for calling as a match method for a Net::Radius::Server rule. The resulting sub will return either NRS_MATCH_OK or NRS_MATCH_FAIL depending on its result.






This method tries to invoke $self-match_$element(@_)>, passing the same arguments it receives - Note that normally, those are the same that were passed to the sub returned by the factory.

See the source of Net::Radius::Server::Match::Simple. This is much simpler than it sounds. Really.

The calls are done in "short circuit". This means that the first method returning NRS_MATCH_FAIL will cause this result to be returned.

Arguments with no corresponding match_* method are ignored. Arguments whose name start with "_" are also ignored.

By default, this method will return NRS_MATCH_OK.

Methods to Provide in Derived Classes




None by default.


  Revision 1.6  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.5  2006/12/14 15:52:25  lem
  Fix CVS tags




Luis E. MuÃ±oz, <>


Copyright (C) 2006 by Luis E. MuÃ±oz


syntax highlighting: