This is BECAUSE radius servers expect integer values to be in network byte order. So the 1st byte contains bits 24-31, the 2nd one - bits 16-23, etc... I already wrote this in the previous email... ----- Original Message ----- From: "Kevin Cai" <googol4u@yahoo.com.cn> Sent: Thursday, November 27, 2003 6:02 PM > My point is, it seems that there are something wrong with the source code in radproto.cxx. > When we call the constructor, > RadiusAttr::RadiusAttr( > unsigned char attrType, /// Attribute Type (see #enum AttrTypes#) > int intValue /// 32 bit integer to be stored in the attribute Value > ) > the "intValue" passed should be in host byte ordering. > However, in the code of this constructor, network byte ordering is assumed for "intValue", because > no byte-ordering change has been performed before the following code: > > data[FixedHeaderLength+0] = (BYTE)((intValue>>24) & 0xff); > data[FixedHeaderLength+1] = (BYTE)((intValue>>16) & 0xff); > data[FixedHeaderLength+2] = (BYTE)((intValue>>8) & 0xff); > data[FixedHeaderLength+3] = (BYTE)(intValue & 0xff); > > Did I make any mistakes? ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ List: Openh323gk-users@lists.sourceforge.net Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549 Homepage: http://www.gnugk.org/