|
-
March 21st, 2005, 03:22 AM
#1
Offset field and '<<' operator
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|