Gigaword support

Stefan Winter stefan.winter at restena.lu
Tue May 29 09:07:39 CEST 2007


Hi,

> Have a look at this:
>
> http://www.netexpertise.eu/en/FreeRadius/GigaWords.html

hm, I had a look at this HOWTO, and the FreeRADIUS bits appear a bit odd. He 
adds a new column to radacct, and fills the gigawords attribute into this 
seperate column. This does not give a coherent output: you are likely 
interested in one single number (i.e. the number of input octets), and not in 
doing binary arithmetic yourself on two seperate columns of the table.

I have a few simple suggestions:

- (mysql) modify Schema AcctInputOctets to be BIGINT(20) instead of BIGINT(12)
  [this will make the integer big enough to hold any 64-Bit value]
- modify the default query in sql.conf to do the binary arithmetic (merging
  Gigaword << 32 | inputOctets) into a single number and storing that in
  radacct.

At least for mySQL, this kind of arithmetic in an update or insert query is 
rather simple:

replace

AcctInputOctets = '%{Acct-Input-Octets}',

with 

AcctInputOctets = '%{Acct-Input-Gigawords}' << 32 | '%{Acct-Input-Octets},

and you're done: it gives us 64-bit counter handling for SQL backends with no 
pain (and Output-octets, Input-Packets, Output-Packets equivalently)

Something for 2.0?

Greetings,

Stefan

-- 
Stefan WINTER

Stiftung RESTENA - Réseau Téléinformatique de l'Education Nationale et de 
la Recherche
Ingenieur Forschung & Entwicklung

6, rue Richard Coudenhove-Kalergi
L-1359 Luxembourg
E-Mail: stefan.winter at restena.lu     Tel.:     +352 424409-1
http://www.restena.lu                Fax:      +352 422473
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20070529/0f01fc3a/attachment.pgp>


More information about the Freeradius-Devel mailing list