2 * Acess2 POSIX Sockets Library
3 * - By John Hodge (thePowersGang)
11 static uint32_t Flip32(uint32_t val)
13 return (((val >> 24) & 0xFF) << 0)
14 | (((val >> 16) & 0xFF) << 8)
15 | (((val >> 8) & 0xFF) << 16)
16 | (((val >> 0) & 0xFF) << 24)
20 static uint16_t Flip16(uint16_t val)
22 return (val >> 8) | (val << 8);
25 uint32_t htonl(uint32_t hostlong)
30 return Flip32(hostlong);
33 uint16_t htons(uint16_t hostshort)
38 return Flip16(hostshort);
41 uint32_t ntohl(uint32_t netlong)
46 return Flip32(netlong);
49 uint16_t ntohs(uint16_t netshort)
54 return Flip16(netshort);