Log a Vendor-Specific Value

Jeroen Vanderauwera bcrouterproject at gmail.com
Fri May 15 14:06:29 CEST 2009


Hi,
I have some problems with radius. I want to log the Value (an integer)
in my Vendor-Specific attribute to a mysql database.
I use %'{Vendor-Specific}' as variable to write it to the database but
it always writes 0x25ce0000010630390000 to the database instead of the
Value.

At the system where you have to authenticate I put the following
variables into the radiuspacket:
Vendor-Id = 9678 --> is registered at
http://beta.iana.org/assignments/enterprise-numbers
Vendor-Type<http://beta.iana.org/assignments/enterprise-numbers%0AVendor-Type>
=
1
Vendor-Length = 6
Vendor-Value = 12345

When I use radsniff at the radius server, I can see:
Packet number 1 has just been sniffed
        From:    10.0.2.1:55822
        To:      10.0.2.2:1813
        Type:    Accounting-Request
        Acct-Status-Type = Interim-Update
        NAS-Port = 167772161
        Service-Type = Framed-User
        Framed-IP-Address = 10.0.0.1
        Acct-Input-Octets = 4249838
        Acct-Output-Octets = 4056840
        Acct-Input-Packets = 5326
        Acct-Output-Packets = 2655
        NAS-Identifier = "bcrouter"
        Acct-Session-Id = "167772161"
        User-Name = "stage/stage"
------>Vendor-Specific = 0x25ce0000010630390000<------
Packet number 2 has just been sniffed
        From:    10.0.2.2:1813
        To:      10.0.2.1:55822
        Type:    Accounting-Response

If you disassamble 0x25ce0000010630390000:
(25ce)16 -> (9678)10
(00 0001)16 -> (1)10
(06)16 -> (6)10
30390000 -> (0000 3039)16 -> (12345)10

So this seems to be right. Somewhere it's logic that if you use
%'{Vendor-Specific}' as variable in the query, that you will store
0x25ce0000010630390000. But how am I able to store 12345 into the
database? I also tried to use %'{KULeuven-Test}' and just %'{Test}',
but those variables are just empty...

This is my dictionary:
VENDOR               KULeuven                         9678
BEGIN-VENDOR    KULeuven
ATTRIBUTE           KULeuven-Test                   1               integer
VALUE                 KULeuven-Test                   Test            12345
END-VENDOR      KULeuven

Thank you in advance,
--
Jeroen Vanderauwera
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090515/3adbb958/attachment.html>


More information about the Freeradius-Users mailing list