You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
please can explain to me why the lines of code: version_ihl = iph[0]
version = version_ihl >> 4
ihl = version_ihl & 0xF
iph_length = ihl * 4
ttl = iph[5]
protocol = iph[6]
s_addr = socket.inet_ntoa(iph[8]);
d_addr = socket.inet_ntoa(iph[9]);
Especially why the lag of 4 bit right and why we do version_ihl & 0xF and the multiplication by four and the rest iph [i] on how many byte gold , iph a byte array or bit !!!
thank you in advance for your answer.
The text was updated successfully, but these errors were encountered:
please can explain to me why the lines of code: version_ihl = iph[0]
version = version_ihl >> 4
ihl = version_ihl & 0xF
iph_length = ihl * 4
ttl = iph[5]
protocol = iph[6]
s_addr = socket.inet_ntoa(iph[8]);
d_addr = socket.inet_ntoa(iph[9]);
Especially why the lag of 4 bit right and why we do version_ihl & 0xF and the multiplication by four and the rest iph [i] on how many byte gold , iph a byte array or bit !!!
thank you in advance for your answer.
The text was updated successfully, but these errors were encountered: