How to extract A/V pairs from an Access-Request packet

Susana Macias susana_macias12 at yahoo.es
Thu Jan 5 13:03:07 CET 2006


Hy all,
   
  I am developing a custom module and I am a bit lost with the code. I am not a C programmer so sorry if my question is very stupid.
   
  I want to extract the differents A/V pairs contained in the Access-Request packets and check if any of them is the attribute "Connect-Info". In that case I would like to pass the value of the "Connect-Info" attribute to a function called auxiliar. 
  Here is my code:
   
  static int auxiliar (char * value) { ..... }
   
  static int mymodule_authorize (void *instance, REQUEST *request) {
       ....
   
       VALUE_PAIR *request_pairs;
       request_pairs=request->packet->vps;
   
       VALUE_PAIR *aux = NULL;
   
       char * Attribute_Name = NULL;
       char *Attribute_Value = NULL;
       int type = 0;
   
       for ( aux=request_pairs; aux; aux=aux->next)
       {
            Attribute_Name = aux->name;
            Attribute_Value = aux->strvalue;
   
            if (aux->attribute == PW_CONNECT_INFO)
            {
                 type=auxiliar(aux->strvalue); /* is this correct? I mean, is aux->strvalue a char * type? */
            }
   
            .....
       }
   
   
   
  Am I on the right track?
   
  Thank you a lot for your help and best regards,
  Susana

		
---------------------------------

Correo Yahoo!
Comprueba qué es nuevo, aquí
http://correo.yahoo.es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20060105/8cb0d685/attachment.html>


More information about the Freeradius-Devel mailing list