minix man page for hton

Query: hton

OS: minix

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

HTON(3) 						     Library Functions Manual							   HTON(3)

NAME
hton, htons, htonl, ntohs, ntohl - host to network byte order conversion
SYNOPSIS
#define _MINIX_SOURCE 1 #include <stddef.h> #include <sys/types.h> #include <net/hton.h> u16_t htons(u16_t host_word) u32_t htonl(u32_t host_dword) u16_t ntohs(u16_t network_word) u32_t ntohl(u32_t network_dword) u16_t HTONS(u16_t host_word) u32_t HTONL(u32_t host_dword) u16_t NTOHS(u16_t network_word) u32_t NTOHL(u32_t network_dword)
DESCRIPTION
These macros convert 16-bit and 32-bit quantities to and from the network byte order used by the TCP/IP protocols. The function of the macros is encoded in their name. H means host byte order, n means network byte order, s means a 16-bit quantity and l means a 32-bit quan- tity. Thus htons converts a 16-bit quantity from host byte order to network byte order. The difference between the lower case and upper case variants is that the lower case variants evaluate the argument at most once and the upper case variants can be used for constant fold- ing. That is, htonl(f(x)) will call f(x) at most once and HTONS(0x10) will be equivalent to 0x10 on a big-endian machine and 0x1000 on a little-endian machine.
SEE ALSO
ip(4).
AUTHOR
Philip Homburg (philip@cs.vu.nl) HTON(3)
Related Man Pages
htonl(3xnet) - opensolaris
htons(3xnet) - opensolaris
ntohl(3xnet) - opensolaris
byteorder(3) - minix
byteorder(3) - v7
Similar Topics in the Unix Linux Community
ntohs
Troj_vundo.aeh