Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ htonl(3) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gethostbyaddr, gethostbyname, sethostent, endhostent .*5a, gethostent

getservent, getservbyname, getservbyport, setservent, endservent

     htonl, htons, ntohl, ntohs

Purpose

     Convert  values between  host and  Internet network  byte
     order.

Library

     Sockets Library (libsock.a)

Syntax

     #include <sys/types.h>
     #include <netinet/in.h>

     unsigned long htonl (hostlong)            unsigned long ntohl (netlong)
     unsigned long hostlong;                   unsigned long netlong;

     unsigned short htons (hostshort)          unsigned short ntohs (netshort)
     unsigned short hostshort;                 unsigned short netshort;
     Description

     These  subroutines  convert  16-  and  32-bit  quantities
     between network byte order and host byte order.

     These  subroutines are  often  used  in conjunction  with
     Internet  addresses   and  ports   as  returned   by  the
     gethostent and getservent subroutines.

     Related Information

     In   this   book:     "   gethostbyaddr,   gethostbyname,
     sethostent, endhostent .*5a, gethostent" and "getservent,
     getservbyname, getservbyport, setservent, endservent."

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026