DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

byteorder(SLIB)


byteorder: htons, htonl, ntohl, ntohs -- convert values between host and network byte order

Syntax

cc ... -lsocket

#include  <sys/types.h>
#include  <netinet/in.h>

u_long htonl(hostlong); u_long hostlong;

u_short htons(hostshort); u_short hostshort;

u_long ntohl(netlong); u_long netlong;

u_short ntohs(netshort); u_short 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), getservent(SLIB)
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003