Decoding Alcatel Accounting packets

Alan DeKok aland at deployingradius.com
Sun Jul 24 12:34:31 CEST 2016


On Jul 24, 2016, at 3:49 AM, Peter Lambrechtsen <peter at crypt.nz> wrote:
> I'm looking to do some further extension to some perl code I have to deal
> with the TiMos / SROS Alcatel / Nokia 7750 Accounting packets. I'm
> wondering if there is a smarter way of doing it than using perl.

  v4.0.x.  :)

  It supports "struct".  I've taken the liberty of updating the "man dictionary" page, and of updating some attributes in dictionary.alcatel.sr.

> The issue with the above is the Alc-Acct-I-All-Octets_64 is in there twice
> so I need to create an array and loop through it to see what type it is.

  Does it change format?

  If not, just do:

	if (&Alc-Acct-I-All-Octets-64[1]) {
		# decode it
	}

> B is similar to A as the outbound logic is the same and the inbound logic I
> need to loop through I-Inprof-Octets-64 and I-Outprof-Octets-64 and add
> them all up as Inbound packets.

  Yeah... the "expr" module could arguably take attribute references such as:

	%{expo:0 + &Alc-Acct-I-All-Octets-64[*]}

  and then automagically loop over the attributes, adding them in...

> Any ideas how to easily convert these, or do I just stick with Perl?

  Perl is OK for now.  It's probably also only ~200 lines of C code.

  Or maybe I'll go poke rlm_expr in v4.0.x

  In the interests of keeping v3 stable, we're not doing any more changes to it.  Sorry....

  Alan DeKok.




More information about the Freeradius-Users mailing list