Hello,
I am trying to reverse engineer a class within the open source ntop project sub-project nDPI.
The class considers a packet payload and uses a macro to compare two bytes (a word) to a little endian returned by htons() and htonl().
I would like to take the input values to htons() and htonl() and convert them to their 32-bit chars value.
It appears that htons() takes a 16-bit number in host byte order as an argument, and htonl() take a 32-bit number in host byte order as an argument.
How do I convert a "16-bit number in host byte order" or a "32-bit number in host byte order" into a 32-bit char value?
I'm definitely getting some wires crossed in my brain.
Thanks,
Matt