Network-Byte Order Translation
Internet domain ports and addresses are usually specified to calls using
the network-byte ordering convention. The following calls translate integers
from host- to network-byte order and from network- to host-byte order.
htonl()
Translates host to network, long integer
(32-bit)
htons()
Translates host to network, short integer
(16-bit)
ntohl()
Translates network to host, long integer
(32-bit)
ntohs()
Translates network to host, short integer
(16-bit)
[Back: Network Address Translation]
[Next: Internet Address Manipulation]