Standard C Library Functions
NAME byteorder, htonl, htonll, htons, ntohl, ntohll, ntohs — convert values between host and network byte order
LIBRARY Standard C Library (libc, -lc)
SYNOPSIS #include <sys/types.h>
These functions convert 16-bit, 32-bit, and 64-bit quantities between network byte order and host byte order. On some architectures these routines are defined as NULL
macros in the include file <netinet/in.h>
. On other architectures, the routines are functional when the host byte order is different from network byte order.
These functions are most often used in conjunction with Internet addresses and ports as returned by gethostent(3NSL)