Hello Brandon -

> 
> How do I reference....
> 
>       %b
>      The Timestamp in seconds since Jan 1 1970
> 
> 
> 
> >From a PreHandlerHook?
> 

You will need to call Radius::Util::format_special(), like this:

        my $timestamp = Radius::Util::format_special('%b', $p, $rp);

where $p is the current request packet and $rp is the current reply packet.

Alternatively, if you just want the value, you would do this:

        my $timestamp = $p->get_attr('Timestamp');

Now, it turns out that the Timestamp attribute is actually set in Handler.pm,
so if you really need it in a PreHandlerHook, you would need to do this:

        my $timestamp = $p->{RecvTime}
                     - int $p->getAttrByNum($Radius::Radius::ACCT_DELAY_TIME));

which is the code that is executed in Handler.pm.

Have a look at the example hooks in "goodies/hooks.txt".

regards

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.

Reply via email to