(RADIATOR) How to pass arguments to hook?
Jan Tomasek
jan at tomasek.cz
Thu Aug 3 09:42:43 CDT 2006
Hello,
I'm writing hook used in NoReplyHook which implements better fallback to
backup servers. I need somehow pass arguments to that hook, but I'm
unable to find elegant way. At this moment I'm using:
<Handler>
# This is infact configuration for NoReplyHook used later
PreAuthHook sub { \
$main::dead_realm_timeout = 5*60; \
@main::dead_realm_servers = ('r1nren.etest.cesnet.cz', \
'r2nren.etest.cesnet.cz'); };
<AuthBy RADIUS>
RetryTimeout 1
Retries 0
FailureBackoffTime 0
NoReplyHook file:"/etc/radiator/chose-server.pl"
</AuthBy>
AddToReplyIfNotExist Tunnel-Private-Group-ID=1:100
AddToReply Tunnel-Type=1:VLAN,\
Tunnel-Medium-Type=1:Ether_802
</Handler>
It works, but it's not nice, it's abusing of PreAuthHook and code is
called every time this Handler is executed. Is there better way?
I wan't to use 'choose-server.pl' hook on mupltiple Handlers but I wish
to pass to it diferent list of servers to choose from.
Thanks for any sugestion on this
--
-----------------------
Jan Tomasek aka Semik
http://www.tomasek.cz/
--
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