Skip Menu |

This queue is for tickets about the Authen-Radius CPAN distribution.

Report information
The Basics
Id: 55486
Status: resolved
Priority: 0/
Queue: Authen-Radius

People
Owner: PORTAONE [...] cpan.org
Requestors: benh [...] swimfrog.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.25



Subject: Support for FreeRADIUS Status_Server (Type 12)
Date: Thu, 11 Mar 2010 15:30:20 -0800
To: bug-RadiusPerl [...] rt.cpan.org
From: Ben Hawkins <benh [...] swimfrog.com>
I've attached a small patch that adds a few things so that status_server on FreeRADIUS will work. status_server provides a monitoring interface so that you can see what kinds of requests/responses have been processed. See http://wiki.freeradius.org/Status I'm building the request like: my $radius_request = new Authen::Radius( Host => $radiushost.":".$p->opts->radiusport, Secret => $p->opts->secret, TimeOut => $p->opts->timeout, Debug => $p->opts->verbose, Rfc3579MessageAuth => 1, ); $radius_request->add_attributes( { 'Name' => 'FreeRADIUS-Statistics-Type', 'Value' => 1, 'Vendor' => 'FreeRADIUS', }, ); $radius_request->send_packet(STATUS_SERVER); I've included a new FreeRADIUS dictionary in the patch that comes from the freeradius distribution with the vendor appended to the end of each ATTRIBUTE, like the other RadiusPerl dictionaries have. I also had to comment out a line so that it did not insert invalid integer descriptions when the number equaled something that was defined for a different vendor. That should probably be fixed. Thanks for a great perl module, it's been very helpful! Ben Hawkins

Message body is not shown because sender requested not to inline it.

From: tbeattie [...] boingo.com
That's good, but in the code example shows the packet type as STATUS_SERVER, while the patch has it defined as SERVER_STATUS. It ought to be STATUS_SERVER to be consistent with the RFC. Also, RFC 5997 requires a Message-Authenticator attribute; it is not optional. Try the attached patch. This is updated against RadiusPerl-0.20. -- Trevin
Subject: perl-Authen-Radius-Status-Server.patch
--- Authen-Radius-0.20/Radius.pm.orig 2010-11-09 22:52:02.000000000 -0800 +++ Authen-Radius-0.20/Radius.pm 2012-03-14 11:38:22.974131647 -0700 @@ -33,9 +33,10 @@ @EXPORT = qw(ACCESS_REQUEST ACCESS_ACCEPT ACCESS_REJECT ACCOUNTING_REQUEST ACCOUNTING_RESPONSE ACCOUNTING_STATUS DISCONNECT_REQUEST DISCONNECT_ACCEPT DISCONNECT_REJECT + STATUS_SERVER COA_REQUEST COA_ACCEPT COA_REJECT COA_ACK COA_NAK); -$VERSION = '0.20'; +$VERSION = '0.2001'; my (%dict_id, %dict_name, %dict_val, %dict_vendor_id, %dict_vendor_name ); my ($request_id) = $$ & 0xff; # probably better than starting from 0 @@ -59,6 +60,7 @@ use constant ACCOUNTING_REQUEST => 4; use constant ACCOUNTING_RESPONSE => 5; use constant ACCOUNTING_STATUS => 6; +use constant STATUS_SERVER => 12; use constant DISCONNECT_REQUEST => 40; use constant DISCONNECT_ACCEPT => 41; use constant DISCONNECT_REJECT => 42; @@ -182,7 +184,8 @@ $self->gen_authenticator unless defined $self->{'authenticator'}; } - if ($self->{'message_auth'} && ($type == ACCESS_REQUEST)) { + if (($self->{'message_auth'} && ($type == ACCESS_REQUEST)) + || ($type == STATUS_SERVER)) { $length += $RFC3579_MSG_AUTH_ATTR_LEN; $data = pack('C C n', $type, $request_id, $length) . $self->{'authenticator'} @@ -890,6 +893,7 @@ Optional parameter C<Rfc3579MessageAuth> with a Perl "true" value turns on generating of Message-Authenticator for Access-Request (RFC3579, section 3.2). +The Message-Authenticator is always generated for Status-Server packets. Optional parameter C<NodeList> may contain a Perl reference to an array, containing a list of Radius Cluster nodes. Each nodes in the list can be specified using a hostname or IP (with an optional @@ -958,7 +962,7 @@ sends it to the server with a Request type of C<REQUEST_TYPE>. Exported C<REQUEST_TYPE> methods are 'C<ACCESS_REQUEST>', 'C<ACCESS_ACCEPT>' , 'C<ACCESS_REJECT>', 'C<ACCOUNTING_REQUEST>', 'C<ACCOUNTING_RESPONSE>', -'C<DISCONNECT_REQUEST>' and 'C<COA_REQUEST>'. +'C<STATUS_SERVER>', 'C<DISCONNECT_REQUEST>', and 'C<COA_REQUEST>'. Returns the number of bytes sent, or undef on failure. If the RETRANSMIT parameter is provided and contains a non-zero value, then