Re: Unlang Condition Wrong Value !

2011-08-09 Thread Suman Dash
Hi Arran, I think i have managed to make the datacounter working. It may not be the best counter but it is the best i have ever done in freeradius. Below posted is the configs : Post-Auth { sql # Unlang Data-Counter. Sends Mikrotik-Recv-Limit to NAS update control {

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Arran Cudbard-Bell
On 8 Aug 2011, at 16:29, Suman Dash wrote: > Just another small question before i jump into testing. If output from > sub-query is less than 32bit, I can easily store it in Tmp-Integer , > But sometimes when the user data usage is null, the sub-query will > output more than 32bit ex. 10GB Limit B

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Suman Dash
Just another small question before i jump into testing. If output from sub-query is less than 32bit, I can easily store it in Tmp-Integer , But sometimes when the user data usage is null, the sub-query will output more than 32bit ex. 10GB Limit But user downloaded 0 Bytes. In that condition it is

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Arran Cudbard-Bell
On 8 Aug 2011, at 16:11, Suman Dash wrote: > So what you say is that i do all comparision within sql sub-query and > whatever output i need to define if less than 32bit store it into an > Integer and do Unlang control / reply updates ? > > Seems quite right .. Will try and get back with results.

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Suman Dash
So what you say is that i do all comparision within sql sub-query and whatever output i need to define if less than 32bit store it into an Integer and do Unlang control / reply updates ? Seems quite right .. Will try and get back with results. Thanks for the tip.. Regards Suman On Mon, Aug 8, 2

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Arran Cudbard-Bell
> Unfortunately I am not much of a programmer . Ok... but you know SQL right? Which is why i'm suggesting to do the comparison in the SQL database. > Therefore if you can put > some examples / pointers based on my requirement, it will be a > headstart for me . http://dev.mysql.com/doc/refman/5

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Arran Cudbard-Bell
On 8 Aug 2011, at 11:32, Arran Cudbard-Bell wrote: > > On 8 Aug 2011, at 11:09, Suman Dash wrote: > >> What i mean to say is that i am not using an integer to store the >> value as integer is limited to 32bit, Instead i am directly comparing >> output from sql query in Unlanf but it doesn't see

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Suman Dash
Hi Arran, Unfortunately I am not much of a programmer . Therefore if you can put some examples / pointers based on my requirement, it will be a headstart for me . I had also read somewhere that if we can strip the last 3 octet then atleast 4TB of traffic can be managed in replying back . However,

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Suman Dash
Undermentioned is the complete config. This is a direct approach without storing the results in Tmp-Integer . I assume that this direct approach has nothing to do with 32bit length of Freeradius Attributes. What i am looking to accomplish is a data counter which does not wraps at 4GB, Checks wheth

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Arran Cudbard-Bell
On 8 Aug 2011, at 11:09, Suman Dash wrote: > What i mean to say is that i am not using an integer to store the > value as integer is limited to 32bit, Instead i am directly comparing > output from sql query in Unlanf but it doesn't seems to work either. Then no. AFAIK FreeRADIUS doesn't support

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Suman Dash
What i mean to say is that i am not using an integer to store the value as integer is limited to 32bit, Instead i am directly comparing output from sql query in Unlanf but it doesn't seems to work either. It returns false where it should be returning true. Regards On Mon, Aug 8, 2011 at 2:27 PM,

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Arran Cudbard-Bell
On 8 Aug 2011, at 09:32, Suman Dash wrote: > So it is not possible to store values more than 32 bit in Tmp-Integer. > How about direct sql statements in Unlang not involving the > Tmp-Integer. It is also not working in my scenario. > You mean a comparison of two integers from two SQL statements

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Suman Dash
So it is not possible to store values more than 32 bit in Tmp-Integer. How about direct sql statements in Unlang not involving the Tmp-Integer. It is also not working in my scenario. Attached is the logs. Going to the next request Ready to process requests. rad_recv: Access-Request packet from h

Re: Unlang Condition Wrong Value !

2011-08-08 Thread Arran Cudbard-Bell
RFC 2865: integer 32 bit unsigned value, most significant octet first. FreeRADIUS is just a RADIUS server, and the temporary integer attributes are just RADIUS attributes. -Arran On 8 Aug 2011, at 09:11, Suman Dash wrote: > I am trying to replace sqlcounter with Unland expression in

Unlang Condition Wrong Value !

2011-08-08 Thread Suman Dash
I am trying to replace sqlcounter with Unland expression in Post Auth Section. The values are successfully called but while storing in Tmp-Interger those are stripped. Below are the logs . As you can see from the logs that Mysql returns a value of 20989570594 But it's stored as 3557549056 for Tmp-I