Converts an unsigned long integer from host byte order to Internet network byte order.
ISODE Library (libisode.a)
#include <sys/types.h> #include <netinet/in.h>
unsigned long htonl ( HostLong)
unsigned long HostLong;
The htonl subroutine converts an unsigned long (32-bit) integer from host byte order to Internet network byte order.
The Internet network requires addresses and ports in network standard byte order. Use the htonl subroutine to convert the host integer representation of addresses and ports to Internet network byte order.
The htonl subroutine is defined in the net/nh.h file as a macro.
All applications containing the htonl 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.
HostLong | Specifies a 32-bit integer in host byte order. |
The htonl subroutine returns a 32-bit integer in Internet network byte order (most significant byte first).
The htons subroutine, ntohl subroutine, ntohs subroutine.
Sockets Overview in AIX 5L Version 5.2 Communications Programming Concepts.