(RADIATOR) posthook for checking existence and modifying

Hugh Irvine hugh at open.com.au
Mon Sep 6 06:23:40 CDT 2004


Hello Tariq -

You will find a number of example hooks in "goodies/hooks.txt".

In this case you would do something like

	my $protocol = $p->get_attr('Protocol');

	if ($protocol eq 'ppp')
	{
		$p->change_attr('Protocol', 'PPP');
	}

	return;

Note that I haven't tested this but it should give you the idea.

regards

Hugh


On 6 Sep 2004, at 21:07, Tariq Rashid wrote:

>
> hi there,
>
> i need to add some additional checking into out PostSearch.hook ... 
> and am
> unsure of the syntax to access / modify theobjects.
>
> i'm used to using the get_reply and get_check and add_attr and so on 
> ...
>
> but what i need to do is, at the end of the normal processing:
> 	* iterate over the reply attributes
> 	* check for existence of "Protocol" attribute
> 	* if it exists, check if it is lowercase "ppp" and if so change it
> to uppercase "PPP"
>
> later I will do some similar work with the vendor specific "MPP" 
> protocol.
>
> can anyone point me to the synatx for (1) iterating over the reply 
> attribs,
> (2) chekcing the key, (3) testing the value, (4) modifying it if 
> necessary
>
> the ref manual for 3.8 doesn't document the perl objects...
>
> tariq
>
> --
> 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 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