*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> byteorder (3)              
Title
Content
Arch
Section
 

BYTEORDER(3)

Contents


NAME    [Toc]    [Back]

       htonl,  htons,  ntohl,  ntohs - convert values between host and network
       byte order

SYNOPSIS    [Toc]    [Back]

       #include <netinet/in.h>

       unsigned long int htonl(unsigned long int hostlong);

       unsigned short int htons(unsigned short int hostshort);

       unsigned long int ntohl(unsigned long int netlong);

       unsigned short int ntohs(unsigned short int netshort);

DESCRIPTION    [Toc]    [Back]

       The htonl() function converts the long integer hostlong from host  byte
       order to network byte order.

       The  htons()  function  converts  the short integer hostshort from host
       byte order to network byte order.

       The ntohl() function converts the long  integer	netlong  from  network
       byte order to host byte order.

       The  ntohs()  function converts the short integer netshort from network
       byte order to host byte order.

       On the i80x86 the host byte order  is  Least  Significant  Byte	first,
       whereas	the  network byte order, as used on the Internet, is Most Significant
 Byte first.

CONFORMING TO    [Toc]    [Back]

       BSD 4.3

SEE ALSO    [Toc]    [Back]

      
      
       gethostbyname(3), getservent(3)



BSD				  1993-04-15			  BYTEORDER(3)
[ Back ]
 Similar pages
Name OS Title
htons Tru64 Convert an unsigned short (16-bit) integer from host byte order to network byte order
ntohl Tru64 Convert an unsigned 32-bit integer from Internet network byte order to host byte order
letoh16 OpenBSD convert values between different byte orderings
htons OpenBSD convert values between different byte orderings
htole64 OpenBSD convert values between different byte orderings
letoh32 OpenBSD convert values between different byte orderings
letoh64 OpenBSD convert values between different byte orderings
swap64 OpenBSD convert values between different byte orderings
ntohs OpenBSD convert values between different byte orderings
ntohl OpenBSD convert values between different byte orderings
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service