Hi all!<br><br>Carlos,<br>If you need create a Handler to match one of those attributes then you have to declare the hook Hugh mentioned ("%D/createavpairs") to the Client Clause ( PreHandlerHook ) or , if you can't specified a specific Client use PreClientHook to make that global.<br>
<br>Using Hugh example, you can then make something like this:<br><br><Handler
service=shell><br>...<br></Handler><br><br>José Borges Ferreira<br><br><br><br><div class="gmail_quote">On Tue, Mar 16, 2010 at 9:15 PM, Hugh Irvine <span dir="ltr"><<a href="mailto:hugh@open.com.au">hugh@open.com.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hello Carlos -<br>
<br>
There is an example hook in "goodies/hooks.txt" that does this for multiple "cisco-avpairs".<br>
<br>
You would use something similar for your repeated attributes in a PreClientHook.<br>
<br>
Then you can set up your Handlers using the decoded attributes.<br>
<br>
hope that helps<br>
<br>
regards<br>
<br>
Hugh<br>
<br>
BTW - here is the hook code for your convenience<br>
<br>
.....<br>
<br>
This hook is designed to parse multiple cisco-avpairs.<br>
<br>
Contributed by:<br>
<br>
<a href="mailto:Chris.Patterson@transact.com.au">Chris.Patterson@transact.com.au</a><br>
<br>
All I'm doing here is taking each cisco-avpair attribute from the incoming packet and adding new attributes onto the same incoming packet.<br>
<br>
eg:<br>
cisco-avpair = "task_id=62"<br>
cisco-avpair = "timezone=UTC"<br>
cisco-avpair = "service=shell"<br>
cisco-avpair = "priv-lvl=0"<br>
cisco-avpair = "cmd=exit <cr>"<br>
<br>
become:<br>
task_id = 62<br>
timezone = UTC<br>
service = shell<br>
priv-lvl = 0<br>
cmd = "exit <cr>"<br>
<br>
Hope this assists people in their endeavours!<br>
<br>
Cheers<br>
Chris.<br>
<br>
<br>
radiator.cfg<br>
<br>
<Handler><br>
PreProcessingHook file:"%D/createavpairs"<br>
<AuthBy SQL><br>
DBSource dbi:mysql:radius<br>
DBUsername test<br>
DBAuth test<br>
<br>
AccountingTable ACCOUNTING<br>
AcctColumnDef TIMESTAMP,Timestamp,integer<br>
AcctColumnDef NASIP,NAS-IP-Address<br>
AcctColumnDef USERNAME,User-Name<br>
AcctColumnDef CALLLINGID,Calling-Station-Id<br>
AcctColumnDef PRIVLVL,priv-lvl<br>
AcctColumnDef CMD,cmd<br>
</AuthBy><br>
</Handler><br>
<br>
<br>
createavpairs<br>
<br>
sub {<br>
my $p=${$_[0]};<br>
if (my @avpair = $p->get_attr('cisco-avpair')) {<br>
foreach my $avpair (@avpair) {<br>
$p->add_attr(split('=',$avpair));<br>
<div><div></div><div class="h5"> }<br>
}<br>
}<br>
<br>
<br>
<br>
On 16 Mar 2010, at 21:20, Carlos Parada wrote:<br>
<br>
> Hi all,<br>
><br>
> I need to access to the list of values of a given attribute (when the attribute is repeated in a packet):<br>
> - I need for example to write all values (or the nth value) in the Log file.<br>
> - Using the perl code (code new issues) I need t know how to access the list of values.<br>
> - In the handler matching rules, I need to say something like "if any of the values match this value or regexp"<br>
><br>
> How could I do all that (or at least some issues)? Any clues?<br>
><br>
><br>
> Regards,<br>
> Carlos Parada<br>
><br>
> _______________________________________________<br>
> radiator mailing list<br>
> <a href="mailto:radiator@open.com.au">radiator@open.com.au</a><br>
> <a href="http://www.open.com.au/mailman/listinfo/radiator" target="_blank">http://www.open.com.au/mailman/listinfo/radiator</a><br>
<br>
<br>
<br>
</div></div>NB:<br>
<br>
Have you read the reference manual ("doc/ref.html")?<br>
Have you searched the mailing list archive (<a href="http://www.open.com.au/archives/radiator" target="_blank">www.open.com.au/archives/radiator</a>)?<br>
Have you had a quick look on Google (<a href="http://www.google.com" target="_blank">www.google.com</a>)?<br>
Have you included a copy of your configuration file (no secrets),<br>
together with a trace 4 debug showing what is happening?<br>
<br>
--<br>
Radiator: the most portable, flexible and configurable RADIUS server<br>
anywhere. Available on *NIX, *BSD, Windows, MacOS X.<br>
Includes support for reliable RADIUS transport (RadSec),<br>
and DIAMETER translation agent.<br>
-<br>
Nets: internetwork inventory and management - graphical, extensible,<br>
flexible with hardware, software, platform and database independence.<br>
-<br>
CATool: Private Certificate Authority for Unix and Unix-like systems.<br>
<div><div></div><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
radiator mailing list<br>
<a href="mailto:radiator@open.com.au">radiator@open.com.au</a><br>
<a href="http://www.open.com.au/mailman/listinfo/radiator" target="_blank">http://www.open.com.au/mailman/listinfo/radiator</a><br>
</div></div></blockquote></div><br>