#115 Sending radius ipaddr params with aaa_radius

trunk
closed-accepted
modules (179)
5
2009-11-03
2009-10-26
Alex Massover
No

Hi!

The problem:
______________________
Currently there's no easy way to send IP addresses via ipaddr radius parameters using aaa_radius module.
For example, Login-IP-Host is defined as ipaddr and it expects integer:
modparam("aaa_radius","sets","set1=(Login-IP-Host=$avp(i:10))")
For example if I want to pass 10.11.12.13 I need to have inside $avp(i:10)==168496141, but the most likely scenario that I have the dotted notation ip inside to opensips script.
Converting dotted notation ip to integer using avpops is too long and slow.

The solution:
_______________________________
The patch intoduces {s.ip} transformation:
$avp(s:ip)=”10.11.12.13”;
$avp(i:10)=$(avp(s:ip){s.ip}) # gives 168496141

Now I can natively send Login-IP-Host.

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.

Discussion

  • Alex Massover
    Alex Massover
    2009-10-26

    • milestone: --> 976383
     
  • Alex Massover
    Alex Massover
    2009-10-27

    Solution2 - Against 1.6.0

     
    Attachments
  • Alex Massover
    Alex Massover
    2009-10-27

    • summary: {s.ip} transformation for filling Radius ipaddr params --> Sending radius ipaddr params with aaa_radius
    • labels: --> modules
     
  • Alex Massover
    Alex Massover
    2009-10-27

    I 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)")

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

     
    • assigned_to: nobody --> ironmissy
     
  • I tested and applied the patch.
    Thanks Alex!

    Regards,
    Irina Stanescu

     
    • milestone: 976383 --> trunk
    • status: open --> closed-accepted