At Wed, 31 May 2006 21:57:03 -0700, Emil Kondayan wrote: > > Can someone tell me why "ip_hl" and "ip_v" are of type "u_int" when the > structure is packed and they only fill a byte?
u_int means unsigned int and they only fill a byte because 4 + 4 = 8 bits (a byte) (I'm not going into the "Why is a byte 8 bits?" question ;-). This structure is composed of bitfields and it means that when you access a bitfield element (for example, ip_hl) you are only manipulating 4 bits instead of sizeof(unsigned int) bytes (8 bit several computer arquitectures). Any C book should explain bitfield structs/unions clearly. > And my second question:do these "#define ..." directives allocate space in > the > structure? No, read about the C pre-processor (again, in every C book). _______________________________________________ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "[EMAIL PROTECTED]"