RE: Bit field definition ?

2004-10-10 Thread Li, Qing
In the last episode (Oct 08), Li, Qing said: The bit fields th_x2 and th_off in struct tcphdr, even though defined as u_int, actually occupies 1 byte. u_int th_x2:4,/* (unused) */ th_off:4; /* data offset */ The :4 after each variable means 4 bits

Re: Bit field definition ?

2004-10-10 Thread Dan Nelson
In the last episode (Oct 10), Li, Qing said: In the last episode (Oct 08), Li, Qing said: The bit fields th_x2 and th_off in struct tcphdr, even though defined as u_int, actually occupies 1 byte. u_int th_x2:4,/* (unused) */ th_off:4; /* data offset

Re: Bit field definition ?

2004-10-08 Thread Dan Nelson
In the last episode (Oct 08), Li, Qing said: The bit fields th_x2 and th_off in struct tcphdr, even though defined as u_int, actually occupies 1 byte. u_int th_x2:4,/* (unused) */ th_off:4; /* data offset */ The :4 after each variable means 4 bits long,