[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

RE: BIG ENDIAN and LITTLE ENDIAN



Hi

Tanks for your info. I am at present doing some socket  programs. Tough I
have been using these commands I have never been perfectly clear about these
things.

I will explain my doubt in detail

We have htonl & ntohl for 4 bytes
htons & ntohs for 2 bytes

but for a single byte data we normally read it directly from buffer. If any
compatibility problems then it must be there even while operating in single
bytes.



Thanks in advance

Devan




 -----Original Message-----
From: 	Kondaiah (IE10) [mailto:Kondaiah@xxxxxxxxxxxxx]
Sent:	Friday, December 15, 2000 12:10 PM
To:	senthildr@xxxxxxxxxxxxxxxxxx
Subject:	RE: [LIP] BIG ENDIAN and LITTLE ENDIAN

Hi,
Each processor will have its own format of data storage, For example
Motorola processor will store the data in BIGIndian(first bytes will be
Higher order) format
 and Intel processor stores in little Indian format. Inorder  to nullify the
processor effect on tcp/IP It is better to follow network byte order, That's
why all these htonl(host to network long) and all came into picture. This
effect u can see when ur doing socket programming.

Thanks,


> -----Original Message-----
> From:	senthil devan [SMTP:senthildr@xxxxxxxxxxxxxxxxxx]
> Sent:	Sunday, December 15, 2002 11:53 AM
> To:	'linux-india'
> Subject:	[LIP] BIG ENDIAN and LITTLE ENDIAN
>
> Hi
>
> I need some details reg BIG ENDIAN and LITTLE ENDIAN and its importance in
> commands
>
> htonl
> htons
> ntohl
> ntohs
>
> thanks in advance
>
> Devan
>
>
> ---------------------------------------------
> The mailing list archives are available at
> http://lists.linux-india.org/cgi-bin/wilma/LIP