Subject: | Support for Radius-Initiated-Disconnect (rfc3576) |
Hi,
i've applied a patch to support Disconnect-Request's as in RFC3576, some info is also available at http://www.juniper.net/techpubs/software/erx/junose52/swconfig-broadband/html/radius-disconnect-config4.html
I'd be happy if you could include this into your module.
Regards
Stephan Jaeger
diff -urN Authen-Radius-0.12.orig/Radius.pm Authen-Radius-0.12/Radius.pm
--- Authen-Radius-0.12.orig/Radius.pm 2004-12-18 05:46:44.000000000 +0100
+++ Authen-Radius-0.12/Radius.pm 2005-06-09 10:37:57.484787059 +0200
@@ -30,7 +30,8 @@
@ISA = qw(Exporter);
@EXPORT = qw(ACCESS_REQUEST ACCESS_ACCEPT ACCESS_REJECT
- ACCOUNTING_REQUEST ACCOUNTING_RESPONSE ACCOUNTING_STATUS);
+ ACCOUNTING_REQUEST ACCOUNTING_RESPONSE ACCOUNTING_STATUS
+ DISCONNECT_REQUEST DISCONNECT_ACK DISCONNECT_NAK);
$VERSION = '0.12';
my (%dict_id, %dict_name, %dict_val, %dict_vendor_id, %dict_vendor_name );
@@ -53,6 +54,9 @@
use constant ACCOUNTING_REQUEST => 4;
use constant ACCOUNTING_RESPONSE => 5;
use constant ACCOUNTING_STATUS => 6;
+use constant DISCONNECT_REQUEST => 40;
+use constant DISCONNECT_ACK => 41;
+use constant DISCONNECT_NAK => 42;
sub new {
my $class = shift;
@@ -102,7 +106,7 @@
my $length = 20 + length($self->{'attributes'});
$self->set_error;
- if ($type == ACCOUNTING_REQUEST) {
+ if ($type == ACCOUNTING_REQUEST || $type == DISCONNECT_REQUEST) {
$self->{'authenticator'} = "\0" x 16;
$self->{'authenticator'} =
$self->calc_authenticator($type, $request_id, $length)
@@ -523,7 +527,8 @@
Packs up a Radius packet based on the current secret & attributes and
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>' and 'C<ACCOUNTING_RESPONSE>'.
+'C<ACCESS_REJECT>', 'C<ACCOUNTING_REQUEST>', 'C<ACCOUNTING_RESPONSE>',
+'C<DISCONNECT_REQUEST>', 'C<DISCONNECT_ACK>' and 'C<DISCONNECT_NAK>'.
Returns the number of bytes sent, or undef on failure.
=item recv_packet