IHL vs shift 6 vs accurate location in upper layers

Linux Advanced Routing and Traffic Control

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

 



Hello all hope all is well

I looked around and have tried to get this sorted on multiple
occasions, but just can't get it
how does dividing by 64/2^6, ~ shift 6, ultimately get you to
something like the proper location for a src port in layer 4?
I get, after reading again and again and looking at ip packet header
diagrams, offset at 0 and the mask used to extract the IHL from the
16bit word.
But then comes 'ol shift 6 ... right-shifting by 6 eliminates the
offset of the field and at the same time converts the value into byte
unit ....and I am lost again
IHL # 32 bit words I guess dividing by 64 bits will get you bytes
multiples 8 and then I have nothing

googling around verified binary math and this is dividing by 64, but
that's where it ends, anything else is people just using it. I figure
I must be missing the deal.
Would like to understand it to fully use

thanks and regards
--
To unsubscribe from this list: send the line "unsubscribe lartc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux