(RADIATOR) More questions!

Hugh Irvine hugh at open.com.au
Tue Aug 21 20:29:51 CDT 2007


Hello Adam -

I may have misunderstood exactly what you want to do.

 From what you show below, it would be easier to do something like  
this in your configuration file:

.....

	<AuthBy SQL>
		......
		AuthSelect select PASSWORD, IP from SUBSCRIBERS \
			where USERNAME = %0
		AuthColumnDef 0, Password, check
		AuthColumnDef 1, Framed-IP-Address, reply

		AddToReply Framed-IP-Netmask = 255.255.255.255

		.....
	</AuthBy>

.....

The hook code you show below is adding the attributes to the request,  
not the reply (only the request is availabe to the hook).

If you do want to use a hook to do more complicated things, you could  
use something like this to copy the attributes from the request to  
the reply:


.....
	<AuthBy SQL>
		......
		# copy attributes from the request to the reply
		AddToReply Framed-IP-Address = %{Framed-IP-Address}, \
			Framed-IP-Netmask = %{Framed-IP-Netmask}
	</AuthBy>
.....

hope that helps

regards

Hugh



On 22 Aug 2007, at 07:27, Adam Armstrong wrote:

> Hugh Irvine wrote:
>>
>> Hello Adam -
>>
>> You can use hooks in your Radiator configuration file to do  
>> whatever special processing you require.
>>
>> There are many example hooks in "goodies/hooks.txt" in the  
>> Radiator distribution.
> Aha!
>
> I'm not a perl person, but i think maybe be able to work out how to  
> do it...
>
>        PostAuthSelectHook sub{ \
>                       my($self,$name,$p,$user,$row)=@_;\
>                       my $ip = $row->[3];\
>                       if($ip) {\
>                          &main::log($main::LOG_INFO,"IP : $ip");\
>                          $_[2]->add_attr('Framed-IP-Address', "$ip");\
>                          $_[2]->add_attr('Framed-IP-Netmask',  
> "255.255.255.255");\
>                       }\
>                 }
>
>
> This adds a log entry when it sees an IP address, but it doesn't  
> add an attribute? Can i add an attribute here?
>
> Can I store the IP information somewhere (i don't really understand  
> perl variables, just seems like crazy punctuated voodoo too me!) to  
> use later on, in a PostAuthHook?
>
> Thanks,
> adam
>
> --
> 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:

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

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
Includes support for reliable RADIUS transport (RadSec),
and DIAMETER translation agent.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.


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