Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Net::Radius::Server::MUser:Contributed PeNet::Radius::Server::Match::Simple(3)

NAME
       Net::Radius::Server::Match::Simple - Simple match methods for RADIUS
       requests

SYNOPSIS
	 use Net::Radius::Server::Match::Simple;

	 my $match = Net::Radius::Server::Match::Simple->new
	   ({
	     code => 'Access-Request',
	     attr => [
	       'User-Name' => qr/(?i)\@my\.domain\.?$/,
	       'NAS-IP-Address'	=> NetAddr::IP->new('127.0.0.0/24'),
	       'Framed-Protocol' => 'PPP',
	     ],
	   });
	 my $match_sub = $match->mk;

DESCRIPTION
       "Net::Radius::Server::Match::Simple" implements simple but effective
       packet matcher method factories for use in "Net::Radius::Server"	rules.

       See "Net::Radius::Server::Match"	for general usage guidelines. The
       relevant	attributes that	control	the matching of	RADIUS requests	are:

       "attr"
	   Controls matching of	a given	attribute in the request packet. Must
	   be called with a listref where even elements	represent the name of
	   a RADIUS attribute to match.	The odd	elements can be	any of the
	   following:

	   o   A scalar, in which case an exact	match with the attribute
	       contents	must occur for this method to return "NRS_MATCH_OK".

	   o   A regexp, in which case the attribute's content must match the
	       regexp for this method to return	"NRS_MATCH_OK".

	   o   A "NetAddr::IP" subnet, in which	case the attribute matches if
	       its value can be	converted to a "NetAddr::IP" object and	it is
	       contained in the	given subnet. This is very useful to perform
	       sanity check on your RADIUS requests.

	   All the conditions specified	in this	way must match in order	for
	   the method to return	"NRS_MATCH_OK".	Otherwise, "NRS_MATCH_FAIL"
	   will	be returned.

	   This	would match if the User-Name attribute in the RADIUS request
	   contains a (case insensitive) "@foo.domain" realm AND the NAS-IP-
	   Address attribute contains '127.0.0.1'.

       "code"
	   Matches the RADIUS packet code. The following types of attributes
	   can be specified:

	   o   A scalar, in which case an exact	match with the code must occur
	       for this	method to return "NRS_MATCH_OK".

	   o   A regexp, in which case the code's name must match the regexp
	       for this	method to return "NRS_MATCH_OK".

	   See Net::Radius::Packet(3) for more information on atribute and
	   type	representation.

       "peer_addr" and "addr"
	   Match the address of	either the peer	or the local socket used to
	   receive the request.	The following specifications can be used for
	   the match:

	   o   A scalar, in which case an exact	match with the address must
	       occur for this method to	return "NRS_MATCH_OK".

	   o   A regexp, in which case the address must	match the regexp for
	       this method to return "NRS_MATCH_OK".

	   o   A "NetAddr::IP" subnet, in which	case the address matches if
	       its value can be	converted to a "NetAddr::IP" object and	it is
	       contained in the	given subnet.

       "peer_port" and "port"
	   Match the port of either the	peer or	the local socket used to
	   receive the request.	The following specifications can be used for
	   the match:

	   o   A scalar, in which case an exact	match with the port must occur
	       for this	method to return "NRS_MATCH_OK".

	   o   A regexp, in which case the port	must match the regexp for this
	       method to return	"NRS_MATCH_OK".

	   Note	that ports are usually numeric (ie, 1812 instead of
	   "radacct").

   EXPORT
       None by default.

HISTORY
	 $Log$
	 Revision 1.3  2006/12/14 15:52:25  lem
	 Fix CVS tags

SEE ALSO
       Perl(1),	NetAddr::IP(3),	Net::Radius::Server(3),
       Net::Radius::Server::Match(3), Net::Radius::Packet(3).

AUTHOR
       Luis E. MuA+-oz,	<luismunoz@cpan.org>

COPYRIGHT AND LICENSE
       Copyright (C) 2006 by Luis E. MuA+-oz

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

POD ERRORS
       Hey! The	above document had some	coding errors, which are explained
       below:

       Around line 364:
	   Non-ASCII character seen before =encoding in	'MuA+-oz,'. Assuming
	   UTF-8

perl v5.24.1			  2009-09Net::Radius::Server::Match::Simple(3)

NAME | SYNOPSIS | DESCRIPTION | HISTORY | SEE ALSO | AUTHOR | COPYRIGHT AND LICENSE | POD ERRORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Net::Radius::Server::Match::Simple&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help