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>
uint64_t htonll ( HostLong)
uint64_t HostLong;
The htonll subroutine converts an unsigned long (64-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 htonll subroutine to convert the host integer representation of addresses and ports to Internet network byte order.
The htonll subroutine is defined in the net/nh.h file as a null macro if the host byte order is the same as the network byte order.
The htonll subroutine is declared in the net/nh.h file as a function if the host byte order is not the same as the network byte order.
All applications containing the htonll subroutine must be compiled with the _BSD macro set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
Item | Description |
---|---|
HostLong | Specifies a 64-bit integer in host byte order. |
The htonll subroutine returns a 64-bit integer in Internet network byte order (most significant byte first).