perl examples
Alex Sharaz
alex.sharaz at york.ac.uk
Mon Apr 8 15:10:22 CEST 2013
On 8 Apr 2013, at 13:32, A.L.M.Buxey at lboro.ac.uk wrote:
> Hi,
>
>> There don't seem to be many examples relating to using perl to access remote databases…. in fact there don't seem to be many perl examples at all.
>
> thats because its a PERL issue not a FreeRADIUS one :-)
>
:-))
but its perl being used within Freeradius (he says batting the ball over then)
>> In post-auth I want to
>>
>> extract the nas-ip address and calling station-id of the client device
>> open a db connection and perform a query that'll let me decide what vlan-id to send back in the access-accept packet
>> write radius attributes into the access-accept reply
>
> you need to use DBI PERL to open the connection and then create the query.
> for the query you can use values straight from the FreeRADIUS PERL hook - or assign
> them to variables and use those variables, then run the query and look at
> the results. of course, you will need to verify that the connection was okay,
> that the query was okay and that the results are okay.
>
o.k. can do much of that. \
>> Anyone got some form of template I could use for the above?
>
> each case requires new code....but a quick Google will show you how to do the DB query
> stuff...I can provide you some templte for assigning variables
That would be great if you could
Rgds
Alex
>
> alan
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list