Re: Basic RADIUS network protocol question

2004-07-07 Thread Aldo Chiecchia
Martin Olsson wrote:
The length field is 16-bit, but is it big-endian or little-endian? If 
i receive the two bytes for the length as AB should I use the value 
256*A+B or should I use the value A+B*256?

You can just convert your short int  from host-byte-order to 
network-byte-order using the function "htons" and then store it in the 
lenght field.
see man pages for details

Aldo
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Basic RADIUS network protocol question

2004-07-07 Thread Martin Olsson
I'm reading the RFC2865 for RADIUS. In each radius packet seems to have a
code, an identifier, a length field, an authenticator field and some
attributes.The length field is 16-bit, but is it big-endian or
little-endian? If i receive the two bytes for the length as AB should I use
the value 256*A+B or should I use the value
A+B*256?Regards,Martin Olsson


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Basic RADIUS network protocol question

2004-07-07 Thread Martin Olsson
I'm reading the RFC2865 for RADIUS. In each radius packet seems to have a
code, an identifier, a length field, an authenticator field and some
attributes.The length field is 16-bit, but is it big-endian or
little-endian? If i receive the two bytes for the length as AB should I use
the value 256*A+B or should I use the value
A+B*256?Regards,Martin Olsson


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html