Index Index for
Section 9r
Index Alphabetical
listing for N
Bottom of page Bottom of
page

ntohl(9r)

NAME

ntohl, ntohs - General: Convert longword and word values from network-to- host byte order

SYNOPSIS

#include <sys/param.h> unsigned int ntohl( unsigned int longword ); unsigned short ntohs( unsigned short word );

ARGUMENTS

longword Specifies a 32-bit value to be conditionally byte swapped. word Specifies a 16-bit value to be conditionally byte swapped.

DESCRIPTION

The ntohl routine converts the specified longword value from network-to- host byte order. The ntohs routine converts the specified word value from network-to-host byte order. The TCP/IP protocols specify the canonical network byte order, which is big endian (meaning that the most significant byte is leftmost in memory).

RETURN VALUES

Upon successful completion, the ntohl routine returns the converted longword value in host byte order. Similarly, upon successful completion, the ntohs routine returns the converted word value in host byte order.

SEE ALSO

Routines: htonl(9r)

Index Index for
Section 9r
Index Alphabetical
listing for N
Top of page Top of
page