Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getprotoent(name) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought







        _________________________________________________________________
        getprotoent, getprotobynumber,           Network Library Function
        getprotobyname, setprotoent,
        endprotoent
        get protocol entry
        _________________________________________________________________


        SYNTAX

        #include <netdb.h>

        struct protoent *getprotoent()

        struct protoent *getprotobyname(name)
        char *name;

        struct protoent *getprotobynumber(proto)
        int proto;

        setprotoent(stayopen)
        int stayopen

        endprotoent()


        DESCRIPTION

        Getprotoent , getprotobyname , and getprotobynumber each return a
        pointer to an object with the following structure containing the
        broken-out fields of a line in the network protocol database,
        /etc/protocols .

             struct    protoent {
                  char *p_name;  /* official name of protocol */
                  char **p_aliases;   /* alias list */
                  long p_proto;  /* protocol number */
             };

        The members of this structure are:

        p_name     The official name of the protocol.

        p_aliases  A zero-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.




        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                          getprotoent(3n)



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

        Endprotoent closes the file.

        Getprotobyname and getprotobynumber sequentially search from  the
        beginning  of the file until a matching protocol name or protocol
        number is found, or until EOF is encountered.

        If your system is using the Yellow Pages (YP), you  may  need  to
        see  Chapter  2  in  Using  the Network File System on Your DG/UX
        System for information on how to update the /etc/protocols file.


        FILES

        /etc/protocols


        SEE ALSO

        protocols(4)


        DIAGNOSTICS

        Null pointer (0) returned on EOF or error.


        BUGS

        All information is contained in a static area,  so  you  have  to
        copy  it if you want to save it.  Only the Internet protocols are
        currently supported.


















        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



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