byteorder(3N-xs) (X/OPEN SOCKETS) byteorder(3N-xs)
NAME
byteorder: htonl, htons, ntohl, ntohs - convert values between host
and network byte order
SYNOPSIS
cc [flag ...] file ... -lxnet [library ...]
#include <arpa/inet.h>
inaddrt htonl(inaddrt hostlong);
inportt htons(inportt hostshort);
inaddrt ntohl(inaddrt netlong);
inportt ntohs(inportt netshort);
DESCRIPTION
These functions convert 16-bit and 32-bit quantities between network
byte order and host byte order.
RETURN VALUES
The htonl and htons functions return the argument value converted from
host to network byte order.
The ntohl and ntohs functions return the argument value converted from
network to host byte order.
SEE ALSO
gethostent(3N-xs), getservent(3N-xs), inet(5).
Page 1 Reliant UNIX 5.44 Printed 11/98