k_preeth
March 21st, 2005, 02:22 AM
Hi,
Can anybody tell me what the following lines of code mean? What is the '<<' operator? Why is the offset field 'AND'ed?
unsigned short foff=ntohs(iph->ip_off);
printf("RES : %u \n",(foff && (1 << 0)));
printf("DF : %u \n",(foff && (1 << 1)));
printf("MF : %u \n",(foff && (1 << 2)));
printf("Offset : %u \n",((foff && 0x1fff) << 3));
Thanks.
Preeth.
Can anybody tell me what the following lines of code mean? What is the '<<' operator? Why is the offset field 'AND'ed?
unsigned short foff=ntohs(iph->ip_off);
printf("RES : %u \n",(foff && (1 << 0)));
printf("DF : %u \n",(foff && (1 << 1)));
printf("MF : %u \n",(foff && (1 << 2)));
printf("Offset : %u \n",((foff && 0x1fff) << 3));
Thanks.
Preeth.