Big and little indian valid in a byte??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
#else
#error  "Please fix <asm/byteorder.h>"
#endif
         __u8    tos;
         __u16   tot_len;
         __u16   id;
         __u16   frag_off;
         __u8    ttl;
         __u8    protocol;
         __u16   check;
         __u32   saddr;
         __u32   daddr;
         /*The options start here. */
};

Thanks,
syed k



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux