htonl()

The socket call translates a long integer from host-byte order to network-byte order.

Syntax

#include <types.h>
u_long htonl(a)
u_long a;

Parameters

a

Description

The htonl() call 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() call to convert the host integer representation of addresses and ports to internet network-byte order.

Return Values

Returns the translated long integer.

Related Calls


[Back: h_errno]
[Next: htons()]