Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getprotoent(3N) — HP-UX 5.50

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

protocols(5)

     GETPROTOENT(3N)          Series 300 Only          GETPROTOENT(3N)

     NAME
          getprotoent, getprotobynumber, getprotobyname,  setprotoent,
          endprotoent - get protocol entry

     SYNOPSIS
          #include <netdb.h>

          struct protoent *getprotoent()

          struct protoent *getprotobyname(name)
          char *name;

          struct protoent *getprotobynumber(proto)
          int proto;

          setprotoent(stayopen)
          int stayopen

          endprotoent()

     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).

          Getprotoent,  getprotobyname,  and   getprotobynumber   each
          return  a pointer to a structure of type protoent containing
          the broken-out fields of a line in the network protocol data
          base, /etc/protocols.

          The members of this structure are:

          p_name     The official name of the protocol.

          p_aliases  A null-terminated list of alternate names for the
                     protocol.

          p_proto    The protocol number.

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

          Setprotoent opens and rewinds the  file.   If  the  stayopen
          flag is non-zero, the net data base will not be closed after
          each call to getprotoent  (either  directly,  or  indirectly
          through one of the other getproto calls).

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

     GETPROTOENT(3N)          Series 300 Only          GETPROTOENT(3N)

          Endprotoent closes the file.

          Getprotobyname and getprotobynumber sequentially search from
          the  beginning  of  the  file until a matching protocol name
          (among either the official names or the aliases) or protocol
          number is found, or until EOF is encountered.
     FILES
          /etc/protocols

     SEE ALSO
          protocols(5).

     RETURN VALUE
          Getprotoent, getprotobyname and  getprotobynumber  return  a
          null  pointer  (0)  on  EOF  or when they are unable to open
          /etc/protocols.

     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