byteorder(SLIB) 6 January 1993 byteorder(SLIB) Name byteorder, htons, htonl, ntohl, ntohs - convert values between host and network byte order Syntax #include <sys/types.h> #include <netinet/in.h> netlong = htonl(hostlong); unsigned long netlong, hostlong; netshort = htons(hostshort); ushort netshort, hostshort; hostlong = ntohl(netlong); unsigned long hostlong, netlong; hostshort = ntohs(netshort); ushort hostshort, netshort; Description These routines convert 16 and 32 bit quantities between network byte order and host byte order. These routines are most often used in conjunction with Internet addresses and ports as returned by gethostbyname(SLIB) and getservent(SLIB). See also gethostbyname(SLIB) and getservent(SLIB).