[OpenSIPS-Users] FW: aaa_radius and ipaddr type

Alex Massover alex at jajah.com
Tue Oct 27 14:10:24 CET 2009


Hi!

I remove a first patch with transformation and added a patch implementing solution #2, it will allow directly assigning dotted notation ip variables to ipaddr radius types, like following:

modparam("aaa_radius","sets","set1=(Login-IP-Host=$si)")

or

modparam("aaa_radius","sets","set1=(Login-IP-Host=$avp(s:ip))")





The patch is also more clean than the first one, so I removed the first one.


--
Best Regards,
Alex Massover
VoIP R&D TL
Jajah Inc.
From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Alex Massover
Sent: Monday, October 26, 2009 3:08 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] aaa_radius and ipaddr type

Hi Irina!

So currently there's no way to directly fill ipaddr radius attributes using aaa_radius module :(
For example if I want to send $si to Login-IP-Host, I can't do it in easy way.

I did a small patch, introducing {s.ip} transformation, that converts a string avp with dotted notation ip  to integer representation of ip:
$avp(s:ip)="10.11.12.13";
$avp(i:10)=$(avp(s:ip){s.ip})   # gives 168496141

Now, If I have set1 defined like following:
modparam("aaa_radius","sets","set1=(Login-IP-Host=$avp(i:10))")
the IP is sent correctly.

The patch :

https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2886450&group_id=232389



Another possible solution:

is to automatically and implicitly convert strings to int somewhere inside aaa_radius.c, for example if I do:

modparam("aaa_radius","sets","set1=(Login-IP-Host=$si)")

the module can check if Login-IP-Host is ipaddr then convert $si to int and only then to send it.



--
Best Regards,
Alex Massover
VoIP R&D TL
Jajah Inc.
From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Irina Stanescu
Sent: Monday, October 26, 2009 11:33 AM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] aaa_radius and ipaddr type

Hi Alex,

The type for the Login-IP-Host attribute is ipaddr, which means 4 octets in network byte order.
I hope this helps.

Regards,

Irina Stanescu
On Sun, Oct 25, 2009 at 12:21 PM, Alex Massover <alex at jajah.com<mailto:alex at jajah.com>> wrote:
Hi!

I wonder is it possible to send IP address with radius_send_auth(set1,set2). For example I want to send Login-IP-Host inside set1.
Login-IP-Host is ipaddr type, configured in the dictionary like this:
ATTRIBUTE       Login-IP-Host           14      ipaddr
Let's say I have the desired value in $avp(s:ip) like a string. If I put inside set1 like this: Login-IP-Host=$avp(s:ip), I get a wrong value in the radius message. If I convert it to int I also get a wrong value.

Is there a way to correctly pass ipaddr radius attribute with aaa_radius?

--
Best Regards,
Alex Massover
VoIP R&D TL
Jajah Inc.


This mail was sent via Mail-SeCure System.

_______________________________________________
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


This mail was received via Mail-SeCure System.


This mail was sent via Mail-SeCure System.


This mail was received via Mail-SeCure System.

This mail was sent via Mail-SeCure System.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20091027/20977cf8/attachment-0001.htm 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001.txt
Url: http://lists.opensips.org/pipermail/users/attachments/20091027/20977cf8/attachment-0001.txt 


More information about the Users mailing list