Преобразовать 16-битное значение из сетевого байтового порядка к байтовому порядку хоста
#include <arpa/inet.h>uint16_t ntohs( uint16_t netshort );
libc
The ntohs() function converts a 16
-bit value from network-byte order to host-byte order. If a machine's byte order is the same as the network order, this routine is defined as a null macro.
You most often use this routine in conjunction with internet addresses and ports returned by gethostbyname() and getservent().
The value in host-byte order.
POSIX 1003.1
gethostbyname(), getservent(), htonl(), htons(), ntohl()
Предыдущий раздел: Описание API системной библиотеки