<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=KOI8-R" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Because the length represents not amount if bytes (octets)<br>
but amount of WORDs (32bit or 4 bytes). <br>
<br>
That's why we should multiply by 4 to get actual amount of bytes.<br>
<br>
Read rfc791 to get full information about ip header.<br>
<br>
</tt><br>
ahsan askari wrote:
<blockquote
cite="mid3cd044c90607050648r77e4bd15i1140d50468bd74bb@mail.gmail.com"
type="cite">Could anybody please tell me what this piece of code will
do<br>
<br>
ip_len = (ih->ver_ihl & 0xf) * 4;<br>
<br>
I know that we are "anding" ver_ihl to make all the bits equal to 1 but
why are we multiplying it by 4. <br>
<br>
Thank you<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Winpcap-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a>
<a class="moz-txt-link-freetext" href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="80">--
Best regards. Vasily Borovyak <a class="moz-txt-link-rfc2396E" href="mailto:vbor@isd.dp.ua"><vbor@isd.dp.ua></a></pre>
</body>
</html>