Calling a module name from a dynamic variable

Franks Andy (IT Technical Architecture Manager) Andy.Franks at sath.nhs.uk
Thu Nov 5 16:15:07 CET 2015


Ok, that settles it, thought as much - I've done some code for switch/case now.
Just one last question - if we previously had something like:

Auth-type inner-eap {
  Inner-eap {
   reject = 1
   ok = 1
    invalid = 1
  }
  If (!ok) {
  ..
  }
}

The question is if I did a switch statement :

Auth-type inner-eap {
  Switch (somevar) {
    Case somevalue {
      Custom-inner-eap {
        Reject =1
        Ok = 1
        Invalid = 1
      }
     Case someothervalue {
      Custom-other-inner-eap {
        Reject =1
        Ok = 1
        Invalid = 1
      }
   }
 } 
 If (!ok) {
    ..
  }
}

Does the !ok bit still belong to whatever module is called in the switch statement? I guess so, but wanted to make sure the ok doesn't belong to the switch/case block.

Thanks


-----Original Message-----
From: Freeradius-Users [mailto:freeradius-users-bounces+andy.franks=sath.nhs.uk at lists.freeradius.org] On Behalf Of Arran Cudbard-Bell
Sent: 05 November 2015 14:53
To: FreeRadius users mailing list
Subject: Re: Calling a module name from a dynamic variable


> On Nov 5, 2015, at 9:47 AM, Franks Andy (IT Technical Architecture Manager) <Andy.Franks at sath.nhs.uk> wrote:
> 
> It's an SQL "named" module, just logs results from post-auth.
> Its name is really sql-radius-lan0 or sql-radius-lan1 or whatever, depending on certain circumstances.


You can't do that and with the way the code is structured it'd be very hard to support that.

Use switch and enumerate the possible modules you want to call.

-Arran



More information about the Freeradius-Users mailing list