Converts an unsigned long integer from Internet network standard byte order to host byte order.
#include <sys/types.h> #include <netinet/in.h>
unsigned long ntohl ( NetLong)
unsigned long NetLong;
The ntohl subroutine converts an unsigned long (32-bit) integer from Internet network standard byte order to host byte order.
Receiving hosts require addresses and ports in host byte order. Use the ntohl subroutine to convert Internet addresses and ports to the host integer representation.
The ntohl subroutine is defined in the net/nh.h file as a macro.
NetLong | Requires a 32-bit integer in network byte order. |
The ntohl subroutine returns a 32-bit integer in host byte order.
The ntohl subroutine is part of Base Operating System (BOS) Runtime.
All applications containing the ntohl subroutine must be compiled with _BSD set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
The endhostent subroutine, endservent subroutine, gethostbyaddr subroutine, gethostbyname subroutine, getservbyname subroutine, getservbyport subroutine, getservent subroutine, htonl subroutine, htons subroutine, ntohs subroutine, sethostent subroutine, setservent subroutine.
Sockets Overview in AIX 5L Version 5.1 Communications Programming Concepts.