man(1) Manual page archive


     INTERNET(3X)                                         INTERNET(3X)

     NAME
          in_host, in_ntoa, in_address, in_service - internet
          networking functions

     SYNOPSIS
          #include <sys/inet/in.h>

          char *in_host(hostaddr)
          in_addr hostaddr;

          char *in_ntoa(hostaddr)
          in_addr hostaddr;

          in_addr in_address(hostname)
          char *hostname;

          struct in_service *in_service(name, proto, port)
          char *name, *proto;
          unsigned long port;

     DESCRIPTION
          These routines are loaded by the -lin option of ld(1).

          Internet addresses, type in_addr, are 32-bit quantities glo-
          bal to the network.  The ASCII representation of an in_addr
          can be either a host name or of the form b1.b2.b3.b4, where
          each `bx' is the value of the x'th byte of the address in
          decimal.  Since host names are considered local `aliases'
          for internet addresses, the host-to-address mapping is sub-
          jective.

          In_address maps an internet host name to an address and
          returns 0 if the name is not found in the host table.

          In_host maps an internet address into a host name.  If the
          host is not found in the host table, the ASCII representa-
          tion of the address is returned.

          In_ntoa maps an internet address to its ASCII numeric for-
          mat.

          In_service returns the closest match to name in the services
          file.  If either name or port are 0, they will match any
          name or port.  If proto is (char *)0, the tcp protocol is
          assumed.

     FILES
          /usr/inet/lib/hosts             mapping between host names and addresses
          /usr/inet/lib/networks          mapping between network names and addresses
          /usr/inet/lib/services          database of services

     INTERNET(3X)                                         INTERNET(3X)

          /usr/inet/lib/hosts.equiv       machines with common administration

     SEE ALSO
          ipc(3), tcp(3), udp(3)

     BUGS
          The mappings between internet addresses and names is arbi-
          trary at best.  The hosts file may contain many addresses
          for each name and/or many names for each address.
          In_address and in_host each start at the beginning of the
          file and search sequentially for a match.  Therefore,
          in_addr(in_host(addr)) == addr is not necessarily true.