[RADIATOR] preClientHook problem using ClientListSQL from version 3.15 to version 4.3.1
Mike McCauley
mikem at open.com.au
Wed Jan 7 15:39:18 CST 2009
Hi Hugh,
You may want to know that yesterday I added support for having ClientHook in
ClientList SQL and ClientList LDAP, at the request of Redback.
Cheers.
On Thursday 08 January 2009 07:33:28 am Hugh Irvine wrote:
> Hello Dario -
>
> Can you please tell me what problems you are having?
>
> regards
>
> Hugh
>
> On 8 Jan 2009, at 04:49, Dario Aguilar wrote:
> > Hi, first of all I want to clarify that I am a new user of Radiator
> > and my
> > knowledge of Perl language is very poor. We are trying to move from
> > version
> > 3.15 to 4.3.1 and some problems a problem appered to us with the old
> > Global
> > "preClientHook" statement in the new version. How should I call
> > PreClientHook.cfg to work in using ClientListSQL ?. I´ve already
> > finish
> > reading the revision history of versions 4.3 and 4.3.1 and the
> > reference
> > manual but I still have very clear how to implement this in our
> > server.
> >
> > Our radius.conf looks something like this:
> > -------------------------------------------------------------
> > <ClientListSQL>
> > DBSource dbi:Oracle:%{GlobalVar:DBInstance}
> > DBUsername %{GlobalVar:DBUsername}
> > DBAuth %{GlobalVar:DBAuth}
> > DBSource dbi:Oracle:%{GlobalVar:DBInstance}
> > DBUsername %{GlobalVar:DBUsername}
> > DBAuth %{GlobalVar:DBAuth}
> > GetClientQuery SELECT nas_ip_address,secret from
> > tbl_radclient WHERE nas_ip_address IS NOT NULL and secret IS NOT NULL
> > BackupFilename
> > %D/clientlist.%{GlobalVar:CodeType}.%{GlobalVar:IpAddress}.dat
> > RefreshPeriod 3600
> > Timeout 2
> > FailureBackoffTime 0
> > ConnectionHook file:"%D/ConnectionHook.cfg"
> > </ClientListSQL>
> >
> > PreClientHook file:"%D/PreClientHook.cfg"
> > -------------------------------------------------
> >
> > PreClientHook.cfg----->>>
> >
> > sub {
> > my $p=${$_[0]};
> > my $nasip=$p->get_attr('NAS-IP-Address');
> > my $ip=&Radius::Util::format_special('%c', $p);
> > my $nasport=$p->get_attr('NAS-Port');
> > my $callid=$p->get_attr('Calling-Station-Id');
> >
> > &main::log($main::LOG_DEBUG,'Into PreClientHook');
> > &main::log($main::LOG_DEBUG,"NASIP=[$nasip] NASPORT=[$nasport]
> > SOURCE_IP=[$ip] CallId=[$callid]");
> > if($ip ne '192.168.0.1' and $ip ne '192.168.0.2') {
> > $p->change_attr('NAS-IP-Address',$ip) if $nasip ne $ip;
> > }
> >
> > $p->add_attr('NAS-Port',$callid) unless defined $nasport;
> > $p->delete_attr('State');
> > if ($p->code eq 'Accounting-Request' &&
> > $p->get_attr('Acct-Status-Type') eq 'Stop') {
> > my %ascend2ietf = (
> > 'remoteEndHungup' => 'User-Request',
> > 'pppRcvTerminate' => 'User-Request',
> > 'sessTimeOut' => 'Session-Timeout',
> > '240' => 'Host-Request',
> > );
> >
> > my $ascend_disconnect_cause =
> > $p->get_attr('Ascend-Disconnect-Cause');
> > if($ascend_disconnect_cause) {
> > my $newval=
> > $ascend2ietf{$ascend_disconnect_cause};
> > $newval='Lost-Carrier'
> > unless defined $newval;
> > $p->change_attr('Acct-Terminate-Cause',
> > $newval);
> > }
> > }
> > }
> > -------------------------------------------
> >
> > thanks,
> > Dario Aguilar
> > --
> > View this message in context:
> > http://www.nabble.com/preClientHook-problem-using-ClientListSQL-from-vers
> >ion-3.15-to-version-4.3.1-tp21336689p21336689.html Sent from the Radiator
> > - General mailing list archive at Nabble.com.
> >
> >
> > _______________________________________________
> > radiator mailing list
> > radiator at open.com.au
> > http://www.open.com.au/mailman/listinfo/radiator
>
> NB:
>
> Have you read the reference manual ("doc/ref.html")?
> Have you searched the mailing list archive
> (www.open.com.au/archives/radiator)? Have you had a quick look on Google
> (www.google.com)?
> Have you included a copy of your configuration file (no secrets),
> together with a trace 4 debug showing what is happening?
> Have you checked the RadiusExpert wiki:
> http://www.open.com.au/wiki/index.php/Main_Page
--
Mike McCauley mikem at open.com.au
Open System Consultants Pty. Ltd
9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.open.com.au
Phone +61 7 5598-7474 Fax +61 7 5598-7070
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, DIAMETER etc. Full source
on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.
More information about the radiator
mailing list