While using socket.htons(proto) in my project, it gives a value of 43200. What does that mean?
I know socket.htons(0x0800) = 8 which means IPv4. If 8 is for IPv4, what does 43200 mean?
While using socket.htons(proto) in my project, it gives a value of 43200. What does that mean?
I know socket.htons(0x0800) = 8 which means IPv4. If 8 is for IPv4, what does 43200 mean?
Ture Pålsson
On
43200 is A8C0 in hex. Since you're doing htons, and most hosts these days are little-endian, the bytes on the wire are probably c0, a8. Now in decimal, that is 192, 168, which is suspiciously like the first two bytes of a typical RFC1918 IP address, so my hunch is that you are interpreting the wrong bytes of some packet.
For example, here is someone who managed to get the same value by mistake.
Copyright © 2021 Jogjafile Inc.
You have noticed that "43200" is 86400/2 and 86400 is the number of seocnds in a day, hmm?