Query: ntohs
OS: opensolaris
Section: 3socket
Links: opensolaris man pages all man pages forum categories
Format:Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
byteorder(3SOCKET) Sockets Library Functions byteorder(3SOCKET)NAMEbyteorder, htonl, htonll, htons, ntohl, ntohll, ntohs - convert values between host and network byte orderSYNOPSIScc [ flag... ] file... -lsocket -lnsl [ library... ] #include <sys/types.h> #include <netinet/in.h> #include <inttypes.h> uint32_t htonl(uint32_t hostlong); uint64_t htonll(uint64_t hostlonglong); uint16_t htons(uint16_t hostshort); uint32_t ntohl(uint32_t netlong); uint64_t ntonll(uint64_t hostlonglong); uint16_t ntohs(uint16_t netshort);DESCRIPTIONThese 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() and getservent(). See gethostbyname(3NSL) and getservbyname(3SOCKET).ATTRIBUTESSee attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+SEE ALSOgethostbyname(3NSL), getservbyname(3SOCKET), inet.h(3HEAD), attributes(5) SunOS 5.11 10 Sep 2008 byteorder(3SOCKET)