(RADIATOR) Expanding Radius::Util::conversions ...

Jose Borges Ferreira underspell at gmail.com
Tue Feb 12 05:53:06 CST 2008


Hi Hugh

My motivation to expand formater was to provide a simpler way to convert
between perl, time and Diameter Time.
Perhaps it make more sense to apply this on the encoder/decoder , since
there are more tools/functions/backends to work
on unix timestamps rather than NTP format.

By this time i do sum and the subtraction directly on attribute operations.
What do you think ?

José Borges Ferreira

#####################################################################
# Diameter Time uses NTP format (seconds from 1 Jan 1900)
# Convert between NTP date to unix epoc time. Value got from RFC 868


sub ntptime2systime { return $_[0] - 2208988800 };
sub systime2ntptime { return $_[0] + 2208988800 };

On Feb 12, 2008 7:18 AM, Hugh Irvine <hugh at open.com.au> wrote:

>
> Hello Bjorn, Hello Jose -
>
> There is now a patch for Radiator 4.0 that implements "%{Special:...}":
>
>
> Patched Util.pm to now use, for example %{Special:a} instead of
> just %a. Now new multichar special chars could be added to the
> conversions
> table such as:
>
> # Existing
>        .......
>      'p', sub { return unless $ptime; @ptime = localtime($ptime);
> $ptime[0] },
>
> # multi-char conversions follow
>  'multichar', sub {return 'what ever you like';},
>        );
>
>
> regards
>
> Hugh
>
>
> On 12 Feb 2008, at 05:21, Bjoern A. Zeeb wrote:
>
> > On Mon, 11 Feb 2008, Jose Borges Ferreira wrote:
> >
> > Hi,
> >
> >> I was considering expanding  Radius::Util::conversions ..., but it
> >> just run
> >> out of letters.
> >>
> >> Any idea where to go besides the  alphabet ?
> >
> > I was already going to say use %{foo} like people have speced for
> > printf(3) but Radiator of course already uses that along with other
> > %{XXX:...}. So why not simply going to add a %{Conv:...} ?
> >
> > /bz
> >
> > --
> > Dipl. Ing. (BA) Bjoern A. Zeeb          Research & Development
> > CK Software GmbH                        http://www.cksoft.de/
> > Schwarzwaldstr. 31                      Phone: +49 7452 889 135
> > D-71131 Jettingen                       Fax: +49 7452 889 136
> > HRB245288, Amtsgericht Stuttgart        Geschaeftsfuehrer:
> > Christian Kratzer
> >
> > --
> > 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?
> Have you checked the RadiusExpert wiki:
> http://www.open.com.au/wiki/index.php/Main_Page
>
> --
> Radiator: the most portable, flexible and configurable RADIUS server
> anywhere. Available on *NIX, *BSD, Windows, MacOS X.
> Includes support for reliable RADIUS transport (RadSec),
> and DIAMETER translation agent.
> -
> 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.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.open.com.au/pipermail/radiator/attachments/20080212/59e24315/attachment.html>


More information about the radiator mailing list