(RADIATOR) long regular expressions in <Handler>

Hugh Irvine hugh at open.com.au
Tue Oct 8 04:12:07 CDT 2002


Hello Mariano -

I would be inclined to write a StartupHook to read all of this 
information into memory, then I would write a PreClientHook that would 
actually do the number checking and set a pseudo-attribute in the 
incoming request and write my Handlers to look at the pseudo-attribute. 
This would also have the added advantage of being faster to execute.

regards

Hugh


On Tuesday, October 8, 2002, at 05:47 AM, Mariano Absatz wrote:

> Hi Hugh, Mike,
>
> I have a bunch of <Handler>s that catch calls to different phone 
> numbers
> (Called-Station-Id) through a regular expression that is quite large 
> ('bout
> 200 chars) of the form:
> <Handler Called-Station-Id=/1111$|2222$|^1234567$|...lots 
> more...|^5556736$/>
>    AuthBy something
> </Handler>
>
> This works just fine, but it's a little hard to see and mantain...
>
> I was wondering about a couple of things:
>
> 1) Can I use multiline Perl regular expressions with comments using 
> "/x"?
>
> 2) Can I handle this somehow via an include?
>
>
>
> 1) could be something like:
>
> <Handler Called-Station-Id=/1111$          # calling to provider 1
>                            |2222$          # calling to provider 2
>                            |^1234567$      # calling to provider sortie
>                            |...lots more...
>                            |^5556736$      # calling to 555-OPEN
>                            />
>    AuthBy something
> </Handler>
>
> Could this work? Do I have to put the "\" at the end of each line?
>
>
>
> What about option 2)? It would be something similar but maybe written 
> in a
> file and assigned like:
>
> <Handler file:handler1.txt>
>    AuthBy something
> </Handler>
>
> or maybe:
>
> DefineFormattedGlobalVar handler1DNIS file:handler1.txt
>
> <Handler Called-Station-Id=/{GlobalVar:handler1DNIS}/>
>    AuthBy something
> </Handler>
>
>
> or this is totally nuts :-(
>
> TIA.
>
> --
> Mariano Absatz
> El Baby
> ----------------------------------------------------------
> Beware of programmers with screwdrivers.
>
>
> ===
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>
>

NB: I am travelling this week, so there may be delays in our 
correspondence.

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list