Transmitted data to radius server.

Iandc Davies Iandc.Davies at marconi.com
Thu Sep 22 10:51:18 CEST 2005


Firstly, thanks to all of you with being this patient with me.
I think I've got a handle on the method. Please correct me if I'm wrong in
either terminology or content.

For the purpose of this mail, please use the following meanings:
Server = RADIUS Server
Client = "The thing that sends information to the server."

OK,

To construct a message that is received by the sever from the client, I can
create a structure of the
following type:

typedef struct radius_packet{
      int         id,
      unsigned int      code,
      uint8_t           vector[16],
      VALUE_PAIR  *vps;
      }RADIUS_PACKET

The VALUE_PAIR struct is as defined currently.

The radius server will receive the transmitted packet by passing a file
descriptor and a data array to
a system function call recvfromto.
Data then holds the received data in the following uint8_t format.

      data[0]           -     code
      data[1]           -     identifier
      data[2]           -     length (HSB)
      data[3]           -     length (LSB)
      data[4]           -     vector[0]  (16 octect authenticator)
      data[5]
      ......
      data[19]    -     vector[15]
      data[20]    -     start of value_pair sequence.
      .......

If that is correct so far, radius than re-alignes to evaluate the
value_pairs.

This is where, again my understanding of the code is a bit hazy.
Any help appreciated. :-)

Therefore data[20] is mapped to a pointer attr.

      attr[0]           -     holds vp->attribute
      attr[1]           -     holds vp->length

The server sanity checks the sum of the lengths of the attributes against
the data length of the mesage.

Once this happens, the servers mem copies the data array to RADIUS_PACKET
-> data and treats
it as it will.

Many thanks and a promise to buy you a drink or three if I see you ;-)

Ian Davies {02476 564662}
          Internal   (x740 4662)
IMS-SIPAC
Software Development Engineer





More information about the Freeradius-Users mailing list