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

  man pages->Tru64 Unix man pages -> htons (3)              
Title
Content
Arch
Section
 

htons(3)

Contents


NAME    [Toc]    [Back]

       htons  -  Convert  an unsigned short (16-bit) integer from
       host byte order to network byte order

SYNOPSIS    [Toc]    [Back]

       #include <arpa/inet.h>

       in_port_t htons(
               in_port_t hostshort );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

STANDARDS    [Toc]    [Back]

       Interfaces documented on this reference  page  conform  to
       industry standards as follows:

       htons():  XNS4.0, XNS5.0

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Specifies a 16-bit integer in host byte order.

DESCRIPTION    [Toc]    [Back]

       The htons() (host-to-network short) function  converts  an
       unsigned  short  (16-bit)  integer from host byte order to
       Internet network-byte order.

       The Internet network requires address and  port  reference
       data  in  network-byte  order. Use the htons() function to
       convert address and port short  integers  from  host  byte
       order to Internet network-byte order.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, the htons() function returns a
       16-bit short integer in Internet network-byte order.

ERRORS    [Toc]    [Back]

       Current industry standards do not define error values  for
       the htons() function.

SEE ALSO    [Toc]    [Back]

      
      
       Functions:    endhostent(3),    endservent(3),   htonl(3),
       ntohl(3), ntohs(3).

       Standards: standards(5).

       Network Programmer's Guide



                                                         htons(3)
[ Back ]
 Similar pages
Name OS Title
ntohl Tru64 Convert an unsigned 32-bit integer from Internet network byte order to host byte order
byteorder IRIX convert values between host and network byte order
byteorder Linux convert values between host and network byte order
byteorder NetBSD convert values between host and network byte order
ntohs NetBSD convert values between host and network byte order
ntohl NetBSD convert values between host and network byte order
htons NetBSD convert values between host and network byte order
htonl NetBSD convert values between host and network byte order
ntohs FreeBSD convert values between host and network byte order
htonl FreeBSD convert values between host and network byte order
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service