/*
* Functions hton16 and hton32 convert the host
* representation of integer numbers into the network
* representation as defined in "Trivial Internet Protocol",
* section 2.1.
* ntoh32 and ntoh16 are reverse functions to hton32 and hton16.
*
* Adjust the following definitions for the particular
* hardware and C complier.
*/
#define hton16(n) (((uint16)(n) >> 8) | ((uint16)(n) << 8))
#define hton32(n) (ntoh16((uint32)(n) >> 16) | (ntoh16(n) << 16))
#define ntoh16(n) hton16(n)
#define ntoh32(n) hton32(n)