  Sockets Library Functions                      byteorder(3SOCKET)
  
  
  
  NAME
<      byteorder, htonl,  htons,  ntohl,  ntohs  -
--
>      byteorder, htonl, htonll, htons, ntohl, ntohll, ntohs  -
       convert values between host and network byte order
  
  SYNOPSIS
       cc [ flag... ] file... -lsocket  -lnsl  [ library... ]
       #include <sys/types.h>
       #include <netinet/in.h>
       #include <inttypes.h>
  
       uint32_t htonl(uint32_t hostlong);
>
>
>      uint64_t htonll(uint64_t hostlonglong);
  
  
       uint16_t htons(uint16_t hostshort);
  
  
       uint32_t ntohl(uint32_t netlong);
>
>
>      uint64_t ntohll(uint64_t netlonglong);
  
  
       uint16_t ntohs(uint16_t netshort);
  
  
  DESCRIPTION
<      These routines convert 16-bit and 32-bit quantities  between
--
>      These routines convert 16-bit, 32-bit and 64-bit quantities
       between network  byte  order  and host byte order. On some
       architectures these routines are defined as NULL macros in the
       include  file  <netinet/in.h>.  On  other architectures, the
       routines are functional when the host  byte  order  is  dif-
       ferent from network byte order.
  
  
       The routines are most often used in conjunction with  Inter-
       net addresses and ports as returned by gethostent() and get-
       servent().        See        gethostbyname(3NSL)         and
       getservbyname(3SOCKET).
  
  ATTRIBUTES
       See attributes(5) for descriptions of the  following  attri-
       butes:
  
  
  
       ____________________________________________________________
      |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
      |_____________________________|_____________________________|
      | MT-Level                    | Safe                        |
      |_____________________________|_____________________________|
  
  
  SEE ALSO
       gethostbyname(3NSL), getservbyname(3SOCKET),  inet.h(3HEAD),
       attributes(5)
  
  
  
> SunOS 5.11          Last change: 19 Feb 2004                    1
--
< SunOS 5.11          Last change: 21 Jul 2008                    1
