radclient / perl, slightly OT

Chris Knipe savage at savage.za.org
Tue May 13 09:16:51 CEST 2014


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.




More information about the Freeradius-Users mailing list