How to Pass multiple Attribute Value Pair of Same Name.
Hi Guys, i am using FreeRADIUS Version 3.0.3 and using perl module when i pass single Attribute to perl script like ie. ( $RAD_CHECK{' Account-Info'} ) .i can get all the values of this variable available in the perl for processing. but when i am trying to pass multiple variable of same name i am not getting those values pass to perl script. in the DB i have following entries Account-Info = "AInternet-Sevice" Account-Info = "NBoD-2Meg" i gone through doc but i am missing something i guess kindly guide me what i am missing . also in previous version of radius 2.2.x . when using perl module i can simply print any variable with print command and variable name. how can i achieve same in this new version of radius. Regards Amit B.
when i pass single Attribute to perl script like ie. ( $RAD_CHECK{' Account-Info'} ) .i can get all the values of this variable available in the perl for processing.
but when i am trying to pass multiple variable of same name i am not getting those values pass to perl script.
You push them into a array... push(@avpairs,'ip:dns-servers=$dns1 $dns2'); push(@avpairs,"ip:route=$$thisroute{network} $$thisroute{subnet}"); $RAD_REPLY{'Cisco-AVPair'}=\@avpairs; Another one of those undocumented rlm_perl magic 'this is just how it works' things :-)
Thanks guys i will try this and update. @Chris : you right i didnt find any documents for this. Regards Amit B. On Tue, Apr 28, 2015 at 12:29 PM, Chris Knipe <savage@savage.za.org> wrote:
when i pass single Attribute to perl script like ie. ( $RAD_CHECK{' Account-Info'} ) .i can get all the values of this variable available in the perl for processing.
but when i am trying to pass multiple variable of same name i am not getting those values pass to perl script.
You push them into a array...
push(@avpairs,'ip:dns-servers=$dns1 $dns2'); push(@avpairs,"ip:route=$$thisroute{network} $$thisroute{subnet}"); $RAD_REPLY{'Cisco-AVPair'}=\@avpairs;
Another one of those undocumented rlm_perl magic 'this is just how it works' things :-) - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 28-04-15 08:46, Amit Butere wrote:
Hi Guys, i am using FreeRADIUS Version 3.0.3 and using perl module
when i pass single Attribute to perl script like ie. ( $RAD_CHECK{' Account-Info'} ) .i can get all the values of this variable available in the perl for processing.
but when i am trying to pass multiple variable of same name i am not getting those values pass to perl script.
in the DB i have following entries
Account-Info = "AInternet-Sevice"
Account-Info = "NBoD-2Meg" i gone through doc but i am missing something i guess kindly guide me what i am missing .
You get them as an arrayref, which means you can do things like this: for my $account_info (@{ $RAD_CHECK{'Account-Info'} }) { radiusd::radlog(L_DBG, "Account info value: $account_info"); }
also in previous version of radius 2.2.x . when using perl module i can simply print any variable with print command and variable name. how can i achieve same in this new version of radius.
The `radiusd::radlog` command (see the example above) prints to the log of FreeRADIUS, but I'm not sure I understood this question correctly. -- Herwin Weststrate
participants (3)
-
Amit Butere -
Chris Knipe -
Herwin Weststrate