adding new entry in dictionar

Juan Pablo L. jpablolorenzetti at hotmail.com
Tue Apr 28 16:25:44 CEST 2015


Hi Alex, thanks for your prompt answer as always, i have added all code related to the management of this field, i m certainly that i m doing it wrong
but cant see where .. am i missing some code to make this work ? as far as i knew:

1. i needed to add the field in the dictionary (new field is 90.3):
# The next set of attributes contain sub-types
ATTRIBUTE       3GPP2-Prepaid-Acct-Quota                                90      tlv
ATTRIBUTE       3GPP2-Prepaid-Acct-Quota-QuotaIDentifier                90.1    integer
ATTRIBUTE       3GPP2-Prepaid-Acct-Quota-VolumeQuota                    90.2    integer
ATTRIBUTE       3GPP2-Prepaid-Acct-Quota-VolumeQuotaOverflow            90.3    integer
ATTRIBUTE       3GPP2-Prepaid-Acct-Quota-VolumeThreshold                90.4    integer
ATTRIBUTE       3GPP2-Prepaid-Acct-Quota-VolumeThresholdOverflow        90.5    integer
ATTRIBUTE       3GPP2-Prepaid-Acct-Quota-UpdateReason                   90.8    short

2. get a reference to the id assigned internally to that field by freeradius:
inst->vqo = dict_attrbyname("3GPP2-Prepaid-Acct-Quota-VolumeQuotaOverflow");

3. get the value from the request:
volume_quota_overflow = pairfind(request->packet->vps,instance->vqo->attr,_3GPP2_VENDOR,TAG_ANY);

4. access the value in the module:
volume_quota_overflow->vp_integer

those are the steps that i m following but there is something wrong because
regardless of what i do in the module code freeradius does not recognise the 
field when the request comes in anyways so i think anything after that will fail too.

freeradius still shows this field in the logs as:
Attr-26.5535.90.3 = 0x0000

after adding the new field in the dictionary and restarting the server, what else is needed to make freeradius
recognise the field,  and display it properly in the logs?  because maybe that is the problem, that freeradius still
does not pick up the new field. thanks!!!


> Subject: Re: adding new entry in dictionar
> From: aland at deployingradius.com
> Date: Tue, 28 Apr 2015 06:34:41 -0400
> To: freeradius-users at lists.freeradius.org
> 
> On Apr 28, 2015, at 2:29 AM, Juan Pablo L. <jpablolorenzetti at hotmail.com> wrote:
> Hi everybody, i have added a new entry in dictionary.3gpp2. 
> > the new entry is part of a TLV that i had created in the past and been using for years successfully, 
> > but now i needed to add a new field and it does not work, i do not know the reasons 
> > as i m adding it as i did the rest of the fields in the tlv long time ago (or so i think)
> 
>   This question is better suited for the developers list, as you're looking at the server internals.
> 
> > The new field is 3GPP2-Prepaid-Acct-Quota-VolumeQuotaOverflow. The radius logs still showing this field
> > as "Attr-26.5535.90.3 = 0x0000",
> 
>   Probably because it's being created incorrectly.
> 
> > and programatically i m trying to access it as i do  the others
> > and all i get is garbage. this is how i m trying to access it:
> > 
> > i try to get an id to it from the dictoinary:
> > 
> > inst->vqo = dict_attrbyname("3GPP2-Prepaid-Acct-Quota-VolumeQuotaOverflow");
> 
>   Yes, that works.
> 
> > and then try to access it like this:
> > 
> > volume_quota_overflow = pairfind(request->packet->vps,instance->vqo->attr,_3GPP2_VENDOR,TAG_ANY);
> 
>   That works, too.
> 
> > but all i get is garbage (it is actually the whole field as a decimal number which a big number,144907816),
> 
>   No, you get a pointer to the VALUE_PAIR.
> 
>   You shouldn't look at the internal fields of a DICT_ATTR unless you need to do that.  The "garbage" value you're referring to is a real value which has meaning.  Go read src/lib/dict.c for explanations.
> 
>   The problem seems to be that you're not creating the attribute properly.  Since you didn't include that code here, I can't tell what you're doing wrong.
> 
>   Alan DeKok.
> 
> 
> 
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
 		 	   		  


More information about the Freeradius-Users mailing list