(RADIATOR) Pre Handler hook help...

Robert Blayzor noc at inoc.net
Mon Jul 15 11:59:44 CDT 2002


Hugh, I did as you suggested, appears to be a bug with Radiator and the
PERL oct() function.  For some reason Radiator has broken oct()
fucntion.

My Sub I included:

sub {
    print "oct() Test: " . oct("0b0000010110000000") . "\n";
}

Output from Ratiator:

oct() Test: 0


Output from PERL (any other program or right from perl -e):

[shell:~] perl -e 'print oct("0b0000010110000000")."\n";'
1408

What gives?

--
Robert Blayzor, BOFH
INOC, LLC
rblayzor at inoc.net

Advanced design: 
    Upper management doesn't understand it.



> -----Original Message-----
> From: owner-radiator at open.com.au 
> [mailto:owner-radiator at open.com.au] On Behalf Of Hugh Irvine
> Sent: Friday, July 12, 2002 6:12 PM
> To: rblayzor at inoc.net; Robert Blayzor; radiator at open.com.au
> Subject: Re: (RADIATOR) Pre Handler hook help...
> 
> 
> 
> Hello Robert -
> 
> I suggest you do two things:
> 
> 1. put the hook code in a file so it is easier to edit - 
> something like this:
> 
> 	PreHandlerHook file:"%D/nasport.pl"
> 
> 2. unwind the code a bit and add print statements between the 
> statements so 
> you can see what is going on
> 
> Then you can run radiusd from the command line and you will 
> see the print 
> output in the terminal window where you are running it - like this:
> 
> 	radiusd -foreground -log_stdout -config_file .....
> 
> regards
> 
> Hugh
> 
> 
> On Sat, 13 Jul 2002 06:21, Robert Blayzor wrote:
> > We have an handler which uses the following hook:
> >
> > <Client 64.246.152.18>
> >         Identifier              DSL1
> >         Secret                  shhhh
> >         DupInterval             2
> >         NasType                 ignore
> >         PreHandlerHook sub { ${$_[0]}->add_attr('NAS-Port-Type',
> > 'SDSL'); my $i_p = ${$_[0]\
> > }->get_attr('RB-NAS-Real-Port'); my $i_a = 
> sprintf("%s/%s/%s.%s", map
> > oct("0b$_"), unpack("\
> > B32", pack("N", $i_p)) =~ /(.{5})(.{3})(.{8})(.*)/);
> > ${$_[0]}->add_attr('Calling-Station-Id\
> > ', $i_a);}
> > </Client>
> >
> >
> > In a nutshell the Hander basically adds a NAS-Port-Type and 
> is to take a
> > 32bit integer representation of DSL ports and put them in the
> > 'Calling-Station-Id' attribute.
> >
> > The output should come out to be soething like:  5/0/0/233, etc.
> > However everything comes out at 0/0/0.0, like $i_p is null, 
> but it's not
> > because the following code (if I reverse things) works fine...
> >
> >         PreHandlerHook sub { ${$_[0]}->add_attr('NAS-Port-Type',
> > 'SDSL'); my $i_p = ${$_[0]\
> > }->get_attr('RB-NAS-Real-Port');
> > ${$_[0]}->add_attr('Calling-Station-Id', $i_p);}
> >
> >
> > Output the following code right from PERL works fine too:
> >
> > perl -e 'print sprintf("%s/%s/%s.%s", map(oct("0b$_"), unpack("B32",
> > pack("N", 671088873)) =~ /(.{5})(.{3})(.{8})(.*)/)) ."\n";'
> > 5/0/0.233
> >
> >
> > Any ideas?  I really need to get this to work.  Thanks!
> 
> -- 
> 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.
> 

===
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