Gigaword support

Stefan Winter stefan.winter at restena.lu
Tue May 29 14:17:14 CEST 2007


Hi,

something's attached, patch against current CVS HEAD. Inspired by Peter's 
postgresql snippet (:-0 is really necessary, the query will otherwise be 
f*cked up if not both attribs are present).
I use this setup in our prod env now, and am shocked about our user's real 
network usage, now that I see more than the 4GB ceiling. I.e. it appears to 
work fine.

While I was at it, I pretty-formatted one of the queries. I think these 
queries all-in-one-line are HORRIBLE to read or diff against (I have an x 
resolution of 3200 pixels and STILL there are multiple line-wraps in some of 
the queries!). Don't know if you like the style, if you do, I can also create 
a patch that beautifies all the other queries.

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 --------------
? Make.inc
? libtool
? myconfigure
? patch-mysql.txt
? raddb/dictionary
? raddb/radiusd.conf
? raddb/radrelay.conf
? raddb/vmpsd.conf
? scripts/check-radiusd-config
? scripts/cryptpasswd
? scripts/radiusd.cron.daily
? scripts/radiusd.cron.monthly
? scripts/radwatch
? scripts/rc.radiusd
? src/include/autoconf.h
? src/include/build-radpaths-h
? src/include/radpaths.h
? src/include/stamp-h
? src/main/checkrad.pl
? src/main/radlast
? src/main/radtest
? src/modules/lib/radeapclient
? src/modules/lib/rlm_acct_unique.lai
? src/modules/lib/rlm_acctlog.lai
? src/modules/lib/rlm_always.lai
? src/modules/lib/rlm_attr_filter.lai
? src/modules/lib/rlm_attr_rewrite.lai
? src/modules/lib/rlm_chap.lai
? src/modules/lib/rlm_checkval.lai
? src/modules/lib/rlm_copy_packet.lai
? src/modules/lib/rlm_counter.lai
? src/modules/lib/rlm_dbm.lai
? src/modules/lib/rlm_dbm_cat
? src/modules/lib/rlm_dbm_parser
? src/modules/lib/rlm_detail.lai
? src/modules/lib/rlm_digest.lai
? src/modules/lib/rlm_eap_gtc.lai
? src/modules/lib/rlm_eap_leap.lai
? src/modules/lib/rlm_eap_md5.lai
? src/modules/lib/rlm_eap_mschapv2.lai
? src/modules/lib/rlm_eap_peap.lai
? src/modules/lib/rlm_eap_sim.lai
? src/modules/lib/rlm_eap_tls.lai
? src/modules/lib/rlm_eap_ttls.lai
? src/modules/rlm_dbm/rlm_dbm_cat
? src/modules/rlm_dbm/rlm_dbm_parser
Index: doc/examples/mysql.sql
===================================================================
RCS file: /source/radiusd/doc/examples/mysql.sql,v
retrieving revision 1.4
diff -r1.4 mysql.sql
33,34c33,34
<   AcctInputOctets bigint(12) default NULL,
<   AcctOutputOctets bigint(12) default NULL,
---
>   AcctInputOctets bigint(20) default NULL,
>   AcctOutputOctets bigint(20) default NULL,
Index: raddb/sql/mysql-dialup.conf
===================================================================
RCS file: /source/radiusd/raddb/sql/mysql-dialup.conf,v
retrieving revision 1.1
diff -r1.1 mysql-dialup.conf
139,141c139,141
<           AcctSessionTime = '%{Acct-Session-Time}', \
<           AcctInputOctets = '%{Acct-Input-Octets}', \
<           AcctOutputOctets = '%{Acct-Output-Octets}' \
---
>           AcctSessionTime     = '%{Acct-Session-Time}', \
>           AcctInputOctets     = '%{Acct-Input-Gigawords:-0}'  << 32 | '%{Acct-Input-Octets:-0}', \
>           AcctOutputOctets    = '%{Acct-Output-Gigawords:-0}' << 32 | '%{Acct-Output-Octets:-0}' \
143,144c143,144
<           AND UserName = '%{SQL-User-Name}' \
<           AND NASIPAddress= '%{NAS-IP-Address}'"
---
>           AND UserName        = '%{SQL-User-Name}' \
>           AND NASIPAddress    = '%{NAS-IP-Address}'"
146c146,161
< 	accounting_update_query_alt = "INSERT into ${acct_table1} (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay) values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', DATE_SUB('%S',INTERVAL (%{Acct-Session-Time:-0} + %{Acct-Delay-Time:-0}) SECOND), '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Acct-Input-Octets}', '%{Acct-Output-Octets}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0')"
---
> 	accounting_update_query_alt = "INSERT into ${acct_table1} \
> 	    (AcctSessionId,    AcctUniqueId,      UserName, \
>              Realm,            NASIPAddress,      NASPortId, \
>              NASPortType,      AcctStartTime,     AcctSessionTime, \
>              AcctAuthentic,    ConnectInfo_start, AcctInputOctets, \
>              AcctOutputOctets, CalledStationId,   CallingStationId, \
>              ServiceType,      FramedProtocol,    FramedIPAddress, \
>              AcctStartDelay) \
>           VALUES \
>             ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', \
>              '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \
>              '%{NAS-Port-Type}', DATE_SUB('%S',INTERVAL (%{Acct-Session-Time:-0} + %{Acct-Delay-Time:-0}) SECOND), '%{Acct-Session-Time}', \
>              '%{Acct-Authentic}', '', '%{Acct-Input-Gigawords:-0}' << 32 | '%{Acct-Input-Octets:-0}', \
>              '%{Acct-Output-Gigawords:-0}' << 32 | '%{Acct-Output-Octets:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', \
>              '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', \
>              '0')"
152c167
< 	accounting_stop_query = "UPDATE ${acct_table2} SET AcctStopTime = '%S', AcctSessionTime = '%{Acct-Session-Time}', AcctInputOctets = '%{Acct-Input-Octets}', AcctOutputOctets = '%{Acct-Output-Octets}', AcctTerminateCause = '%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time:-0}', ConnectInfo_stop = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}'"
---
> 	accounting_stop_query = "UPDATE ${acct_table2} SET AcctStopTime = '%S', AcctSessionTime = '%{Acct-Session-Time}', AcctInputOctets = '%{Acct-Input-Gigawords:-0}' << 32 | '%{Acct-Input-Octets:-0}', AcctOutputOctets = '%{Acct-Output-Gigawords:-0}' << 32 | '%{Acct-Output-Octets:-0}', AcctTerminateCause = '%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time:-0}', ConnectInfo_stop = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}'"
154c169
< 	accounting_stop_query_alt = "INSERT into ${acct_table2} (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay) values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', DATE_SUB('%S', INTERVAL (%{Acct-Session-Time:-0} + %{Acct-Delay-Time:-0}) SECOND), '%S', '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Connect-Info}', '%{Acct-Input-Octets}', '%{Acct-Output-Octets}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Acct-Terminate-Cause}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{Acct-Delay-Time:-0}')"
---
> 	accounting_stop_query_alt = "INSERT into ${acct_table2} (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay) values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', DATE_SUB('%S', INTERVAL (%{Acct-Session-Time:-0} + %{Acct-Delay-Time:-0}) SECOND), '%S', '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Connect-Info}', '%{Acct-Input-Gigawords:-0}' << 32 | '%{Acct-Input-Octets:-0}', '%{Acct-Output-Gigawords:-0}' << 32 | '%{Acct-Output-Octets:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Acct-Terminate-Cause}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{Acct-Delay-Time:-0}')"
-------------- 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/41c70787/attachment.pgp>


More information about the Freeradius-Devel mailing list