This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

REAL meaning of little-endian and big-endian?



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]