How can i use these functions to convert nertwork data to host data? (im sure that was poorly worded but im fairly new to this). I have a captured ICMP packet and have read from the file into a buffer and then populated a structure representing ethernet, ip packet and icmp structures.
I think i need to use the above ntohs and nothl functions on some of the data to make sense of it. I am just assuming this because if i were to use the program backwards to craft a packet, i would need to use honts and hontl on things like the packet identification and packet length.
So how could i use this on data already stored in a structure.
Any pointers or example code would be very much appreciated.
Cheers
Andy