ntohs

Converts 16-bit quantities from network to host byte order.

Library:LibC
Standard:BSD
Service:Networking

Syntax

  #include <sys/byteorder.h> 
   
  unsigned short ntohs (
     unsigned short   netshort);
  

Parameters

netshort

(IN) Specifies a 16-bit quantity in network byte order.

Return Values

Returns a value that has been converted from network to host byte order.

Remarks

NOTE:Network data order places the most significant byte at the lower memory address, while host data order places the least significant byte at the lower address.

See Also

htons