Hello Dusty -
>
> I am working on a PostAuthHook that will give us more compact
> logging but I have run into a problem. I can get standard
> attributes pretty easily by using the examples I have seen
> in the Docs and the list. However when I try to get Vendor
> Specific Attributes I come up empty handed. Can anyone give
> me example code where they are pulling vendor specific
> attributes using a hook ?? I have attached some code from my
> hook.
>
> my $p = ${$_[0]};
> #These come through fine
> my $username = $p->getAttrByNum($Radius::Radius::USER_NAME);
> my $nasaddress = $p->getAttrByNum($Radius::Radius::NAS_IP_ADDRESS);
> my $ipaddress = $p->getAttrByNum($Radius::Radius::FRAMED_IP_ADDRESS);
> my $called = $p->getAttrByNum($Radius::Radius::CALLING_STATION_ID);
> my $calling = $p->getAttrByNum($Radius::Radius::CALLED_STATION_ID);
> my $nasport = $p->getAttrByNum($Radius::Radius::NAS_PORT);
>
Yes - these attributes are defined in the file "Radius/Radius.pm", so you can
happily do what you've shown above.
> #These "specific to Ascend Attributes" do not seem to be available
> #using this code even though they do show up in the main logfile
> #
> my $shelfno = $r->getAttrByNum($Radius::Radius::ASCEND_MODEM_SHELFNO) ;
> my $slotno = $r->getAttrByNum($Radius::Radius::ASCEND_MODEM_SLOTNO) ;
> my $portno = $r->getAttrByNum($Radius::Radius::Ascend_Modem_PortNo) ;
>
However, these attributes are defined in the dictionary file, not
"Radius/Radius.pm, so you will need to use get_attr, for example.
I notice from the above that you are using $p in the first series and $r in the
second series. Are these in fact the same packet? Note that the PostAuthHook
has access to both the request packet and the reply packet.
You may also be interested in having a look at a few example hooks that are in
the patches area:
http://www.open.com.au/radiator/downloads/patches-2.15/hooks.txt
hth
Hugh
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, Interbiller, TACACS+, PAM, external, etc, etc.
Available on Unix, Linux, FreeBSD, Windows 95/98/2000, NT, MacOS X.
===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.