![]() |
![]() |
![]() |
Convert a 32-bit value from host-byte order to network-byte order
#include <netinet/in.h> in_addr_t htonl( in_addr_t hostlong );
libsocket
The htonl() function converts a 32-bit value from host-byte order to network-byte order.
This routine is most often used in conjunction with internet addresses and ports returned by gethostbyname() and getservent().
The value in network-byte order.
Standard Unix, POSIX 1003.1g (draft)
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |
gethostbyname(), getservent(), htons(), ntohl(), ntohs()
![]() |
![]() |
![]() |