unlang tmp-integer multiply or divide

Dinesh Bhardwaj dinesh at airjaldi.net
Fri Aug 26 17:21:11 CEST 2016


There has been a typo in line 3
Tmp-Integer-6 := "%{expr:%{Tmp-Integer-1} * %{Tmp-Integer-3}}"
instead of above the correct line is
Tmp-Integer-6 := "%{expr:%{Tmp-Integer-5} * %{Tmp-Integer-3}}"

Debug output is

? Evaluating ("%{Tmp-Integer-1}" < "%{Tmp-Integer-2}") -> FALSE
++? if ("%{Tmp-Integer-1}" < "%{Tmp-Integer-2}") -> FALSE
++- entering else else {...}
        expand: 4294967296 * %{Tmp-Integer-3} -> 4294967296 * 2
        expand: %{expr:4294967296 * %{Tmp-Integer-3}} -> 8589934592
        expand: %{Tmp-Integer-5} * %{Tmp-Integer-3} ->  * 2
        expand: %{expr:%{Tmp-Integer-5} * %{Tmp-Integer-3}} -> 0
        expand: 4294967296 - %{Tmp-Integer-1} -> 4294967296 - 2229645860
        expand: %{expr:4294967296 - %{Tmp-Integer-1}} -> 2065321436

Thanks,



On Fri, Aug 26, 2016 at 8:34 PM, Arran Cudbard-Bell <
a.cudbardb at freeradius.org> wrote:

>
> > On 26 Aug 2016, at 16:56, Dinesh Bhardwaj <dinesh at airjaldi.net> wrote:
> >
> > Hi,
> >
> > I need to multiply two tmp-integers but not getting it to work
> > Here is my code
> >
> > Tmp-Integer-4 := "1"
> > Tmp-Integer-5 := "%{expr:4294967296 * %{Tmp-Integer-3}}"
> > Tmp-Integer-6 := "%{expr:%{Tmp-Integer-1} * %{Tmp-Integer-3}}"
> >
> > number 1 and 2 works 3 doesnt.
>
> Debug output?
>
>
> Arran Cudbard-Bell <a.cudbardb at freeradius.org>
> FreeRADIUS Development Team
>
> FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
>
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/
> list/users.html
>



-- 
Dinesh Bhardwaj
Chief Technology Officer
Rural Broadband Pvt. Ltd.
www.airjaldi.com
Tel. (91) 985-757-0709
Skype: dineshbhardwaj


More information about the Freeradius-Users mailing list