(RADIATOR) Interesting Request

Hugh Irvine hugh at open.com.au
Mon Aug 22 18:09:42 CDT 2005


Hello Miko -

Would you be agreeable to having this added to the examples in the  
"goodies" directory (with credit to you of course)?

regards

Hugh


On 23 Aug 2005, at 03:02, miko at yournetplus.com wrote:

> Thanks Mike,,, I was able to use the {RecvSocket} reference.
>
> Here is an example of the code I came up with in testing, using a  
> PreProcessingHook to displa the info in a log. The only stipulation  
> on this working tho is that you must use BindAddress and force  
> radiator to bind on the IPs of the machine, allowing it to bind to  
> 0.0.0.0 ends up returning a null for the localipaddress for some  
> reason...
>
> PreProcessingHook sub {                                      \
>  my $p = ${$_[0]};                                           \
>  my $insockaddr = getsockname($p->{RecvSocket});             \
>  my ($inport,$inaddr) = Radius::Util::unpack_sockaddr_in 
> ($insockaddr); \
>  $inaddr = Radius::Util::inet_ntop 
> ($inaddr);                              \
>  &main::log($main::LOG_DEBUG, "LocalAddr: $inaddr, 
> $inport");              \
> }
>
>
> -Miko
>
> <----- Original Message ----->
> From: Mike McCauley <mikem at open.com.au>
> To: "miko at yournetplus.com" <miko at yournetplus.com>
> CC: radiator at open.com.au
> Sent: Friday, August 19, 2005 4:29:13 PM
> Subject: (RADIATOR) Interesting Request
>
>> Hello Miko,
>> On Saturday 20 August 2005 04:09, miko at yournetplus.com wrote:
>>
>>> Does anyone on the list know if there is a way to reference in a  
>>> hook
>>> what IP Address a radius request was sent to on a multihomed  
>>> system???
>>>
>> Hmm, it would be a bit tricky.
>> Each received request has a reference to the socket it was  
>> received on saved in $p->{RecvSocket}. You might be able to get  
>> the information you need with a getsockopt(). Also, all the  
>> current Radius sockets are stored in a hash like so  
>> $main::radius_sockets{$bind_address}{$port}
>> so by doing a search in that hash for the socket you may be able  
>> to find the bind address and port of the socket that received the  
>> request.
>> Hope that helps.
>> Cheers.
>>
>>> Basically I have my radiator process tied to multiple IP  
>>> addresses on my
>>> server and I would like to parse the requests based on what IP  
>>> Address
>>> my NASes sent the request to...
>>>
>>> Thanks in advance,
>>> -Miko
>>>
>>> --
>>> 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.
>


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?

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
-
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