ntohl(3) — Subroutines
OSF
NAME
ntohl − Converts an unsigned long (32-bit) integer from Internet network-byte order to host-byte order
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <netinet/in.h> unsigned long ntohl (
unsigned long netlong) ;
PARAMETERS
netlongSpecifies a 32-bit integer in network-byte order.
DESCRIPTION
The ntohl() (network-to-host long) function converts an unsigned long (32-bit) integer from Internet network-byte order to host-byte order.
The Internet network requires address and port reference data in network-byte order (most significant byte leftmost, least significant byte rightmost). You can use the ntohl() function to convert Internet network address and port data to host byte-ordered integers.
The ntohl() function is defined as a little-endian function in the netinet/in.h header file for machine environments where network-byte order and host-byte order are not identical.
RETURN VALUES
The ntohl() function returns a 32-bit long integer in host-byte order.