On Fri, Apr 30, 2004 at 14:37:59 +0530, syedk wrote: > Hi All, > > This is the structure declaration of IP Header. Can you tell me how > little endian and big endian come into picture in the case of a > byte. U can find this declaration in > /usr/src/linux-2.4.18-14/include/linux/ip.h. > > struct iphdr { > #if defined(__LITTLE_ENDIAN_BITFIELD) > __u8 ihl:4, > version:4; > #elif defined (__BIG_ENDIAN_BITFIELD) > __u8 version:4, > ihl:4; You sure know, what the :4 modifier means. So you should know, what's the difference between these two declaratinons. And thus know, what in the compiler is affected by endianity. ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb@ucw.cz>
Attachment:
signature.asc
Description: Digital signature