gtpc1m3xTransmission Control Protocol/Internet Protocol

htonl -- Translate a Long Integer

The htonl function translates a long integer from host byte order to network byte order.

Format

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

a
Unsigned long integer to be put into network byte order.

Normal Return

Returns the translated long integer.

Error Return

None.

Programming Considerations

None.

Examples

The following example converts the information from host byte order to network byte order.

#include <types.h>
#include <socket.h>

·
·
·
u_long a; u_long n;
·
·
·
n = htonl(a);

Related Information