Re: dictionary help

2010-02-25 Thread Igor Smitran

Alan DeKok wrote:
 Hmm... the code in rlm_preprocess checks if the attribute is string
 type.  I don't see why this is necessary.  See line 155 (or so) in
 src/modules/rlm_preprocess/rlm_preprocess.c.

   
I've saw the source and now i understand, but, i don't know much of C
and don't know if problem is solvable?
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: dictionary help

2010-02-25 Thread Alan DeKok
Igor Smitran wrote:
 I've saw the source and now i understand, but, i don't know much of C
 and don't know if problem is solvable?

  Yes.  Delete the line containing PW_TYPE_STRING, and change the
previous line to:

   if ((dattr = dict_attrbyname(newattr)) != NULL) {

  Then re-compile  install.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: dictionary help

2010-02-25 Thread Igor Smitran


Alan DeKok wrote:
   Yes.  Delete the line containing PW_TYPE_STRING, and change the
 previous line to:

if ((dattr = dict_attrbyname(newattr)) != NULL) {

   Then re-compile  install.

   
Just what i thought bu wasn't sure.
Can we expect this to be changed permanently in future releases?
Thank you for your help.

Igor
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


dictionary help

2010-02-24 Thread Igor Smitran




Hello,
I am trying to rewrite some custom AVPairs that cisco sends me.
In order to do that i've created cusatom dictionary:

ATTRIBUTE   disc-cause-ext  507 integer

VALUE  disc-cause-ext  Unknown 1002
VALUE  disc-cause-ext  CLID-Auth-Fail  1004
VALUE  disc-cause-ext  No-Carrier  1010
VALUE  disc-cause-ext  AAA-VAL-DISC-LOST-CARR  1011
etc

When radius is started with this dictionary i don't get any value for
disc-cause-ext  attribute. It doesn't exist.
In my log files i've enabled request attributes loging, and i get this:

Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
disc-cause-ext=1045
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-bytes-in=217
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-bytes-out=139
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-paks-in=8
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-paks-out=7
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-session-time=35
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
connect-progress=60
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
nas-rx-speed=31200
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
nas-tx-speed=4

If i change my dictionary to look like this:

ATTRIBUTE   disc-cause-ext  507 string

then in my log i see this:

Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
disc-cause-ext=1045
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-bytes-in=217
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-bytes-out=139
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-paks-in=8
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-paks-out=7
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
pre-session-time=35
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
connect-progress=60
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
nas-rx-speed=31200
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: Cisco-AVPair =
nas-tx-speed=4
Tue Feb 23 17:41:42 2010 : rlm_perl: RAD_REQUEST: disc-cause-ext=1045

All i want to do is map number to string, so that my tech support can
see human readable disconnect cause extension, because it gives me
slightly more data about the disconnect reason. Am i on the right track
or...?

Igor



-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: dictionary help

2010-02-24 Thread Alan DeKok
Igor Smitran wrote:
 Hello,
 I am trying to rewrite some custom AVPairs that cisco sends me.
 In order to do that i've created cusatom dictionary:
...
 When radius is started with this dictionary i don't get any value for
 disc-cause-ext  attribute. It doesn't exist.

  Hmm... the code in rlm_preprocess checks if the attribute is string
type.  I don't see why this is necessary.  See line 155 (or so) in
src/modules/rlm_preprocess/rlm_preprocess.c.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html