Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getnetent(3N) — HP-UX 5.50

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

networks(5)

     GETNETENT(3N)            Series 300 Only            GETNETENT(3N)

     NAME
          getnetent, getnetbyaddr, getnetbyname, setnetent,  endnetent
          - get network entry

     SYNOPSIS
          #include <netdb.h>

          struct netent *getnetent()

          struct netent *getnetbyname(name)
          char *name;

          struct netent *getnetbyaddr(net, type)
          int net, type;

          setnetent(stayopen)
          int stayopen

          endnetent()

     HP-UX COMPATIBILITY
          Level:    HP-UX/NON-STANDARD

          Origin:   UCB

          Remarks:  Implemented on the Series 300 only.

     DESCRIPTION
          These libraries can  be  accessed  by  giving  the  -lbsdipc
          option to ld(1).

          Getnetent, getnetbyname,  and  getnetbyaddr  each  return  a
          pointer  to  a  structure  of  type  netent  containing  the
          broken-out fields of  a  line  in  the  network  data  base,
          /etc/networks.

          The members of this structure are:

          n_name      The official name of the network.

          n_aliases   A null-terminated list of  alternate  names  for
                      the network.

          n_addrtype  The type of the network number returned;  always
                      AF_INET.

          n_net       The network number.

          Getnetent reads the next line of the file, opening the  file
          if necessary.

          Setnetent opens and rewinds the file.  If the stayopen  flag

     Hewlett-Packard               - 1 -             (printed 7/16/86)

     GETNETENT(3N)            Series 300 Only            GETNETENT(3N)

          is non-zero, the net data base will not be closed after each
          call to getnetent (either directly,  or  indirectly  through
          one of the other getnet calls).

          Endnetent closes the file.

          Getnetbyname and getnetbyaddr sequentially search  from  the
          beginning  of  the  file  until  a  matching net name (among
          either the official names or the aliases) or net address  is
          found,  or  until  EOF  is encountered.  Network numbers are
          supplied in host order; see byteorder(3N).

     FILES
          /etc/networks

     SEE ALSO
          networks(5).

     RETURN VALUE
          Getnetent,  getnetbyname  and  getnetbyaddr  return  a  null
          pointer  (0)  on  EOF  or  when  they  are  unable  to  open
          /etc/networks.

     WARNINGS
          All information is contained in a static area so it must  be
          copied if it is to be saved.

     Hewlett-Packard               - 2 -             (printed 7/16/86)

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