radclient / perl, slightly OT
adrian.p.smith at bt.com
adrian.p.smith at bt.com
Tue May 13 09:43:09 CEST 2014
Not sure how up to date it is, but a first Google hit shows: http://search.cpan.org/~ilya/Net-Radius-Client-0.02/Client.pm
-----Original Message-----
From: freeradius-users-bounces+adrian.p.smith=bt.com at lists.freeradius.org [mailto:freeradius-users-bounces+adrian.p.smith=bt.com at lists.freeradius.org] On Behalf Of Chris Knipe
Sent: 13 May 2014 08:17
To: freeradius-users at lists.freeradius.org
Subject: radclient / perl, slightly OT
Hi All,
I execute radclient from a perl application to send POD requests:
open(RADIUSCLIENT, "| /usr/bin/radclient -c 1 -r 1 " .
$RAD_REQUEST{'NAS-IP-Address'} . ":3799 disconnect secret");
print RADIUSCLIENT "User-Name=" . $RAD_REQUEST{'User-Name'} .
"\n";
print RADIUSCLIENT "NAS-IP-Address=" .
$RAD_REQUEST{'NAS-IP-Address'} . "\n";
print RADIUSCLIENT "Framed-IP-Address=" .
$RAD_REQUEST{'Framed-IP-Address'} . "\n";
print RADIUSCLIENT "Acct-Session-Id=" .
$RAD_REQUEST{'Acct-Session-Id'} . "\n";
close(RADIUSCLIENT);
The above works fine, but I have no idea on how to determine whether the request was sent successfully, or even better, accepted by the NAS. Can someone that perhaps does something similar with radclient & perl perhaps just give me a quick hack on how to call radclient so that it reads the attributes from STDIN, whilst it still allows me to parse all the output in perl?
Ideally for future expansion in terms of functionality, I would want to read the full output from radclient (incl. all attributes returned) back into my perl application.
I do apologize for the for the OT post.
--
Chris.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list