Add Attribute inside an Module

Phil Mayers p.mayers at imperial.ac.uk
Mon Feb 18 12:56:40 CET 2013


On 18/02/13 11:49, Patrick Ko wrote:
> Hello everybody is it possible to add inside from a Module an Attribute.
> I have included an C-Modul to my freeradis which works!
> Now i want do add an individual Attribute like, "Web-Page" =
> "www.google.de <http://www.google.de>"
>
> Which also works it's to change the Attribute-Value if the "State"
> Attribute, but I also want to have antoher Name like "State".
>
>
> VALUE_PAIR *reply;
> reply = pairmake("*State*", "*Hello State*", T_OP_EQ);
> pairadd(&request->reply->vps, reply);

This should really be:

if (reply) pairadd(...);

i.e. you must check the return value of pairmake, in case it fails.

>
> This works fine, but If now I want to add an individual Attribute it
> doens't work.
>
> VALUE_PAIR *reply;
> reply = pairmake("*Web_page*", "*www.google.de <http://www.google.de>*",
> T_OP_EQ);
> pairadd(&request->reply->vps, reply);
>
>
> Did everyone know what did I made wrong and could help me please ?

Did you define the attribute in a dictionary? If not, pairmake will 
return null.


More information about the Freeradius-Devel mailing list