[ECOS] REAL meaning of little-endian and big-endian?

张 亮 johnsonest@hotmail.com
Mon Dec 16 22:25:00 GMT 2002


hello,every one!
    I have a "old" and "simple" question (i think like this before):
     1  both endian mode only differ in byte order? how  bit-order in one 
byte?
     2   if differ in bit order,one byte with little-endian come from 
net,then how me(receiver host with big-endian) to read it correctlly? from 
IP processing,it simplely read it! why?
    3 if identical in bit order,why so define:

struct ip_hdr
{

#if BYTE_ORDER ==LITTLE_ENDIAN 
 unsigned char ip_version;4,
               ip_hlen:4;
#elif BYTE_ORDER ==BIG_ENDIAN
unsigned char ip_hlen :4,
              ip_version:4;
#endif

BRS/zhangliang





}
     




_________________________________________________________________
Ãâ·ÑÏÂÔØ MSN Explorer:  http://explorer.msn.com/lccn/


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list