Class attribute in accounting record.

Michael da Silva Pereira michael at tradepage.co.za
Mon Oct 29 15:52:41 CET 2007


Hi Mark,

The provider is obviously SAIX (ZA based ISP),

Looks like SAIX are sending it through as ASCII text, on my side?

Tue Sep 18 14:25:53 2007
        Acct-Session-Id = "7/0/2/20.557_30429449"
        Framed-Protocol = PPP
        Framed-IP-Address = 41.242.121.175
        User-Name = "XXXXXXX at dsl512.tradepage.co.za"
        X-Ascend-Connect-Progress = 60
        Acct-Authentic = RADIUS
        Acct-Status-Type = Start
        NAS-Port-Type = Virtual
        NAS-Port = 1913913901
        NAS-Port-Id = "7/0/2/20.557"
        Connect-Info = "AutoShapedVC"
        Class = "NS1"
        Service-Type = Framed-User
        NAS-IP-Address = 196.43.27.23

Check you /share/freeradius/dictionary file and check what you have for
the Class Attribute.

I have the following:
dictionary:ATTRIBUTE    Class                   25      string

Kind Regards,
Michael da Silva Pereira
Tradepage ;)


-----Original Message-----
From: Mark J Elkins <mje at posix.co.za>
Reply-To: FreeRadius users mailing list
<freeradius-users at lists.freeradius.org>
To: freeradius-users at lists.freeradius.org
Subject: Class attribute in accounting record.
Date: Mon, 29 Oct 2007 16:45:14 +0200

My access provider is setting and sending me the "Class" attribute in an
accounting record...

I use MySQL to store such info in... and I'm using freeradius 1.1.6

in order to Capture the value - I modified all accounting "Insert"
statements to.... (as an example)

accounting_start_query = "INSERT into ${acct_table1} (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, Class)
values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',
'%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}',
'%{NAS-Port-Type}', '%S', '0', '0', '%{Acct-Authentic}',
'%{Telkom-Access-Type:-!SAIX} %{Connect-Info}', '', '0', '0',
'%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}',
'%{Framed-Protocol}', '%{Framed-IP-Address}', '%{Acct-Delay-Time}', '0',
'%{Class}')"

This captures the info fine.... (yes - also changed the MySQL table)

| RadAcctId | 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 | Class    |
+-----------+----------------------+------------------+---------------------------------+--------------+--------------+------------+-------------+---------------------+---------------------+-----------------+---------------+-------------------+------------------+-----------------+------------------+-----------------+------------------+--------------------+-------------+----------------+-----------------+----------------+---------------+----------+
|  21488415 | 7/0/0/2.157_13B0EB0F | 32161edf2c7a5dec |
xxxxxxxxxxxxxxx at xxxxxxxxxxx | realmname | 1.2.3.4 | 1879179421 |
Virtual     | 2007-10-29 16:15:07 | 0000-00-00 00:00:00 |              
0 | RADIUS        | DSL AutoShapedVC  |                  |              
0 |                0 |                 |                 
|                    | Framed-User | PPP            | 1.2.4.99   
|              0 |             0 | 0x4e5331 |


... However - I get a Hex String ... 0x4e5331 - where I was expecting "NS1"

Reading the RFC's (with FreeRadius documentation) - this should be a
Char Octets kindof field...

Should the access provider sent the string in ASCII rather?
Did something in FreeRadius convert the ASCII to Hex?
What can I do to convert this on the fly into ASCII - save a bit of
space in my Database - etc.

Reading the mailing-lists archives - I see that it can contain binary
data - thus the Hex.
Which is "better" - to change the dictionary definition from octet to
string or some sort of mysql function call?
(better ==> less things to remember/patch between updates)
The access provider states that the info provided will always be ascii
(or translate to ascii - if decoded).


This email and all its contents are subject to the following disclaimer:

"http://www.tradepage.net/disclaimer.aspx"



More information about the Freeradius-Users mailing list