Constructing imcoming message.

Iandc Davies Iandc.Davies at Marconi.com
Wed Aug 24 15:05:02 CEST 2005


Hi all,

I'm trying to construct a simple program that will allow me to take some
information from another source (possibly a pointer to a structure passed
in)
and populate the RADIUS_PACKET template. A separate process will then be
used to send this message over UDP to the radius server.

The information I'm trying to parse is as follows (these are test values
only) :-

Code=1
packet->code
Identifier=1 (can increase due to how many requests)
packet->id
Length=total length of message
packet->data_len
Authenticator=32 octets (random to send to RADIUS but md5 hashed on reply)
packet->vector
Attributes:                                                 packet->data

                NAS-IP-Address=eg. d5 89 45 26 (213.137.69.38)
      PW_NAS_IP_ADDERSS
                NAS-PORT-TYPE=5 (virtual)
PW_NAS_PORT_TYPE
                User-Name="12345678"
PW_USER_NAME
                Disgest-Response=16 octets
PW_DIGEST_REPONSE
                Digest-Attributes= Realm(1)      = "deltathree"
      PW_DIGEST_REALM
                                   Nonce(2)      = "3bada1a0"
            PW_DIGEST_NONCE
                                   Method(3)     = "INVITE"
      PW_DIGEST_METHOD
                                   URI(4)
= "sip:96226491335 at 213.137.69.38"               PW_DIGEST_URI
                                   Algorithm(5)  = "md5"
            PW_DIGEST_ALGORITHM
                                   User-Name(10) = "12345678"
            PW_DIGEST_USER_NAME

On the right for the Code/Id/length/Authenticator are straight forward, as
they have their own types.
For the attributes, I'm getting a bit stuck as these are VSA AVP's.
I think I've managed to id the functions that I need ( paircreate() and
pairadd() ) but unsure how they are used.
I've stated what I think each AVP is represented by (as these are #define
int)
but the VALUE_PAIR structure has name, attribute and type information
relating to them.

Is the name just a straight car string ? (left hand side of equals above)

Any help gratefully received.

Ian Davies
IMS-SIPAC
Software Development Engineer





More information about the Freeradius-Users mailing list