question about pcap

Posted by scatman on Stack Overflow See other posts from Stack Overflow or by scatman
Published on 2010-03-16T06:53:33Z Indexed on 2010/03/16 6:56 UTC
Read the original article Hit count: 551

hi, i have to do a sniffer as an assignment for the security course. i am using c and the pcap library. i got everything working well (since i got a code from the internet and changed it). but i have some questions about the code.

u_int ip_len = (ih->ver_ihl & 0xf) * 4;   

ih is of type ip_header, and its currently pointing the to ip header in the packet.
ver_ihl gives the version of the ip
i can't figure out what is: & 0xf) * 4;
any help?

© Stack Overflow or respective owner

Related posts about pcap

Related posts about security