ntohl(3) — Subroutines
NAME
ntohl − Converts an unsigned 32-bit integer from Internet network byte order to host byte order
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <netinet/in.h>/∗O
unsigned int ntohl (
unsigned int netint) ;
PARAMETERS
netintSpecifies a 32-bit integer in network-byte order.
DESCRIPTION
The ntohl() (network-to-host long) function converts an unsigned 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 integer in host-byte order.