ntohs()

The ntohs() call translates a short integer from network-byte order to host-byte order.

Syntax

#include <types.h>
u_short ntohs(a)
u_short a;

Parameters

a

Description

This call translates a short integer from network-byte order to host-byte order. Receiving hosts require addresses and ports in host-byte order. Use the ntohs() call to convert ports to the host integer representation.

Return Values

The ntohs() call returns the translated short integer.

Related Calls


[Back: ntohl()]
[Next: putlong()]