Freeradius, custom vars and sql queries in sites-enabled/dhcp
Hello I'm using freeradius 2.1.9 Trying to setup dhcp server. There is no problem with dhcp + rlm_perl. But i want to speed up the server - do all the things with dhcp+rlm_sql. But i'm complicated doing this. For example, i need to parse several conditions, regarding to sql queries results. I'm confusing in how to use custom vars and custom sql queries in sites-enabled/dhcp ? i.e. i need somthing like this pseudocode: dhcp DHCP-Discover { ......... sql MYVAR := "%{sql: select blahblahblah}" ......... if(myvar >= xxx) { MYVAR2 := "%{sql:select blah blah2 blah3}" } } My question is how to do all this correct? =) Thx for help -- BRGS, Ilya A. Masandilov IP-Home.Net
Wingman wrote:
For example, i need to parse several conditions, regarding to sql queries results. I'm confusing in how to use custom vars and custom sql queries in sites-enabled/dhcp ? i.e. i need somthing like this pseudocode:
dhcp DHCP-Discover {
......... sql MYVAR := "%{sql: select blahblahblah}"
See "man unlang". You need to put the attribute into an "update" section. And you can't specify random names for "variables". They aren't variables, they are attributes with pre-defined types. See raddb/dictionary. Alan DeKok.
Hmm, only one more question Is there a sense to try to build functionality without rlm_perl? I mean, is there a strong performance difference between rlm_perl and native freeradius, especially in production usage? Вы писали 2 июня 2010 г., 10:31:53:
Wingman wrote:
For example, i need to parse several conditions, regarding to sql queries results. I'm confusing in how to use custom vars and custom sql queries in sites-enabled/dhcp ? i.e. i need somthing like this pseudocode:
dhcp DHCP-Discover {
......... sql MYVAR := "%{sql: select blahblahblah}"
See "man unlang". You need to put the attribute into an "update" section.
And you can't specify random names for "variables". They aren't variables, they are attributes with pre-defined types. See raddb/dictionary.
Alan DeKok.
-- С уважением, Масандилов Илья Руководитель IT-отдела ООО "КДМС" mailto:wingman@ip-home.net (495) 585-0-737 доб. #666
participants (2)
-
Alan DeKok -
Wingman